@usepowerplant/cli 0.4.42 → 0.4.44

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/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4a7f0d72-480c-5c4a-9ad7-eecd1b852192")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e21c9e8f-a5a6-561f-b7c6-99dd92ba2436")}catch(e){}}();
3
3
  import { createRequire as __cliCreateRequire } from 'node:module';
4
4
  const require = __cliCreateRequire(import.meta.url);
5
5
  var __create = Object.create;
@@ -7495,19 +7495,19 @@ var require_module_details_from_path = __commonJS({
7495
7495
  basedir += segments[i] + sep2;
7496
7496
  }
7497
7497
  }
7498
- var path69 = "";
7498
+ var path70 = "";
7499
7499
  var lastSegmentIndex = segments.length - 1;
7500
7500
  for (var i2 = index + offset; i2 <= lastSegmentIndex; i2++) {
7501
7501
  if (i2 === lastSegmentIndex) {
7502
- path69 += segments[i2];
7502
+ path70 += segments[i2];
7503
7503
  } else {
7504
- path69 += segments[i2] + sep2;
7504
+ path70 += segments[i2] + sep2;
7505
7505
  }
7506
7506
  }
7507
7507
  return {
7508
7508
  name,
7509
7509
  basedir,
7510
- path: path69
7510
+ path: path70
7511
7511
  };
7512
7512
  };
7513
7513
  }
@@ -7517,7 +7517,7 @@ var require_module_details_from_path = __commonJS({
7517
7517
  var require_require_in_the_middle = __commonJS({
7518
7518
  "../../node_modules/.pnpm/require-in-the-middle@8.0.1/node_modules/require-in-the-middle/index.js"(exports, module2) {
7519
7519
  "use strict";
7520
- var path69 = __require("path");
7520
+ var path70 = __require("path");
7521
7521
  var Module = __require("module");
7522
7522
  var debug2 = require_src3()("require-in-the-middle");
7523
7523
  var moduleDetailsFromPath = require_module_details_from_path();
@@ -7662,7 +7662,7 @@ var require_require_in_the_middle = __commonJS({
7662
7662
  }
7663
7663
  moduleName = filename;
7664
7664
  } else if (hasWhitelist === true && modules.includes(filename)) {
7665
- const parsedPath = path69.parse(filename);
7665
+ const parsedPath = path70.parse(filename);
7666
7666
  moduleName = parsedPath.name;
7667
7667
  basedir = parsedPath.dir;
7668
7668
  } else {
@@ -7700,7 +7700,7 @@ var require_require_in_the_middle = __commonJS({
7700
7700
  }
7701
7701
  if (res !== filename) {
7702
7702
  if (internals === true) {
7703
- moduleName = moduleName + path69.sep + path69.relative(basedir, filename);
7703
+ moduleName = moduleName + path70.sep + path70.relative(basedir, filename);
7704
7704
  debug2("preparing to process require of internal file: %s", moduleName);
7705
7705
  } else {
7706
7706
  debug2("ignoring require of non-main module file: %s", res);
@@ -7736,8 +7736,8 @@ var require_require_in_the_middle = __commonJS({
7736
7736
  }
7737
7737
  };
7738
7738
  function resolveModuleName(stat) {
7739
- const normalizedPath = path69.sep !== "/" ? stat.path.split(path69.sep).join("/") : stat.path;
7740
- return path69.posix.join(stat.name, normalizedPath).replace(normalize3, "");
7739
+ const normalizedPath = path70.sep !== "/" ? stat.path.split(path70.sep).join("/") : stat.path;
7740
+ return path70.posix.join(stat.name, normalizedPath).replace(normalize3, "");
7741
7741
  }
7742
7742
  }
7743
7743
  });
@@ -7822,7 +7822,7 @@ var require_RequireInTheMiddleSingleton = __commonJS({
7822
7822
  Object.defineProperty(exports, "__esModule", { value: true });
7823
7823
  exports.RequireInTheMiddleSingleton = void 0;
7824
7824
  var require_in_the_middle_1 = require_require_in_the_middle();
7825
- var path69 = __require("path");
7825
+ var path70 = __require("path");
7826
7826
  var ModuleNameTrie_1 = require_ModuleNameTrie();
7827
7827
  var isMocha = [
7828
7828
  "afterEach",
@@ -7886,7 +7886,7 @@ var require_RequireInTheMiddleSingleton = __commonJS({
7886
7886
  };
7887
7887
  exports.RequireInTheMiddleSingleton = RequireInTheMiddleSingleton;
7888
7888
  function normalizePathSeparators(moduleNameOrPath) {
7889
- return path69.sep !== ModuleNameTrie_1.ModuleNameSeparator ? moduleNameOrPath.split(path69.sep).join(ModuleNameTrie_1.ModuleNameSeparator) : moduleNameOrPath;
7889
+ return path70.sep !== ModuleNameTrie_1.ModuleNameSeparator ? moduleNameOrPath.split(path70.sep).join(ModuleNameTrie_1.ModuleNameSeparator) : moduleNameOrPath;
7890
7890
  }
7891
7891
  }
7892
7892
  });
@@ -8096,7 +8096,7 @@ var require_register = __commonJS({
8096
8096
  // ../../node_modules/.pnpm/import-in-the-middle@3.5.3/node_modules/import-in-the-middle/index.js
8097
8097
  var require_import_in_the_middle = __commonJS({
8098
8098
  "../../node_modules/.pnpm/import-in-the-middle@3.5.3/node_modules/import-in-the-middle/index.js"(exports, module2) {
8099
- var path69 = __require("path");
8099
+ var path70 = __require("path");
8100
8100
  var moduleDetailsFromPath = require_module_details_from_path();
8101
8101
  var { fileURLToPath: fileURLToPath2 } = __require("url");
8102
8102
  var { MessageChannel } = __require("worker_threads");
@@ -8110,7 +8110,7 @@ var require_import_in_the_middle = __commonJS({
8110
8110
  toHook
8111
8111
  } = require_register();
8112
8112
  function isPackageSpecifier(specifier, baseDir) {
8113
- if (process.platform === "win32" && specifier.includes("/")) baseDir = baseDir.replaceAll(path69.sep, "/");
8113
+ if (process.platform === "win32" && specifier.includes("/")) baseDir = baseDir.replaceAll(path70.sep, "/");
8114
8114
  if (baseDir.endsWith(specifier)) return true;
8115
8115
  const usingTurbopack = process.env.TURBOPACK ?? process.argv.includes("--turbo");
8116
8116
  if (!usingTurbopack) return false;
@@ -8217,7 +8217,7 @@ var require_import_in_the_middle = __commonJS({
8217
8217
  } else if (isPackageSpecifier(specifiers.get(loadUrl), baseDir)) {
8218
8218
  callHookFn(hookFn, namespace, name, baseDir);
8219
8219
  } else if (internals) {
8220
- const internalPath = name + path69.sep + path69.relative(baseDir, filePath);
8220
+ const internalPath = name + path70.sep + path70.relative(baseDir, filePath);
8221
8221
  callHookFn(hookFn, namespace, internalPath, baseDir);
8222
8222
  }
8223
8223
  } else if (matchArg === specifier) {
@@ -8292,7 +8292,7 @@ var require_instrumentation2 = __commonJS({
8292
8292
  "use strict";
8293
8293
  Object.defineProperty(exports, "__esModule", { value: true });
8294
8294
  exports.InstrumentationBase = void 0;
8295
- var path69 = __require("path");
8295
+ var path70 = __require("path");
8296
8296
  var util_1 = __require("util");
8297
8297
  var semver_1 = require_semver();
8298
8298
  var shimmer_1 = require_shimmer();
@@ -8393,7 +8393,7 @@ var require_instrumentation2 = __commonJS({
8393
8393
  }
8394
8394
  _extractPackageVersion(baseDir) {
8395
8395
  try {
8396
- const json2 = (0, fs_1.readFileSync)(path69.join(baseDir, "package.json"), {
8396
+ const json2 = (0, fs_1.readFileSync)(path70.join(baseDir, "package.json"), {
8397
8397
  encoding: "utf8"
8398
8398
  });
8399
8399
  const version2 = JSON.parse(json2).version;
@@ -8435,7 +8435,7 @@ var require_instrumentation2 = __commonJS({
8435
8435
  return exports2;
8436
8436
  }
8437
8437
  const files = module3.files ?? [];
8438
- const normalizedName = path69.normalize(name);
8438
+ const normalizedName = path70.normalize(name);
8439
8439
  const supportedFileInstrumentations = files.filter((f) => f.name === normalizedName && isSupported(f.supportedVersions, version2, module3.includePrerelease));
8440
8440
  return supportedFileInstrumentations.reduce((patchedExports, file2) => {
8441
8441
  file2.moduleExports = patchedExports;
@@ -8481,8 +8481,8 @@ var require_instrumentation2 = __commonJS({
8481
8481
  this._warnOnPreloadedModules();
8482
8482
  for (const module3 of this._modules) {
8483
8483
  const hookFn = (exports2, name, baseDir) => {
8484
- if (!baseDir && path69.isAbsolute(name)) {
8485
- const parsedPath = path69.parse(name);
8484
+ if (!baseDir && path70.isAbsolute(name)) {
8485
+ const parsedPath = path70.parse(name);
8486
8486
  name = parsedPath.name;
8487
8487
  baseDir = parsedPath.dir;
8488
8488
  }
@@ -8491,7 +8491,7 @@ var require_instrumentation2 = __commonJS({
8491
8491
  const onRequire = (exports2, name, baseDir) => {
8492
8492
  return this._onRequire(module3, exports2, name, baseDir);
8493
8493
  };
8494
- const hook = path69.isAbsolute(module3.name) ? new require_in_the_middle_1.Hook([module3.name], { internals: true }, onRequire) : this._requireInTheMiddleSingleton.register(module3.name, onRequire);
8494
+ const hook = path70.isAbsolute(module3.name) ? new require_in_the_middle_1.Hook([module3.name], { internals: true }, onRequire) : this._requireInTheMiddleSingleton.register(module3.name, onRequire);
8495
8495
  this._hooks.push(hook);
8496
8496
  const esmHook = new import_in_the_middle_1.Hook([module3.name], { internals: true }, hookFn);
8497
8497
  this._hooks.push(esmHook);
@@ -9196,9 +9196,9 @@ var require_getMachineId_linux = __commonJS({
9196
9196
  var api_1 = (init_esm(), __toCommonJS(esm_exports));
9197
9197
  async function getMachineId() {
9198
9198
  const paths = ["/etc/machine-id", "/var/lib/dbus/machine-id"];
9199
- for (const path69 of paths) {
9199
+ for (const path70 of paths) {
9200
9200
  try {
9201
- const result = await fs_1.promises.readFile(path69, { encoding: "utf8" });
9201
+ const result = await fs_1.promises.readFile(path70, { encoding: "utf8" });
9202
9202
  return result.trim();
9203
9203
  } catch (e) {
9204
9204
  api_1.diag.debug(`error reading machine id: ${e}`);
@@ -12563,14 +12563,14 @@ var require_util = __commonJS({
12563
12563
  }
12564
12564
  const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
12565
12565
  let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`;
12566
- let path69 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
12566
+ let path70 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
12567
12567
  if (origin[origin.length - 1] === "/") {
12568
12568
  origin = origin.slice(0, origin.length - 1);
12569
12569
  }
12570
- if (path69 && path69[0] !== "/") {
12571
- path69 = `/${path69}`;
12570
+ if (path70 && path70[0] !== "/") {
12571
+ path70 = `/${path70}`;
12572
12572
  }
12573
- return new URL(`${origin}${path69}`);
12573
+ return new URL(`${origin}${path70}`);
12574
12574
  }
12575
12575
  if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) {
12576
12576
  throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
@@ -13391,9 +13391,9 @@ var require_diagnostics = __commonJS({
13391
13391
  "undici:client:sendHeaders",
13392
13392
  (evt) => {
13393
13393
  const {
13394
- request: { method, path: path69, origin }
13394
+ request: { method, path: path70, origin }
13395
13395
  } = evt;
13396
- debugLog3("sending request to %s %s%s", method, origin, path69);
13396
+ debugLog3("sending request to %s %s%s", method, origin, path70);
13397
13397
  }
13398
13398
  );
13399
13399
  }
@@ -13411,14 +13411,14 @@ var require_diagnostics = __commonJS({
13411
13411
  "undici:request:headers",
13412
13412
  (evt) => {
13413
13413
  const {
13414
- request: { method, path: path69, origin },
13414
+ request: { method, path: path70, origin },
13415
13415
  response: { statusCode }
13416
13416
  } = evt;
13417
13417
  debugLog3(
13418
13418
  "received response to %s %s%s - HTTP %d",
13419
13419
  method,
13420
13420
  origin,
13421
- path69,
13421
+ path70,
13422
13422
  statusCode
13423
13423
  );
13424
13424
  }
@@ -13427,23 +13427,23 @@ var require_diagnostics = __commonJS({
13427
13427
  "undici:request:trailers",
13428
13428
  (evt) => {
13429
13429
  const {
13430
- request: { method, path: path69, origin }
13430
+ request: { method, path: path70, origin }
13431
13431
  } = evt;
13432
- debugLog3("trailers received from %s %s%s", method, origin, path69);
13432
+ debugLog3("trailers received from %s %s%s", method, origin, path70);
13433
13433
  }
13434
13434
  );
13435
13435
  diagnosticsChannel9.subscribe(
13436
13436
  "undici:request:error",
13437
13437
  (evt) => {
13438
13438
  const {
13439
- request: { method, path: path69, origin },
13439
+ request: { method, path: path70, origin },
13440
13440
  error: error63
13441
13441
  } = evt;
13442
13442
  debugLog3(
13443
13443
  "request to %s %s%s errored - %s",
13444
13444
  method,
13445
13445
  origin,
13446
- path69,
13446
+ path70,
13447
13447
  error63.message
13448
13448
  );
13449
13449
  }
@@ -13558,7 +13558,7 @@ var require_request = __commonJS({
13558
13558
  var kHandler = /* @__PURE__ */ Symbol("handler");
13559
13559
  var Request2 = class {
13560
13560
  constructor(origin, {
13561
- path: path69,
13561
+ path: path70,
13562
13562
  method,
13563
13563
  body,
13564
13564
  headers,
@@ -13575,11 +13575,11 @@ var require_request = __commonJS({
13575
13575
  maxRedirections,
13576
13576
  typeOfService
13577
13577
  }, handler) {
13578
- if (typeof path69 !== "string") {
13578
+ if (typeof path70 !== "string") {
13579
13579
  throw new InvalidArgumentError("path must be a string");
13580
- } else if (path69[0] !== "/" && !(path69.startsWith("http://") || path69.startsWith("https://")) && method !== "CONNECT") {
13580
+ } else if (path70[0] !== "/" && !(path70.startsWith("http://") || path70.startsWith("https://")) && method !== "CONNECT") {
13581
13581
  throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
13582
- } else if (invalidPathRegex.test(path69)) {
13582
+ } else if (invalidPathRegex.test(path70)) {
13583
13583
  throw new InvalidArgumentError("invalid request path");
13584
13584
  }
13585
13585
  if (typeof method !== "string") {
@@ -13654,7 +13654,7 @@ var require_request = __commonJS({
13654
13654
  this.completed = false;
13655
13655
  this.aborted = false;
13656
13656
  this.upgrade = upgrade || null;
13657
- this.path = query ? serializePathWithQuery(path69, query) : path69;
13657
+ this.path = query ? serializePathWithQuery(path70, query) : path70;
13658
13658
  this.origin = origin;
13659
13659
  this.protocol = getProtocolFromUrlString(origin);
13660
13660
  this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
@@ -18879,7 +18879,7 @@ var require_client_h1 = __commonJS({
18879
18879
  return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
18880
18880
  }
18881
18881
  function writeH1(client, request2) {
18882
- const { method, path: path69, host, upgrade, blocking, reset } = request2;
18882
+ const { method, path: path70, host, upgrade, blocking, reset } = request2;
18883
18883
  let { body, headers, contentLength } = request2;
18884
18884
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
18885
18885
  if (util2.isFormDataLike(body)) {
@@ -18957,7 +18957,7 @@ var require_client_h1 = __commonJS({
18957
18957
  if (socket.setTypeOfService) {
18958
18958
  socket.setTypeOfService(request2.typeOfService);
18959
18959
  }
18960
- let header = `${method} ${path69} HTTP/1.1\r
18960
+ let header = `${method} ${path70} HTTP/1.1\r
18961
18961
  `;
18962
18962
  if (typeof host === "string") {
18963
18963
  header += `host: ${host}\r
@@ -19634,7 +19634,7 @@ var require_client_h2 = __commonJS({
19634
19634
  const headersTimeout = request2.headersTimeout ?? client[kHeadersTimeout];
19635
19635
  const bodyTimeout = request2.bodyTimeout ?? client[kBodyTimeout];
19636
19636
  const session = client[kHTTP2Session];
19637
- const { method, path: path69, host, upgrade, expectContinue, signal: signal2, protocol, headers: reqHeaders } = request2;
19637
+ const { method, path: path70, host, upgrade, expectContinue, signal: signal2, protocol, headers: reqHeaders } = request2;
19638
19638
  let { body } = request2;
19639
19639
  if (upgrade != null && upgrade !== "websocket") {
19640
19640
  util2.errorRequest(client, request2, new InvalidArgumentError(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
@@ -19703,7 +19703,7 @@ var require_client_h2 = __commonJS({
19703
19703
  }
19704
19704
  headers[HTTP2_HEADER_METHOD] = "CONNECT";
19705
19705
  headers[HTTP2_HEADER_PROTOCOL] = "websocket";
19706
- headers[HTTP2_HEADER_PATH] = path69;
19706
+ headers[HTTP2_HEADER_PATH] = path70;
19707
19707
  if (protocol === "ws:" || protocol === "wss:") {
19708
19708
  headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
19709
19709
  } else {
@@ -19755,7 +19755,7 @@ var require_client_h2 = __commonJS({
19755
19755
  stream.setTimeout(headersTimeout);
19756
19756
  return true;
19757
19757
  }
19758
- headers[HTTP2_HEADER_PATH] = path69;
19758
+ headers[HTTP2_HEADER_PATH] = path70;
19759
19759
  headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
19760
19760
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
19761
19761
  if (body && typeof body.read === "function") {
@@ -22111,10 +22111,10 @@ var require_proxy_agent = __commonJS({
22111
22111
  };
22112
22112
  const {
22113
22113
  origin,
22114
- path: path69 = "/",
22114
+ path: path70 = "/",
22115
22115
  headers = {}
22116
22116
  } = opts;
22117
- opts.path = origin + path69;
22117
+ opts.path = origin + path70;
22118
22118
  if (!("host" in headers) && !("Host" in headers)) {
22119
22119
  const { host } = new URL(origin);
22120
22120
  headers.host = host;
@@ -24274,20 +24274,20 @@ var require_mock_utils = __commonJS({
24274
24274
  }
24275
24275
  return normalizedQp;
24276
24276
  }
24277
- function safeUrl(path69) {
24278
- if (typeof path69 !== "string") {
24279
- return path69;
24277
+ function safeUrl(path70) {
24278
+ if (typeof path70 !== "string") {
24279
+ return path70;
24280
24280
  }
24281
- const pathSegments = path69.split("?", 3);
24281
+ const pathSegments = path70.split("?", 3);
24282
24282
  if (pathSegments.length !== 2) {
24283
- return path69;
24283
+ return path70;
24284
24284
  }
24285
24285
  const qp = new URLSearchParams(pathSegments.pop());
24286
24286
  qp.sort();
24287
24287
  return [...pathSegments, qp.toString()].join("?");
24288
24288
  }
24289
- function matchKey(mockDispatch2, { path: path69, method, body, headers }) {
24290
- const pathMatch = matchValue(mockDispatch2.path, path69);
24289
+ function matchKey(mockDispatch2, { path: path70, method, body, headers }) {
24290
+ const pathMatch = matchValue(mockDispatch2.path, path70);
24291
24291
  const methodMatch = matchValue(mockDispatch2.method, method);
24292
24292
  const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
24293
24293
  const headersMatch = matchHeaders(mockDispatch2, headers);
@@ -24312,8 +24312,8 @@ var require_mock_utils = __commonJS({
24312
24312
  const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
24313
24313
  const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
24314
24314
  const resolvedPathWithoutTrailingSlash = removeTrailingSlash2(resolvedPath);
24315
- let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path69, ignoreTrailingSlash }) => {
24316
- return ignoreTrailingSlash ? matchValue(removeTrailingSlash2(safeUrl(path69)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path69), resolvedPath);
24315
+ let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path70, ignoreTrailingSlash }) => {
24316
+ return ignoreTrailingSlash ? matchValue(removeTrailingSlash2(safeUrl(path70)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path70), resolvedPath);
24317
24317
  });
24318
24318
  if (matchedMockDispatches.length === 0) {
24319
24319
  throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
@@ -24352,19 +24352,19 @@ var require_mock_utils = __commonJS({
24352
24352
  mockDispatches.splice(index, 1);
24353
24353
  }
24354
24354
  }
24355
- function removeTrailingSlash2(path69) {
24356
- while (path69.endsWith("/")) {
24357
- path69 = path69.slice(0, -1);
24355
+ function removeTrailingSlash2(path70) {
24356
+ while (path70.endsWith("/")) {
24357
+ path70 = path70.slice(0, -1);
24358
24358
  }
24359
- if (path69.length === 0) {
24360
- path69 = "/";
24359
+ if (path70.length === 0) {
24360
+ path70 = "/";
24361
24361
  }
24362
- return path69;
24362
+ return path70;
24363
24363
  }
24364
24364
  function buildKey(opts) {
24365
- const { path: path69, method, body, headers, query } = opts;
24365
+ const { path: path70, method, body, headers, query } = opts;
24366
24366
  return {
24367
- path: path69,
24367
+ path: path70,
24368
24368
  method,
24369
24369
  body,
24370
24370
  headers,
@@ -25054,10 +25054,10 @@ var require_pending_interceptors_formatter = __commonJS({
25054
25054
  }
25055
25055
  format(pendingInterceptors) {
25056
25056
  const withPrettyHeaders = pendingInterceptors.map(
25057
- ({ method, path: path69, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
25057
+ ({ method, path: path70, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
25058
25058
  Method: method,
25059
25059
  Origin: origin,
25060
- Path: path69,
25060
+ Path: path70,
25061
25061
  "Status code": statusCode,
25062
25062
  Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
25063
25063
  Invocations: timesInvoked,
@@ -25139,9 +25139,9 @@ var require_mock_agent = __commonJS({
25139
25139
  const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
25140
25140
  const dispatchOpts = { ...opts };
25141
25141
  if (acceptNonStandardSearchParameters && dispatchOpts.path) {
25142
- const [path69, searchParams] = dispatchOpts.path.split("?");
25142
+ const [path70, searchParams] = dispatchOpts.path.split("?");
25143
25143
  const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
25144
- dispatchOpts.path = `${path69}?${normalizedSearchParams}`;
25144
+ dispatchOpts.path = `${path70}?${normalizedSearchParams}`;
25145
25145
  }
25146
25146
  return this[kAgent].dispatch(dispatchOpts, handler);
25147
25147
  }
@@ -25542,12 +25542,12 @@ var require_snapshot_recorder = __commonJS({
25542
25542
  * @return {Promise<void>} - Resolves when snapshots are loaded
25543
25543
  */
25544
25544
  async loadSnapshots(filePath) {
25545
- const path69 = filePath || this.#snapshotPath;
25546
- if (!path69) {
25545
+ const path70 = filePath || this.#snapshotPath;
25546
+ if (!path70) {
25547
25547
  throw new InvalidArgumentError("Snapshot path is required");
25548
25548
  }
25549
25549
  try {
25550
- const data = await readFile3(resolve2(path69), "utf8");
25550
+ const data = await readFile3(resolve2(path70), "utf8");
25551
25551
  const parsed = JSON.parse(data);
25552
25552
  if (Array.isArray(parsed)) {
25553
25553
  this.#snapshots.clear();
@@ -25561,7 +25561,7 @@ var require_snapshot_recorder = __commonJS({
25561
25561
  if (error63.code === "ENOENT") {
25562
25562
  this.#snapshots.clear();
25563
25563
  } else {
25564
- throw new UndiciError(`Failed to load snapshots from ${path69}`, { cause: error63 });
25564
+ throw new UndiciError(`Failed to load snapshots from ${path70}`, { cause: error63 });
25565
25565
  }
25566
25566
  }
25567
25567
  }
@@ -25572,11 +25572,11 @@ var require_snapshot_recorder = __commonJS({
25572
25572
  * @returns {Promise<void>} - Resolves when snapshots are saved
25573
25573
  */
25574
25574
  async saveSnapshots(filePath) {
25575
- const path69 = filePath || this.#snapshotPath;
25576
- if (!path69) {
25575
+ const path70 = filePath || this.#snapshotPath;
25576
+ if (!path70) {
25577
25577
  throw new InvalidArgumentError("Snapshot path is required");
25578
25578
  }
25579
- const resolvedPath = resolve2(path69);
25579
+ const resolvedPath = resolve2(path70);
25580
25580
  await mkdir(dirname2(resolvedPath), { recursive: true });
25581
25581
  const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
25582
25582
  hash: hash2,
@@ -26213,15 +26213,15 @@ var require_redirect_handler = __commonJS({
26213
26213
  }
26214
26214
  this.history[kRedirectCacheControl].push(headers["cache-control"]);
26215
26215
  const { origin, pathname, search } = util2.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
26216
- const path69 = search ? `${pathname}${search}` : pathname;
26217
- const redirectUrlString = `${origin}${path69}`;
26216
+ const path70 = search ? `${pathname}${search}` : pathname;
26217
+ const redirectUrlString = `${origin}${path70}`;
26218
26218
  for (const historyUrl of this.history) {
26219
26219
  if (historyUrl.toString() === redirectUrlString) {
26220
26220
  throw new InvalidArgumentError(`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.`);
26221
26221
  }
26222
26222
  }
26223
26223
  this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
26224
- this.opts.path = path69;
26224
+ this.opts.path = path70;
26225
26225
  this.opts.origin = origin;
26226
26226
  this.opts.query = null;
26227
26227
  }
@@ -27989,10 +27989,10 @@ var require_cache_handler = __commonJS({
27989
27989
  }
27990
27990
  return locationUrl.pathname + locationUrl.search;
27991
27991
  }
27992
- function deleteCachedUri(store, cacheKey, path69) {
27992
+ function deleteCachedUri(store, cacheKey, path70) {
27993
27993
  deleteCachedValue(store, {
27994
27994
  ...cacheKey,
27995
- path: path69
27995
+ path: path70
27996
27996
  });
27997
27997
  for (let i = 0; i < util2.safeHTTPMethods.length; i++) {
27998
27998
  const method = util2.safeHTTPMethods[i];
@@ -28000,7 +28000,7 @@ var require_cache_handler = __commonJS({
28000
28000
  deleteCachedValue(store, {
28001
28001
  ...cacheKey,
28002
28002
  method,
28003
- path: path69
28003
+ path: path70
28004
28004
  });
28005
28005
  }
28006
28006
  }
@@ -28011,9 +28011,9 @@ var require_cache_handler = __commonJS({
28011
28011
  }
28012
28012
  const values = Array.isArray(headerValue) ? headerValue : [headerValue];
28013
28013
  for (let i = 0; i < values.length; i++) {
28014
- const path69 = getSameOriginPath(cacheKey, values[i]);
28015
- if (path69 !== void 0) {
28016
- deleteCachedUri(store, cacheKey, path69);
28014
+ const path70 = getSameOriginPath(cacheKey, values[i]);
28015
+ if (path70 !== void 0) {
28016
+ deleteCachedUri(store, cacheKey, path70);
28017
28017
  }
28018
28018
  }
28019
28019
  }
@@ -33224,11 +33224,11 @@ var require_fetch = __commonJS({
33224
33224
  function dispatch({ body }) {
33225
33225
  const url2 = requestCurrentURL(request2);
33226
33226
  const agent = fetchParams.controller.dispatcher;
33227
- const path69 = url2.pathname + url2.search;
33227
+ const path70 = url2.pathname + url2.search;
33228
33228
  const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?";
33229
33229
  return new Promise((resolve2, reject) => agent.dispatch(
33230
33230
  {
33231
- path: hasTrailingQuestionMark ? `${path69}?` : path69,
33231
+ path: hasTrailingQuestionMark ? `${path70}?` : path70,
33232
33232
  origin: url2.origin,
33233
33233
  method: request2.method,
33234
33234
  body: agent.isMockActive ? request2.body && (request2.body.source || request2.body.stream) : body,
@@ -34175,9 +34175,9 @@ var require_util4 = __commonJS({
34175
34175
  }
34176
34176
  }
34177
34177
  }
34178
- function validateCookiePath(path69) {
34179
- for (let i = 0; i < path69.length; ++i) {
34180
- const code = path69.charCodeAt(i);
34178
+ function validateCookiePath(path70) {
34179
+ for (let i = 0; i < path70.length; ++i) {
34180
+ const code = path70.charCodeAt(i);
34181
34181
  if (code < 32 || // exclude CTLs (0-31)
34182
34182
  code > 126 || // exclude DEL and non-ascii
34183
34183
  code === 59) {
@@ -37613,11 +37613,11 @@ var require_undici = __commonJS({
37613
37613
  if (typeof opts.path !== "string") {
37614
37614
  throw new InvalidArgumentError("invalid opts.path");
37615
37615
  }
37616
- let path69 = opts.path;
37616
+ let path70 = opts.path;
37617
37617
  if (!opts.path.startsWith("/")) {
37618
- path69 = `/${path69}`;
37618
+ path70 = `/${path70}`;
37619
37619
  }
37620
- url2 = new URL(util2.parseOrigin(url2).origin + path69);
37620
+ url2 = new URL(util2.parseOrigin(url2).origin + path70);
37621
37621
  } else {
37622
37622
  if (!opts) {
37623
37623
  opts = typeof url2 === "object" ? url2 : {};
@@ -38585,10 +38585,10 @@ function mergeDefs(...defs) {
38585
38585
  function cloneDef(schema) {
38586
38586
  return mergeDefs(schema._zod.def);
38587
38587
  }
38588
- function getElementAtPath(obj, path69) {
38589
- if (!path69)
38588
+ function getElementAtPath(obj, path70) {
38589
+ if (!path70)
38590
38590
  return obj;
38591
- return path69.reduce((acc, key) => acc?.[key], obj);
38591
+ return path70.reduce((acc, key) => acc?.[key], obj);
38592
38592
  }
38593
38593
  function promiseAllObject(promisesObj) {
38594
38594
  const keys = Object.keys(promisesObj);
@@ -38928,11 +38928,11 @@ function explicitlyAborted(x, startIndex = 0) {
38928
38928
  }
38929
38929
  return false;
38930
38930
  }
38931
- function prefixIssues(path69, issues) {
38931
+ function prefixIssues(path70, issues) {
38932
38932
  return issues.map((iss) => {
38933
38933
  var _a4;
38934
38934
  (_a4 = iss).path ?? (_a4.path = []);
38935
- iss.path.unshift(path69);
38935
+ iss.path.unshift(path70);
38936
38936
  return iss;
38937
38937
  });
38938
38938
  }
@@ -39394,16 +39394,16 @@ function flattenError(error63, mapper = (issue2) => issue2.message) {
39394
39394
  }
39395
39395
  function formatError(error63, mapper = (issue2) => issue2.message) {
39396
39396
  const fieldErrors = { _errors: [] };
39397
- const processError = (error64, path69 = []) => {
39397
+ const processError = (error64, path70 = []) => {
39398
39398
  for (const issue2 of error64.issues) {
39399
39399
  if (issue2.code === "invalid_union" && issue2.errors.length) {
39400
- issue2.errors.map((issues) => processError({ issues }, [...path69, ...issue2.path]));
39400
+ issue2.errors.map((issues) => processError({ issues }, [...path70, ...issue2.path]));
39401
39401
  } else if (issue2.code === "invalid_key") {
39402
- processError({ issues: issue2.issues }, [...path69, ...issue2.path]);
39402
+ processError({ issues: issue2.issues }, [...path70, ...issue2.path]);
39403
39403
  } else if (issue2.code === "invalid_element") {
39404
- processError({ issues: issue2.issues }, [...path69, ...issue2.path]);
39404
+ processError({ issues: issue2.issues }, [...path70, ...issue2.path]);
39405
39405
  } else {
39406
- const fullpath = [...path69, ...issue2.path];
39406
+ const fullpath = [...path70, ...issue2.path];
39407
39407
  if (fullpath.length === 0) {
39408
39408
  fieldErrors._errors.push(mapper(issue2));
39409
39409
  } else {
@@ -39442,17 +39442,17 @@ function formatError(error63, mapper = (issue2) => issue2.message) {
39442
39442
  }
39443
39443
  function treeifyError(error63, mapper = (issue2) => issue2.message) {
39444
39444
  const result = { errors: [] };
39445
- const processError = (error64, path69 = []) => {
39445
+ const processError = (error64, path70 = []) => {
39446
39446
  var _a4;
39447
39447
  for (const issue2 of error64.issues) {
39448
39448
  if (issue2.code === "invalid_union" && issue2.errors.length) {
39449
- issue2.errors.map((issues) => processError({ issues }, [...path69, ...issue2.path]));
39449
+ issue2.errors.map((issues) => processError({ issues }, [...path70, ...issue2.path]));
39450
39450
  } else if (issue2.code === "invalid_key") {
39451
- processError({ issues: issue2.issues }, [...path69, ...issue2.path]);
39451
+ processError({ issues: issue2.issues }, [...path70, ...issue2.path]);
39452
39452
  } else if (issue2.code === "invalid_element") {
39453
- processError({ issues: issue2.issues }, [...path69, ...issue2.path]);
39453
+ processError({ issues: issue2.issues }, [...path70, ...issue2.path]);
39454
39454
  } else {
39455
- const fullpath = [...path69, ...issue2.path];
39455
+ const fullpath = [...path70, ...issue2.path];
39456
39456
  if (fullpath.length === 0) {
39457
39457
  result.errors.push(mapper(issue2));
39458
39458
  continue;
@@ -39491,8 +39491,8 @@ function treeifyError(error63, mapper = (issue2) => issue2.message) {
39491
39491
  }
39492
39492
  function toDotPath(_path) {
39493
39493
  const segs = [];
39494
- const path69 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
39495
- for (const seg of path69) {
39494
+ const path70 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
39495
+ for (const seg of path70) {
39496
39496
  if (typeof seg === "number")
39497
39497
  segs.push(`[${seg}]`);
39498
39498
  else if (typeof seg === "symbol")
@@ -56630,13 +56630,13 @@ function resolveRef(ref, ctx) {
56630
56630
  if (!ref.startsWith("#")) {
56631
56631
  throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
56632
56632
  }
56633
- const path69 = ref.slice(1).split("/").filter(Boolean);
56634
- if (path69.length === 0) {
56633
+ const path70 = ref.slice(1).split("/").filter(Boolean);
56634
+ if (path70.length === 0) {
56635
56635
  return ctx.rootSchema;
56636
56636
  }
56637
56637
  const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
56638
- if (path69[0] === defsKey) {
56639
- const key = path69[1] === void 0 ? void 0 : decodeJSONPointerSegment(path69[1]);
56638
+ if (path70[0] === defsKey) {
56639
+ const key = path70[1] === void 0 ? void 0 : decodeJSONPointerSegment(path70[1]);
56640
56640
  if (!key || !ctx.defs[key]) {
56641
56641
  throw new Error(`Reference not found: ${ref}`);
56642
56642
  }
@@ -57503,20 +57503,20 @@ function githubRepositoryOfRemote(url2) {
57503
57503
  const afterUser = url2.replace(REMOTE_SCHEME, "").replace(REMOTE_USER, "");
57504
57504
  const host = afterUser.startsWith("ssh.") ? afterUser.slice("ssh.".length) : afterUser;
57505
57505
  if (!host.startsWith("github.com")) return null;
57506
- let path69 = host.slice("github.com".length);
57507
- const port = hasScheme ? REMOTE_PORT.exec(path69) : null;
57508
- if (port !== null) path69 = path69.slice(port[0].length);
57509
- else if (path69.startsWith("/") || path69.startsWith(":")) path69 = path69.slice(1);
57506
+ let path70 = host.slice("github.com".length);
57507
+ const port = hasScheme ? REMOTE_PORT.exec(path70) : null;
57508
+ if (port !== null) path70 = path70.slice(port[0].length);
57509
+ else if (path70.startsWith("/") || path70.startsWith(":")) path70 = path70.slice(1);
57510
57510
  else return null;
57511
- return githubRepositoryOfRemotePath(path69);
57511
+ return githubRepositoryOfRemotePath(path70);
57512
57512
  }
57513
57513
  function githubRepositoryOfRemotePath(remotePath) {
57514
- let path69 = remotePath.startsWith("/") ? remotePath.slice(1) : remotePath;
57515
- if (path69.endsWith("/")) path69 = path69.slice(0, -1);
57516
- if (path69.endsWith(".git")) path69 = path69.slice(0, -".git".length);
57517
- const segments = path69.split("/");
57514
+ let path70 = remotePath.startsWith("/") ? remotePath.slice(1) : remotePath;
57515
+ if (path70.endsWith("/")) path70 = path70.slice(0, -1);
57516
+ if (path70.endsWith(".git")) path70 = path70.slice(0, -".git".length);
57517
+ const segments = path70.split("/");
57518
57518
  if (segments.length !== 2 || !segments.every((segment) => REMOTE_PATH_SEGMENT.test(segment))) return null;
57519
- return path69;
57519
+ return path70;
57520
57520
  }
57521
57521
 
57522
57522
  // ../core/src/repositories.ts
@@ -58504,7 +58504,7 @@ var isInstructionLoadAttachment = (kind) => kind === INSTRUCTIONS_ATTACHMENT ||
58504
58504
  var field = external_exports.unknown().optional();
58505
58505
  var instructionFileSchema = external_exports.object({ path: field, type: field });
58506
58506
  var attachmentSchema = external_exports.object({ files: field, content: field });
58507
- var instructionFilesSchema = (path69, label2) => external_exports.array(external_exports.object({ path: path69, nativeScope: label2.nullable() })).max(INSTRUCTION_FILES_MAX).nullable();
58507
+ var instructionFilesSchema = (path70, label2) => external_exports.array(external_exports.object({ path: path70, nativeScope: label2.nullable() })).max(INSTRUCTION_FILES_MAX).nullable();
58508
58508
  function claudeCodeInstructionLoad(kind, record2, place, readers) {
58509
58509
  const { location } = place;
58510
58510
  const attachmentSource = { ...location, jsonPointer: "/attachment" };
@@ -58518,9 +58518,9 @@ function claudeCodeInstructionLoad(kind, record2, place, readers) {
58518
58518
  entries.slice(0, INSTRUCTION_FILES_MAX).forEach((value, index) => {
58519
58519
  const fileSource = { ...location, jsonPointer: kind === INSTRUCTIONS_ATTACHMENT ? `/attachment/files/${index}` : "/attachment/content" };
58520
58520
  const file2 = readers.read(instructionFileSchema, value, "attachment.file", fileSource, true);
58521
- const path69 = file2 === null ? null : readers.readString(file2.path, "attachment.file.path", fileSource, true);
58522
- if (file2 === null || path69 === null) return;
58523
- files.push({ path: path69, nativeScope: readers.readString(file2.type, "attachment.file.type", fileSource) });
58521
+ const path70 = file2 === null ? null : readers.readString(file2.path, "attachment.file.path", fileSource, true);
58522
+ if (file2 === null || path70 === null) return;
58523
+ files.push({ path: path70, nativeScope: readers.readString(file2.type, "attachment.file.type", fileSource) });
58524
58524
  });
58525
58525
  if (entries.length > 0 && files.length === 0) return null;
58526
58526
  return {
@@ -59501,10 +59501,10 @@ function boundUnfamiliarPayload(record2) {
59501
59501
  }
59502
59502
  function excludeImageCarriers(record2) {
59503
59503
  const excludedKeys = [];
59504
- const withoutImages = (value, path69) => {
59504
+ const withoutImages = (value, path70) => {
59505
59505
  if (Array.isArray(value)) {
59506
59506
  return value.map((item, index) => {
59507
- const itemPath = `${path69}[${index}]`;
59507
+ const itemPath = `${path70}[${index}]`;
59508
59508
  if (typeof item === "string" && isImageCarrier(item)) {
59509
59509
  excludedKeys.push(itemPath);
59510
59510
  return null;
@@ -59515,7 +59515,7 @@ function excludeImageCarriers(record2) {
59515
59515
  if (!isRecord2(value)) return value;
59516
59516
  const kept = [];
59517
59517
  for (const [key, item] of Object.entries(value)) {
59518
- const keyPath = path69 === "" ? key : `${path69}.${key}`;
59518
+ const keyPath = path70 === "" ? key : `${path70}.${key}`;
59519
59519
  if (isImageBase64Payload(value, key) || typeof item === "string" && isImageCarrier(item)) {
59520
59520
  excludedKeys.push(keyPath);
59521
59521
  continue;
@@ -60743,7 +60743,7 @@ function jsonString(literal2) {
60743
60743
  // ../core/src/shellFileOperations.ts
60744
60744
  var SHELL_PROGRAM = /(?:^|\/)(?:ba|z|da|k)?sh$/;
60745
60745
  var SCRIPT_FLAG = /^-[a-mo-z]*c[a-mo-z]*$/;
60746
- var operation = (operation2) => (path69) => ({ operation: operation2, path: path69 });
60746
+ var operation = (operation2) => (path70) => ({ operation: operation2, path: path70 });
60747
60747
  var read = operation("read");
60748
60748
  var edit = operation("edit");
60749
60749
  var write = operation("write");
@@ -61145,15 +61145,15 @@ function scrubUserInfo(value) {
61145
61145
  function scrubOutgoingUrl(url2) {
61146
61146
  const parts = URL_PARTS.exec(url2);
61147
61147
  if (!parts) return REDACTED3;
61148
- const [, scheme = "", authority2 = "", path69 = ""] = parts;
61148
+ const [, scheme = "", authority2 = "", path70 = ""] = parts;
61149
61149
  const host = authority2.slice(authority2.lastIndexOf("@") + 1);
61150
61150
  const origin = `${scheme}${host}`;
61151
- if (PATH_KEPT_HOSTS.test(host.replace(/:\d*$/, ""))) return `${origin}${path69}`;
61152
- const route = OUTGOING_ROUTES.find((template) => fitsRoute(path69, template));
61151
+ if (PATH_KEPT_HOSTS.test(host.replace(/:\d*$/, ""))) return `${origin}${path70}`;
61152
+ const route = OUTGOING_ROUTES.find((template) => fitsRoute(path70, template));
61153
61153
  return `${origin}${route ?? ""}`;
61154
61154
  }
61155
- function fitsRoute(path69, template) {
61156
- const segments = path69.replace(/(.)\/$/, "$1").split("/");
61155
+ function fitsRoute(path70, template) {
61156
+ const segments = path70.replace(/(.)\/$/, "$1").split("/");
61157
61157
  const route = template.split("/");
61158
61158
  const hasRest = route.at(-1) === "{path}";
61159
61159
  const fixed = hasRest ? route.slice(0, -1) : route;
@@ -61367,8 +61367,16 @@ function latest(a, b2) {
61367
61367
  }
61368
61368
 
61369
61369
  // ../core/src/onboarding.ts
61370
+ var SYNC_WINDOW_MS = 7 * 24 * 60 * 60 * 1e3;
61370
61371
  var SAME_HOUR_MS = 60 * 60 * 1e3;
61371
61372
  function describeSyncSignals(member, now, noUpload = "no sessions uploaded yet") {
61373
+ return syncSignalsLine(
61374
+ member,
61375
+ now,
61376
+ (age) => age === null ? noUpload : `last uploaded session ${age}`
61377
+ );
61378
+ }
61379
+ function syncSignalsLine(member, now, sessionClause) {
61372
61380
  const session = member.lastSessionActivityAt;
61373
61381
  const poll = member.lastCheckedInAt;
61374
61382
  const error63 = member.lastSyncErrorAt;
@@ -61376,7 +61384,7 @@ function describeSyncSignals(member, now, noUpload = "no sessions uploaded yet")
61376
61384
  if (session === null && poll === null && error63 === null) return null;
61377
61385
  const age = (at) => describeDataAge(new Date(at), now);
61378
61386
  const apart = (a, b2) => b2 === null || Math.abs(Date.parse(a) - Date.parse(b2)) > SAME_HOUR_MS;
61379
- const parts = [session === null ? noUpload : `last uploaded session ${age(session)}`];
61387
+ const parts = [sessionClause(session === null ? null : age(session))];
61380
61388
  if (error63 !== null) parts.push(`reported sync error ${age(error63)}`);
61381
61389
  if (paused) parts.push("syncing paused");
61382
61390
  const pollSays = error63 !== null ? apart(poll ?? error63, error63) : paused || apart(poll ?? "", session);
@@ -61520,6 +61528,15 @@ var recentSessionCursorSchema = external_exports.object({
61520
61528
  id: external_exports.uuid()
61521
61529
  });
61522
61530
 
61531
+ // ../core/src/sessionVisibility.ts
61532
+ var VISIBILITY_LEVELS = ["metadata", "full"];
61533
+
61534
+ // ../core/src/sessionVisibilitySetting.ts
61535
+ var sessionVisibilitySettingSchema = external_exports.enum(VISIBILITY_LEVELS);
61536
+ function describeOwnSessionVisibility(setting) {
61537
+ return setting === "full" ? "Your new sessions share in full with teammates who can read the repo." : "Your new sessions share as metadata.";
61538
+ }
61539
+
61523
61540
  // ../../node_modules/.pnpm/@sentry+core@10.78.0/node_modules/@sentry/core/build/esm/debug-build.js
61524
61541
  var DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
61525
61542
 
@@ -61700,8 +61717,8 @@ function getFunctionName(fn) {
61700
61717
  return defaultFunctionName;
61701
61718
  }
61702
61719
  }
61703
- function normalizeStackTracePath(path69) {
61704
- let filename = path69?.startsWith("file://") ? path69.slice(7) : path69;
61720
+ function normalizeStackTracePath(path70) {
61721
+ let filename = path70?.startsWith("file://") ? path70.slice(7) : path70;
61705
61722
  if (filename?.match(/\/[A-Z]:/)) {
61706
61723
  filename = filename.slice(1);
61707
61724
  }
@@ -63510,8 +63527,8 @@ function isValidProtocol(protocol) {
63510
63527
  return protocol === "http" || protocol === "https";
63511
63528
  }
63512
63529
  function dsnToString(dsn, withPassword = false) {
63513
- const { host, path: path69, pass, port, projectId, protocol, publicKey } = dsn;
63514
- return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ""}@${host}${port ? `:${port}` : ""}/${path69 ? `${path69}/` : path69}${projectId}`;
63530
+ const { host, path: path70, pass, port, projectId, protocol, publicKey } = dsn;
63531
+ return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ""}@${host}${port ? `:${port}` : ""}/${path70 ? `${path70}/` : path70}${projectId}`;
63515
63532
  }
63516
63533
  function dsnFromString(str) {
63517
63534
  const match = DSN_REGEX.exec(str);
@@ -63522,11 +63539,11 @@ function dsnFromString(str) {
63522
63539
  return void 0;
63523
63540
  }
63524
63541
  const [protocol, publicKey, pass = "", host = "", port = "", lastPath = ""] = match.slice(1);
63525
- let path69 = "";
63542
+ let path70 = "";
63526
63543
  let projectId = lastPath;
63527
63544
  const split = projectId.split("/");
63528
63545
  if (split.length > 1) {
63529
- path69 = split.slice(0, -1).join("/");
63546
+ path70 = split.slice(0, -1).join("/");
63530
63547
  projectId = split.pop();
63531
63548
  }
63532
63549
  if (projectId) {
@@ -63535,7 +63552,7 @@ function dsnFromString(str) {
63535
63552
  projectId = projectMatch[0];
63536
63553
  }
63537
63554
  }
63538
- return dsnFromComponents({ host, pass, path: path69, projectId, port, protocol, publicKey });
63555
+ return dsnFromComponents({ host, pass, path: path70, projectId, port, protocol, publicKey });
63539
63556
  }
63540
63557
  function dsnFromComponents(components) {
63541
63558
  return {
@@ -68138,9 +68155,9 @@ function stripUrlQueryAndFragment(urlPath) {
68138
68155
  return urlPath.split(/[?#]/, 1)[0];
68139
68156
  }
68140
68157
  function getSanitizedUrlString(url2) {
68141
- const { protocol, host, path: path69 } = url2;
68158
+ const { protocol, host, path: path70 } = url2;
68142
68159
  const filteredHost = host?.replace(/^.*@/, "[filtered]:[filtered]@").replace(/(:80)$/, "").replace(/(:443)$/, "") || "";
68143
- return `${protocol ? `${protocol}://` : ""}${filteredHost}${path69}`;
68160
+ return `${protocol ? `${protocol}://` : ""}${filteredHost}${path70}`;
68144
68161
  }
68145
68162
  function stripDataUrlContent(url2, includeDataPrefix = true) {
68146
68163
  if (url2.startsWith("data:")) {
@@ -69126,8 +69143,8 @@ function splitPath(filename) {
69126
69143
  const parts = splitPathRe.exec(truncated);
69127
69144
  return parts ? parts.slice(1) : [];
69128
69145
  }
69129
- function dirname(path69) {
69130
- const result = splitPath(path69);
69146
+ function dirname(path70) {
69147
+ const result = splitPath(path70);
69131
69148
  const root = result[0] || "";
69132
69149
  let dir = result[1];
69133
69150
  if (!root && !dir) {
@@ -73028,15 +73045,15 @@ var getLayerMetadata = (route, layer, layerPath) => {
73028
73045
  };
73029
73046
  }
73030
73047
  };
73031
- var getRouterPath = (path69, layer) => {
73048
+ var getRouterPath = (path70, layer) => {
73032
73049
  const stackLayer = Array.isArray(layer.handle?.stack) ? layer.handle?.stack?.[0] : void 0;
73033
73050
  if (stackLayer?.route?.path) {
73034
- return `${path69}${stackLayer.route.path}`;
73051
+ return `${path70}${stackLayer.route.path}`;
73035
73052
  }
73036
73053
  if (stackLayer && Array.isArray(stackLayer?.handle?.stack)) {
73037
- return getRouterPath(path69, stackLayer);
73054
+ return getRouterPath(path70, stackLayer);
73038
73055
  }
73039
- return path69;
73056
+ return path70;
73040
73057
  };
73041
73058
  var isLayerIgnored = (name, type, config2) => {
73042
73059
  if (Array.isArray(config2?.ignoreLayersType) && config2?.ignoreLayersType?.includes(type)) {
@@ -73056,7 +73073,7 @@ function getActualMatchedRoute(req, constructedRoute) {
73056
73073
  if (layersStore.length === 0) {
73057
73074
  return void 0;
73058
73075
  }
73059
- if (layersStore.every((path69) => path69 === "/")) {
73076
+ if (layersStore.every((path70) => path70 === "/")) {
73060
73077
  return req.originalUrl === "/" ? "/" : void 0;
73061
73078
  }
73062
73079
  if (constructedRoute === "*") {
@@ -73072,11 +73089,11 @@ function getActualMatchedRoute(req, constructedRoute) {
73072
73089
  function getConstructedRoute(req) {
73073
73090
  const layersStore = getStoredLayers(req);
73074
73091
  let constructedRoute = "";
73075
- for (const path69 of layersStore) {
73076
- if (path69 === "/" || path69 === "/*") {
73092
+ for (const path70 of layersStore) {
73093
+ if (path70 === "/" || path70 === "/*") {
73077
73094
  continue;
73078
73095
  }
73079
- constructedRoute += !constructedRoute || constructedRoute.endsWith("/") ? path69 : `/${path69}`;
73096
+ constructedRoute += !constructedRoute || constructedRoute.endsWith("/") ? path70 : `/${path70}`;
73080
73097
  }
73081
73098
  return constructedRoute.replace(/\/{2,}/g, "/");
73082
73099
  }
@@ -73595,9 +73612,9 @@ function getRequestUrlObject(requestOptions) {
73595
73612
  const hostHeader = requestOptions.headers?.host && String(requestOptions.headers?.host);
73596
73613
  const hostname4 = hostHeader || requestOptions.hostname || requestOptions.host || "";
73597
73614
  const port = !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 || /^(.*):(\d+)$/.test(hostname4) ? "" : `:${requestOptions.port}`;
73598
- const path69 = requestOptions.path ? requestOptions.path : "/";
73615
+ const path70 = requestOptions.path ? requestOptions.path : "/";
73599
73616
  const base = `${protocol}//${hostname4}${port}`;
73600
- return new URL(path69.startsWith("//") ? `${base}${path69}` : path69, base);
73617
+ return new URL(path70.startsWith("//") ? `${base}${path70}` : path70, base);
73601
73618
  }
73602
73619
  function getRequestUrlFromClientRequest(request2) {
73603
73620
  return String(getRequestUrl(getRequestOptions(request2)));
@@ -74285,11 +74302,11 @@ function shouldIgnoreSpansForIncomingRequest(request2, {
74285
74302
  return false;
74286
74303
  }
74287
74304
  function isStaticAssetRequest(urlPath) {
74288
- const path69 = stripUrlQueryAndFragment(urlPath);
74289
- if (path69.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)) {
74305
+ const path70 = stripUrlQueryAndFragment(urlPath);
74306
+ if (path70.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)) {
74290
74307
  return true;
74291
74308
  }
74292
- if (path69.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/)) {
74309
+ if (path70.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/)) {
74293
74310
  return true;
74294
74311
  }
74295
74312
  return false;
@@ -74533,11 +74550,11 @@ function isKnownPrefetchRequest2(req) {
74533
74550
  return req.headers["next-router-prefetch"] === "1";
74534
74551
  }
74535
74552
  function isStaticAssetRequest2(urlPath) {
74536
- const path69 = stripUrlQueryAndFragment(urlPath);
74537
- if (path69.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)) {
74553
+ const path70 = stripUrlQueryAndFragment(urlPath);
74554
+ if (path70.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)) {
74538
74555
  return true;
74539
74556
  }
74540
- if (path69.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/)) {
74557
+ if (path70.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/)) {
74541
74558
  return true;
74542
74559
  }
74543
74560
  return false;
@@ -74897,19 +74914,19 @@ function getBreadcrumbData(request2) {
74897
74914
  return {};
74898
74915
  }
74899
74916
  }
74900
- function getAbsoluteUrl2(origin, path69 = "/") {
74917
+ function getAbsoluteUrl2(origin, path70 = "/") {
74901
74918
  try {
74902
- const url2 = new URL(path69, origin);
74919
+ const url2 = new URL(path70, origin);
74903
74920
  return url2.toString();
74904
74921
  } catch {
74905
74922
  const url2 = `${origin}`;
74906
- if (url2.endsWith("/") && path69.startsWith("/")) {
74907
- return `${url2}${path69.slice(1)}`;
74923
+ if (url2.endsWith("/") && path70.startsWith("/")) {
74924
+ return `${url2}${path70.slice(1)}`;
74908
74925
  }
74909
- if (!url2.endsWith("/") && !path69.startsWith("/")) {
74910
- return `${url2}/${path69}`;
74926
+ if (!url2.endsWith("/") && !path70.startsWith("/")) {
74927
+ return `${url2}/${path70}`;
74911
74928
  }
74912
- return `${url2}${path69}`;
74929
+ return `${url2}${path70}`;
74913
74930
  }
74914
74931
  }
74915
74932
 
@@ -75162,15 +75179,15 @@ function getRequestMethod(original) {
75162
75179
  }
75163
75180
  return "_OTHER";
75164
75181
  }
75165
- function getAbsoluteUrl3(origin, path69 = "/") {
75182
+ function getAbsoluteUrl3(origin, path70 = "/") {
75166
75183
  const url2 = `${origin}`;
75167
- if (url2.endsWith("/") && path69.startsWith("/")) {
75168
- return `${url2}${path69.slice(1)}`;
75184
+ if (url2.endsWith("/") && path70.startsWith("/")) {
75185
+ return `${url2}${path70.slice(1)}`;
75169
75186
  }
75170
- if (!url2.endsWith("/") && !path69.startsWith("/")) {
75171
- return `${url2}/${path69}`;
75187
+ if (!url2.endsWith("/") && !path70.startsWith("/")) {
75188
+ return `${url2}/${path70}`;
75172
75189
  }
75173
- return `${url2}${path69}`;
75190
+ return `${url2}${path70}`;
75174
75191
  }
75175
75192
 
75176
75193
  // ../../node_modules/.pnpm/@sentry+node-core@10.78.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.12.0_@opentele_b98c14eec9a06921cfbe2c973505d695/node_modules/@sentry/node-core/build/esm/integrations/node-fetch/index.js
@@ -77666,10 +77683,10 @@ function emplace(map2, key, contents) {
77666
77683
  }
77667
77684
  return value;
77668
77685
  }
77669
- function shouldSkipContextLinesForFile(path69) {
77670
- if (path69.startsWith("node:")) return true;
77671
- if (path69.startsWith("data:")) return true;
77672
- const pathname = stripUrlQueryAndFragment(path69).toLowerCase();
77686
+ function shouldSkipContextLinesForFile(path70) {
77687
+ if (path70.startsWith("node:")) return true;
77688
+ if (path70.startsWith("data:")) return true;
77689
+ const pathname = stripUrlQueryAndFragment(path70).toLowerCase();
77673
77690
  if (pathname.endsWith(".min.js")) return true;
77674
77691
  if (pathname.endsWith(".min.cjs")) return true;
77675
77692
  if (pathname.endsWith(".min.mjs")) return true;
@@ -77720,9 +77737,9 @@ function makeLineReaderRanges(lines, linecontext) {
77720
77737
  }
77721
77738
  return out;
77722
77739
  }
77723
- function getContextLinesFromFile(path69, ranges, output2) {
77740
+ function getContextLinesFromFile(path70, ranges, output2) {
77724
77741
  return new Promise((resolve2, _reject) => {
77725
- const stream = createReadStream(path69);
77742
+ const stream = createReadStream(path70);
77726
77743
  const lineReaded = createInterface({
77727
77744
  input: stream
77728
77745
  });
@@ -77740,8 +77757,8 @@ function getContextLinesFromFile(path69, ranges, output2) {
77740
77757
  let rangeStart = range[0];
77741
77758
  let rangeEnd = range[1];
77742
77759
  function onStreamError(e) {
77743
- LRU_FILE_CONTENTS_FS_READ_FAILED.set(path69, 1);
77744
- DEBUG_BUILD2 && debug.error(`Failed to read file: ${path69}. Error: ${e}`);
77760
+ LRU_FILE_CONTENTS_FS_READ_FAILED.set(path70, 1);
77761
+ DEBUG_BUILD2 && debug.error(`Failed to read file: ${path70}. Error: ${e}`);
77745
77762
  lineReaded.close();
77746
77763
  lineReaded.removeAllListeners();
77747
77764
  destroyStreamAndResolve();
@@ -79186,8 +79203,8 @@ function getSpotlightConfig(optionsSpotlight) {
79186
79203
 
79187
79204
  // ../../node_modules/.pnpm/@sentry+node-core@10.78.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.12.0_@opentele_b98c14eec9a06921cfbe2c973505d695/node_modules/@sentry/node-core/build/esm/utils/module.js
79188
79205
  import { posix, sep } from "node:path";
79189
- function normalizeWindowsPath(path69) {
79190
- return path69.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
79206
+ function normalizeWindowsPath(path70) {
79207
+ return path70.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
79191
79208
  }
79192
79209
  function createGetModuleFromFilename(basePath = process.argv[1] ? dirname(process.argv[1]) : process.cwd(), isWindows = sep === "\\") {
79193
79210
  const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
@@ -82080,22 +82097,22 @@ function addSpanSource(span, loc, start, end) {
82080
82097
  span.setAttribute(AttributeNames2.SOURCE, source);
82081
82098
  }
82082
82099
  }
82083
- function createFieldIfNotExists(contextValue, info, path69) {
82084
- let field7 = getField(contextValue, path69);
82100
+ function createFieldIfNotExists(contextValue, info, path70) {
82101
+ let field7 = getField(contextValue, path70);
82085
82102
  if (field7) {
82086
82103
  return { field: field7, spanAdded: false };
82087
82104
  }
82088
- const parentSpan = getParentFieldSpan(contextValue, path69);
82105
+ const parentSpan = getParentFieldSpan(contextValue, path70);
82089
82106
  field7 = {
82090
- span: createResolverSpan(contextValue, info, path69, parentSpan)
82107
+ span: createResolverSpan(contextValue, info, path70, parentSpan)
82091
82108
  };
82092
- addField(contextValue, path69, field7);
82109
+ addField(contextValue, path70, field7);
82093
82110
  return { field: field7, spanAdded: true };
82094
82111
  }
82095
- function createResolverSpan(contextValue, info, path69, parentSpan) {
82112
+ function createResolverSpan(contextValue, info, path70, parentSpan) {
82096
82113
  const attributes = {
82097
82114
  [AttributeNames2.FIELD_NAME]: info.fieldName,
82098
- [AttributeNames2.FIELD_PATH]: path69.join("."),
82115
+ [AttributeNames2.FIELD_PATH]: path70.join("."),
82099
82116
  [AttributeNames2.FIELD_TYPE]: info.returnType.toString(),
82100
82117
  [AttributeNames2.PARENT_NAME]: info.parentType.name
82101
82118
  };
@@ -82127,15 +82144,15 @@ function getOperation(document2, operationName) {
82127
82144
  return document2.definitions.find((definition) => OPERATION_VALUES.indexOf(definition?.operation) !== -1);
82128
82145
  }
82129
82146
  }
82130
- function addField(contextValue, path69, field7) {
82131
- return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[path69.join(".")] = field7;
82147
+ function addField(contextValue, path70, field7) {
82148
+ return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[path70.join(".")] = field7;
82132
82149
  }
82133
- function getField(contextValue, path69) {
82134
- return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[path69.join(".")];
82150
+ function getField(contextValue, path70) {
82151
+ return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[path70.join(".")];
82135
82152
  }
82136
- function getParentFieldSpan(contextValue, path69) {
82137
- for (let i = path69.length - 1; i > 0; i--) {
82138
- const field7 = getField(contextValue, path69.slice(0, i));
82153
+ function getParentFieldSpan(contextValue, path70) {
82154
+ for (let i = path70.length - 1; i > 0; i--) {
82155
+ const field7 = getField(contextValue, path70.slice(0, i));
82139
82156
  if (field7) {
82140
82157
  return field7.span;
82141
82158
  }
@@ -82145,9 +82162,9 @@ function getParentFieldSpan(contextValue, path69) {
82145
82162
  function getRootSpan2(contextValue) {
82146
82163
  return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].span;
82147
82164
  }
82148
- function pathToArray(path69) {
82165
+ function pathToArray(path70) {
82149
82166
  const flattened = [];
82150
- let curr = path69;
82167
+ let curr = path70;
82151
82168
  while (curr) {
82152
82169
  flattened.push(String(curr.key));
82153
82170
  curr = curr.prev;
@@ -82288,8 +82305,8 @@ function wrapFieldResolver(getConfig3, fieldResolver, isDefaultResolver = false)
82288
82305
  if (!contextValue[OTEL_GRAPHQL_DATA_SYMBOL]) {
82289
82306
  return fieldResolver.call(this, source, args, contextValue, info);
82290
82307
  }
82291
- const path69 = pathToArray(info?.path);
82292
- const { field: field7, spanAdded } = createFieldIfNotExists(contextValue, info, path69);
82308
+ const path70 = pathToArray(info?.path);
82309
+ const { field: field7, spanAdded } = createFieldIfNotExists(contextValue, info, path70);
82293
82310
  const span = field7.span;
82294
82311
  const shouldEndSpan = spanAdded;
82295
82312
  return withActiveSpan(span, () => {
@@ -85272,10 +85289,10 @@ var PostgresJsInstrumentation = class extends import_instrumentation24.Instrumen
85272
85289
  },
85273
85290
  (exports) => exports
85274
85291
  );
85275
- ["src", "cf/src", "cjs/src"].forEach((path69) => {
85292
+ ["src", "cf/src", "cjs/src"].forEach((path70) => {
85276
85293
  module2.files.push(
85277
85294
  new InstrumentationNodeModuleFile(
85278
- `postgres/${path69}/query.js`,
85295
+ `postgres/${path70}/query.js`,
85279
85296
  SUPPORTED_VERSIONS4,
85280
85297
  this._patchQueryPrototype.bind(this),
85281
85298
  this._unpatchQueryPrototype.bind(this)
@@ -85906,13 +85923,13 @@ var HonoInstrumentation = class extends import_instrumentation27.Instrumentation
85906
85923
  return function(original) {
85907
85924
  return function wrappedHandler(...args) {
85908
85925
  if (typeof args[0] === "string") {
85909
- const path69 = args[0];
85926
+ const path70 = args[0];
85910
85927
  if (args.length === 1) {
85911
- return original.apply(this, [path69]);
85928
+ return original.apply(this, [path70]);
85912
85929
  }
85913
85930
  const handlers2 = args.slice(1);
85914
85931
  return original.apply(this, [
85915
- path69,
85932
+ path70,
85916
85933
  ...handlers2.map((handler) => instrumentation._wrapHandler(handler))
85917
85934
  ]);
85918
85935
  }
@@ -85946,13 +85963,13 @@ var HonoInstrumentation = class extends import_instrumentation27.Instrumentation
85946
85963
  return function(original) {
85947
85964
  return function wrappedHandler(...args) {
85948
85965
  if (typeof args[0] === "string") {
85949
- const path69 = args[0];
85966
+ const path70 = args[0];
85950
85967
  if (args.length === 1) {
85951
- return original.apply(this, [path69]);
85968
+ return original.apply(this, [path70]);
85952
85969
  }
85953
85970
  const handlers2 = args.slice(1);
85954
85971
  return original.apply(this, [
85955
- path69,
85972
+ path70,
85956
85973
  ...handlers2.map((handler) => instrumentation._wrapHandler(handler))
85957
85974
  ]);
85958
85975
  }
@@ -85972,8 +85989,8 @@ var HonoInstrumentation = class extends import_instrumentation27.Instrumentation
85972
85989
  if (!instrumentation.isEnabled()) {
85973
85990
  return handler.apply(this, [c, next]);
85974
85991
  }
85975
- const path69 = c.req.path;
85976
- const span = instrumentation.tracer.startSpan(path69);
85992
+ const path70 = c.req.path;
85993
+ const span = instrumentation.tracer.startSpan(path70);
85977
85994
  return context2.with(trace.setSpan(context2.active(), span), () => {
85978
85995
  return instrumentation._safeExecute(
85979
85996
  () => {
@@ -85983,7 +86000,7 @@ var HonoInstrumentation = class extends import_instrumentation27.Instrumentation
85983
86000
  const type = instrumentation._determineHandlerType(result2);
85984
86001
  span.setAttributes({
85985
86002
  [AttributeNames5.HONO_TYPE]: type,
85986
- [AttributeNames5.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ? path69 : handler.name || "anonymous"
86003
+ [AttributeNames5.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ? path70 : handler.name || "anonymous"
85987
86004
  });
85988
86005
  instrumentation.getConfig().responseHook?.(span);
85989
86006
  return result2;
@@ -85992,7 +86009,7 @@ var HonoInstrumentation = class extends import_instrumentation27.Instrumentation
85992
86009
  const type = instrumentation._determineHandlerType(result);
85993
86010
  span.setAttributes({
85994
86011
  [AttributeNames5.HONO_TYPE]: type,
85995
- [AttributeNames5.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ? path69 : handler.name || "anonymous"
86012
+ [AttributeNames5.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ? path70 : handler.name || "anonymous"
85996
86013
  });
85997
86014
  instrumentation.getConfig().responseHook?.(span);
85998
86015
  return result;
@@ -86196,11 +86213,11 @@ var KoaInstrumentation = class extends import_instrumentation29.InstrumentationB
86196
86213
  const router = dispatchLayer.router;
86197
86214
  const routesStack = router?.stack ?? [];
86198
86215
  for (const pathLayer of routesStack) {
86199
- const path69 = pathLayer.path;
86216
+ const path70 = pathLayer.path;
86200
86217
  const pathStack = pathLayer.stack;
86201
86218
  for (let j = 0; j < pathStack.length; j++) {
86202
86219
  const routedMiddleware = pathStack[j];
86203
- pathStack[j] = this._patchLayer(routedMiddleware, true, path69);
86220
+ pathStack[j] = this._patchLayer(routedMiddleware, true, path70);
86204
86221
  }
86205
86222
  }
86206
86223
  return dispatchLayer;
@@ -88454,7 +88471,7 @@ function _init2(options = {}, getDefaultIntegrationsImpl) {
88454
88471
  import tls2 from "node:tls";
88455
88472
  var import_undici = __toESM(require_undici(), 1);
88456
88473
  var CLI_VERSION_HEADER = "x-powerplant-cli-version";
88457
- var cliVersion = true ? "0.4.42" : "0.0.0-checkout";
88474
+ var cliVersion = true ? "0.4.44" : "0.0.0-checkout";
88458
88475
  function cliVersionHeaders() {
88459
88476
  return { [CLI_VERSION_HEADER]: cliVersion, "user-agent": `powerplant-cli/${cliVersion}` };
88460
88477
  }
@@ -89618,21 +89635,21 @@ function createOmissionRecorder() {
89618
89635
  const count3 = (reason, by = 1) => {
89619
89636
  if (by > 0) counts[reason] = (counts[reason] ?? 0) + by;
89620
89637
  };
89621
- const shape = (reason, path69, valueType, formatVersion, by = 1) => {
89638
+ const shape = (reason, path70, valueType, formatVersion, by = 1) => {
89622
89639
  if (!REPORTED_REASONS.has(reason)) return;
89623
- const key = `${path69}\0${reason}\0${valueType}\0${formatVersion ?? ""}`;
89640
+ const key = `${path70}\0${reason}\0${valueType}\0${formatVersion ?? ""}`;
89624
89641
  const group = groups.get(key);
89625
89642
  if (group) group.count += by;
89626
89643
  else if (groups.size < MAX_STRUCTURE_DIAGNOSTICS) {
89627
- groups.set(key, { path: path69, reason, valueType, count: by, ...formatVersion !== void 0 && { formatVersion } });
89644
+ groups.set(key, { path: path70, reason, valueType, count: by, ...formatVersion !== void 0 && { formatVersion } });
89628
89645
  }
89629
89646
  };
89630
89647
  return {
89631
89648
  count: count3,
89632
89649
  shape,
89633
- note(reason, path69, valueType, formatVersion) {
89650
+ note(reason, path70, valueType, formatVersion) {
89634
89651
  count3(reason);
89635
- shape(reason, path69, valueType, formatVersion);
89652
+ shape(reason, path70, valueType, formatVersion);
89636
89653
  },
89637
89654
  absorb(other) {
89638
89655
  for (const [reason, by] of Object.entries(other.omissions())) {
@@ -90790,14 +90807,14 @@ function rootFolderOf(folder, homeDir, platform2) {
90790
90807
  const written = underHome ? `~${folder.slice(home.length)}` : folder;
90791
90808
  return platform2 === "win32" ? written.replaceAll("\\", "/") : written;
90792
90809
  }
90793
- function checkoutOf(path69, probe, isWorkspaceRepo) {
90810
+ function checkoutOf(path70, probe, isWorkspaceRepo) {
90794
90811
  switch (probe.kind) {
90795
90812
  case "github":
90796
- return isWorkspaceRepo(probe.repoFullName) ? { path: path69, remoteUrl: `https://github.com/${probe.repoFullName}` } : { path: path69, reason: "outside-workspace" };
90813
+ return isWorkspaceRepo(probe.repoFullName) ? { path: path70, remoteUrl: `https://github.com/${probe.repoFullName}` } : { path: path70, reason: "outside-workspace" };
90797
90814
  case "other-code-host":
90798
- return { path: path69, reason: "other-code-host" };
90815
+ return { path: path70, reason: "other-code-host" };
90799
90816
  case "unreadable":
90800
- return { path: path69, reason: probe.reason };
90817
+ return { path: path70, reason: probe.reason };
90801
90818
  case "no-checkout":
90802
90819
  return null;
90803
90820
  }
@@ -90897,8 +90914,8 @@ function createStructureDiagnostics() {
90897
90914
  observe: (source) => (observation) => {
90898
90915
  try {
90899
90916
  const formatVersion = admitted("formatVersion", observation.formatVersion ?? null);
90900
- const path69 = observation.path.replace(/[^A-Za-z0-9_.$:/=[\]-]/g, "_").slice(0, 160) || "other";
90901
- const key = [source, path69, observation.reason, observation.valueType, formatVersion].join("\0");
90917
+ const path70 = observation.path.replace(/[^A-Za-z0-9_.$:/=[\]-]/g, "_").slice(0, 160) || "other";
90918
+ const key = [source, path70, observation.reason, observation.valueType, formatVersion].join("\0");
90902
90919
  const count3 = observation.count ?? 1;
90903
90920
  const existing = groups.get(key);
90904
90921
  if (existing) {
@@ -90908,7 +90925,7 @@ function createStructureDiagnostics() {
90908
90925
  if (samples.length >= MAX_STRUCTURE_DIAGNOSTICS) return;
90909
90926
  const sample = {
90910
90927
  source,
90911
- path: path69,
90928
+ path: path70,
90912
90929
  reason: observation.reason,
90913
90930
  valueType: observation.valueType,
90914
90931
  formatVersion,
@@ -91302,8 +91319,8 @@ var MODEL_INFO_FIELDS_INTERPRETED = /* @__PURE__ */ new Set(["modelName"]);
91302
91319
  function collectUnfamiliar(record2, interpreted, excluded, prefix, into, recorder, formatVersion) {
91303
91320
  for (const [key, value] of Object.entries(record2)) {
91304
91321
  if (interpreted.has(key) || excluded.has(key)) continue;
91305
- const path69 = prefix === "" ? key : `${prefix}.${key}`;
91306
- into.set(path69, value);
91322
+ const path70 = prefix === "" ? key : `${prefix}.${key}`;
91323
+ into.set(path70, value);
91307
91324
  recorder.shape("unsupported", `bubble.${prefix === "" ? "" : `${prefix}.`}${nativeTypeLabel(key) ?? "other"}`, jsonValueType(value), formatVersion);
91308
91325
  }
91309
91326
  }
@@ -91389,8 +91406,8 @@ function bubbleLines(bubble, at, recorder) {
91389
91406
  const formatVersion = typeof bubble._v === "number" || typeof bubble._v === "string" ? String(bubble._v) : void 0;
91390
91407
  if (bubble.type !== 1 && bubble.type !== 2) {
91391
91408
  const nativeType = nativeTypeLabel(String(bubble.type));
91392
- const path69 = `bubble.type=${nativeType ?? "other"}`;
91393
- recorder.note("unsupported", path69, jsonValueType(bubble.type), formatVersion);
91409
+ const path70 = `bubble.type=${nativeType ?? "other"}`;
91410
+ recorder.note("unsupported", path70, jsonValueType(bubble.type), formatVersion);
91394
91411
  const retained = Object.fromEntries(Object.entries(bubble).filter(([key]) => !BUBBLE_FIELDS_EXCLUDED.has(key)));
91395
91412
  const bounded = boundUnfamiliarPayload(retained);
91396
91413
  if (bounded.payload === void 0) recorder.count("truncated");
@@ -91917,12 +91934,12 @@ var CONTENT_LINE_TYPES2 = /* @__PURE__ */ new Set([
91917
91934
  function parseCursorTranscriptFile(text) {
91918
91935
  const lines = [];
91919
91936
  const recorder = createOmissionRecorder();
91920
- const retainUnsupported = (record2, at, path69, discriminator) => {
91937
+ const retainUnsupported = (record2, at, path70, discriminator) => {
91921
91938
  const nativeType = nativeTypeLabel(discriminator);
91922
91939
  const bounded = boundUnfamiliarPayload(record2);
91923
91940
  lines.push({ type: "unsupported", ...nativeType !== void 0 && { nativeType }, ...at, ...bounded });
91924
- recorder.note("unsupported", `${path69}=${nativeType ?? "other"}`, jsonValueType(discriminator));
91925
- if (bounded.payload === void 0) recorder.note("truncated", `${path69}=${nativeType ?? "other"}`, "object");
91941
+ recorder.note("unsupported", `${path70}=${nativeType ?? "other"}`, jsonValueType(discriminator));
91942
+ if (bounded.payload === void 0) recorder.note("truncated", `${path70}=${nativeType ?? "other"}`, "object");
91926
91943
  };
91927
91944
  text.split("\n").forEach((row, recordIndex) => {
91928
91945
  if (!row.trim()) return;
@@ -91944,8 +91961,8 @@ function parseCursorTranscriptFile(text) {
91944
91961
  }
91945
91962
  const record2 = message.safeParse(value);
91946
91963
  if (!record2.success) {
91947
- const [path69, discriminator] = typeof value.type === "string" ? ["record.type", value.type] : typeof value.role === "string" ? ["message.role", value.role] : ["record", void 0];
91948
- retainUnsupported(value, { recordIndex }, path69, discriminator);
91964
+ const [path70, discriminator] = typeof value.type === "string" ? ["record.type", value.type] : typeof value.role === "string" ? ["message.role", value.role] : ["record", void 0];
91965
+ retainUnsupported(value, { recordIndex }, path70, discriminator);
91949
91966
  return;
91950
91967
  }
91951
91968
  const role2 = record2.data.role;
@@ -96744,6 +96761,9 @@ var KeychainKeyStore = class {
96744
96761
  this.keychain.delete(KEY_SERVICE, "forget encryption key");
96745
96762
  }
96746
96763
  };
96764
+ function securityStdinCommand(args) {
96765
+ return args.map((arg) => `"${arg.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`).join(" ") + "\n";
96766
+ }
96747
96767
  var Keychain = class {
96748
96768
  constructor(appEnv, keychainPath) {
96749
96769
  this.appEnv = appEnv;
@@ -96771,8 +96791,7 @@ var Keychain = class {
96771
96791
  /** Create only: an existing item is kept. */
96772
96792
  add(service, secret) {
96773
96793
  const args = ["add-generic-password", "-s", service, "-a", this.appEnv, "-w", secret, ...this.keychain()];
96774
- const command = args.map((arg) => `"${arg.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`).join(" ") + "\n";
96775
- this.security(["-i"], "create encryption key", command, [45]);
96794
+ this.security(["-i"], "create encryption key", securityStdinCommand(args), [45]);
96776
96795
  }
96777
96796
  delete(service, operation2) {
96778
96797
  this.security(
@@ -107072,11 +107091,101 @@ function startMenuModel(sources, platform2) {
107072
107091
  import { spawn as spawn8 } from "node:child_process";
107073
107092
  import { randomUUID as randomUUID9 } from "node:crypto";
107074
107093
  import { mkdirSync as mkdirSync33, openSync as openSync13, realpathSync as realpathSync6 } from "node:fs";
107075
- import path68 from "node:path";
107094
+ import path69 from "node:path";
107076
107095
  import { parseArgs } from "node:util";
107077
107096
 
107078
107097
  // src/doctor.ts
107079
107098
  import { closeSync as closeSync11, fstatSync as fstatSync4, openSync as openSync11, readSync as readSync7 } from "node:fs";
107099
+
107100
+ // src/menubarLoginItem.ts
107101
+ import { spawnSync as spawnSync8 } from "node:child_process";
107102
+ import path66 from "node:path";
107103
+ var LOGIN_ITEM_STATUS_FLAG = "--login-item-status";
107104
+ var REPAIR_LOGIN_ITEM_FLAG = "--repair-login-item";
107105
+ var reportSchema = external_exports.object({
107106
+ version: external_exports.literal(1),
107107
+ status: external_exports.enum(["enabled", "not-registered", "requires-approval", "not-found", "unknown"]),
107108
+ preference: external_exports.enum(["enabled", "disabled", "unknown"]),
107109
+ failure: external_exports.object({
107110
+ domain: external_exports.enum([
107111
+ "NSCocoaErrorDomain",
107112
+ "NSPOSIXErrorDomain",
107113
+ "NSOSStatusErrorDomain",
107114
+ "SMAppServiceErrorDomain",
107115
+ "kSMErrorDomainFramework",
107116
+ "CFErrorDomainLaunchd",
107117
+ "other"
107118
+ ]),
107119
+ code: external_exports.number().int()
107120
+ }).optional()
107121
+ });
107122
+ var runProcess = (file2, args) => spawnSync8(file2, args, {
107123
+ encoding: "utf8",
107124
+ timeout: 5e3,
107125
+ maxBuffer: 16384,
107126
+ windowsHide: true
107127
+ });
107128
+ function inspectMenubarLoginItem(appPath, repair, run2 = runProcess) {
107129
+ if (appPath === null) return { kind: "not-installed" };
107130
+ const capability = run2("/usr/bin/plutil", [
107131
+ "-extract",
107132
+ "PowerplantLoginItemCommands",
107133
+ "raw",
107134
+ "-o",
107135
+ "-",
107136
+ path66.join(appPath, "Contents", "Info.plist")
107137
+ ]);
107138
+ if (capability.status === null) return { kind: "unavailable", reason: "query-failed" };
107139
+ if (capability.status !== 0 || capability.stdout.trim() !== "1")
107140
+ return { kind: "unavailable", reason: "update-required" };
107141
+ const result = run2(path66.join(appPath, "Contents", "MacOS", "PowerplantMenubar"), [
107142
+ repair ? REPAIR_LOGIN_ITEM_FLAG : LOGIN_ITEM_STATUS_FLAG
107143
+ ]);
107144
+ if (result.status === null) return { kind: "unavailable", reason: "query-failed" };
107145
+ let decoded;
107146
+ try {
107147
+ decoded = JSON.parse(result.stdout);
107148
+ } catch {
107149
+ return { kind: "unavailable", reason: "invalid-response" };
107150
+ }
107151
+ const parsed = reportSchema.safeParse(decoded);
107152
+ if (!parsed.success) return { kind: "unavailable", reason: "invalid-response" };
107153
+ if (result.status !== 0 && (!repair || parsed.data.status === "enabled" && parsed.data.failure === void 0)) {
107154
+ return { kind: "unavailable", reason: "query-failed" };
107155
+ }
107156
+ return { kind: "reported", report: parsed.data };
107157
+ }
107158
+ function menuStartupRepairSucceeded(result) {
107159
+ return result.kind === "reported" && result.report.status === "enabled" && result.report.failure === void 0;
107160
+ }
107161
+ function menubarLoginItemLines(result) {
107162
+ if (result.kind === "not-installed")
107163
+ return ["Menu startup: app not installed. Run powerplant init to install it."];
107164
+ if (result.kind === "unavailable") {
107165
+ return [
107166
+ result.reason === "update-required" ? "Menu startup: unavailable in this app version. Run powerplant update, then powerplant doctor." : `Menu startup: could not inspect (${result.reason}). Retry powerplant doctor.`
107167
+ ];
107168
+ }
107169
+ const { status, preference, failure: failure2 } = result.report;
107170
+ const states = {
107171
+ enabled: "enabled",
107172
+ "not-registered": "not registered",
107173
+ "requires-approval": "requires approval in System Settings > General > Login Items",
107174
+ "not-found": "macOS could not find the login item",
107175
+ unknown: "macOS returned an unknown state"
107176
+ };
107177
+ const lines = [
107178
+ `Menu startup: ${states[status]}. Saved choice: ${preference === "unknown" ? "not recorded" : preference}.`
107179
+ ];
107180
+ if (failure2 !== void 0)
107181
+ lines.push(`Menu startup operation failed: ${failure2.domain} (${failure2.code}).`);
107182
+ if (status === "not-registered" || status === "not-found" || failure2 !== void 0) {
107183
+ lines.push("To enable menu startup: powerplant doctor --repair-menu-startup");
107184
+ }
107185
+ return lines;
107186
+ }
107187
+
107188
+ // src/doctor.ts
107080
107189
  var DOCTOR_LOG_TAIL_LINES = 50;
107081
107190
  var LOG_TAIL_READ_BYTES = 256 * 1024;
107082
107191
  function installLine(install) {
@@ -107091,13 +107200,13 @@ function redactedLogTail(raw) {
107091
107200
  while (lines.length > 0 && lines[lines.length - 1]?.trim() === "") lines.pop();
107092
107201
  return lines.slice(-DOCTOR_LOG_TAIL_LINES);
107093
107202
  }
107094
- function readDoctorLogTail(path69) {
107203
+ function readDoctorLogTail(path70) {
107095
107204
  let fd;
107096
107205
  try {
107097
- fd = openSync11(path69, "r");
107206
+ fd = openSync11(path70, "r");
107098
107207
  } catch (error63) {
107099
- if (error63.code === "ENOENT") return { path: path69, lines: null };
107100
- return { path: path69, lines: null, readError: error63 instanceof Error ? error63.message : String(error63) };
107208
+ if (error63.code === "ENOENT") return { path: path70, lines: null };
107209
+ return { path: path70, lines: null, readError: error63 instanceof Error ? error63.message : String(error63) };
107101
107210
  }
107102
107211
  try {
107103
107212
  const size = fstatSync4(fd).size;
@@ -107106,9 +107215,9 @@ function readDoctorLogTail(path69) {
107106
107215
  readSync7(fd, buffer, 0, buffer.length, offset);
107107
107216
  let text = buffer.toString("utf8");
107108
107217
  if (offset > 0) text = text.slice(text.indexOf("\n") + 1);
107109
- return { path: path69, lines: redactedLogTail(text) };
107218
+ return { path: path70, lines: redactedLogTail(text) };
107110
107219
  } catch (error63) {
107111
- return { path: path69, lines: null, readError: error63 instanceof Error ? error63.message : String(error63) };
107220
+ return { path: path70, lines: null, readError: error63 instanceof Error ? error63.message : String(error63) };
107112
107221
  } finally {
107113
107222
  closeSync11(fd);
107114
107223
  }
@@ -107119,7 +107228,7 @@ function renderDoctorReport(i) {
107119
107228
  "Powerplant diagnostics, paste everything below into your email to support@usepowerplant.com."
107120
107229
  );
107121
107230
  lines.push(
107122
- `Collected ${new Date(i.now).toISOString()}. This command only prints; nothing was uploaded.`
107231
+ `Collected ${new Date(i.now).toISOString()}. ${i.menuStartupRepairRequested ? "Menu startup repair was requested; nothing was uploaded." : "This command only prints; nothing was uploaded."}`
107123
107232
  );
107124
107233
  lines.push("");
107125
107234
  lines.push(
@@ -107140,6 +107249,7 @@ function renderDoctorReport(i) {
107140
107249
  lines.push(`Syncing: ${i.control.paused ? "paused" : "active"}`);
107141
107250
  lines.push(`Automatic updates: ${automaticUpdatesChoice(i.control).replace("not-chosen", "not chosen")}`);
107142
107251
  lines.push(...serviceLines(i));
107252
+ if (i.menuStartup !== void 0) lines.push(...menubarLoginItemLines(i.menuStartup));
107143
107253
  lines.push("");
107144
107254
  lines.push(...logLines(i.logTail));
107145
107255
  return lines;
@@ -107263,6 +107373,390 @@ function logLines(tail) {
107263
107373
  ];
107264
107374
  }
107265
107375
 
107376
+ // src/pause.ts
107377
+ function pausedControl(existing, now) {
107378
+ return { ...existing, paused: true, pausedAt: new Date(now).toISOString() };
107379
+ }
107380
+ function resumedControl(existing, now) {
107381
+ return { ...existing, paused: false, resumedAt: new Date(now).toISOString() };
107382
+ }
107383
+ function pauseSyncing(appEnv) {
107384
+ updateCollectorControl(appEnv, (control) => pausedControl(control, Date.now()));
107385
+ }
107386
+ function resumeSyncing(appEnv) {
107387
+ updateCollectorControl(appEnv, (control) => resumedControl(control, Date.now()));
107388
+ }
107389
+ function realPauseDeps(appEnv, resumeCommand2, promptLine) {
107390
+ return {
107391
+ readControl: () => readCollectorControl(appEnv),
107392
+ resume: () => resumeSyncing(appEnv),
107393
+ promptLine,
107394
+ resumeCommand: resumeCommand2,
107395
+ now: Date.now
107396
+ };
107397
+ }
107398
+ function pausedFor(control, now) {
107399
+ if (!control.paused || control.pausedAt === void 0) return null;
107400
+ const ms = now - Date.parse(control.pausedAt);
107401
+ return Number.isFinite(ms) && ms >= 0 ? duration3(ms) : null;
107402
+ }
107403
+ function pausedSince(control, now) {
107404
+ const age = pausedFor(control, now);
107405
+ return age === null ? "Syncing is paused" : `Syncing has been paused for ${age}`;
107406
+ }
107407
+ function pausedNotice(control, resumeCommand2, now) {
107408
+ if (!control.paused) return null;
107409
+ return `! ${pausedSince(control, now)}. To resume sync, run \`${resumeCommand2}\`.`;
107410
+ }
107411
+ function pausedSyncNotice(control, resumeCommand2, now, dryRun) {
107412
+ if (!control.paused || dryRun) return pausedNotice(control, resumeCommand2, now);
107413
+ return `! ${pausedSince(control, now)}. This pass uploads because you asked for it. Background syncing stays paused until you run \`${resumeCommand2}\`.`;
107414
+ }
107415
+ async function offerResume(deps, options) {
107416
+ const { output: output2 } = options;
107417
+ const control = deps.readControl();
107418
+ if (!control.paused) return "not-paused";
107419
+ const now = deps.now();
107420
+ const age = pausedFor(control, now);
107421
+ output2.log(`! ${pausedSince(control, now)}, the background sync is running but uploads nothing`);
107422
+ if (options.promptAllowed && await confirmResume(deps, output2)) {
107423
+ deps.resume();
107424
+ output2.log(
107425
+ `\u2713 Syncing resumed, the background sync is catching up on ${age === null ? "the pause" : `the paused ${age}`}`
107426
+ );
107427
+ return "resumed";
107428
+ }
107429
+ output2.log(`To resume sync, run \`${deps.resumeCommand}\``);
107430
+ return "still-paused";
107431
+ }
107432
+ async function confirmResume(deps, output2) {
107433
+ for (; ; ) {
107434
+ const answer = await deps.promptLine(`${output2.indent}Resume syncing now? [Y/n] `);
107435
+ const normalized = answer?.trim().toLowerCase() ?? "";
107436
+ if (answer === null || normalized === "n" || normalized === "no") return false;
107437
+ if (normalized === "" || normalized === "y" || normalized === "yes") return true;
107438
+ output2.log('Please answer "y" or "n".');
107439
+ }
107440
+ }
107441
+
107442
+ // src/protectedFolders.ts
107443
+ var MACOS_BLOCKED_FOLDER_REMEDY = "To allow it, open System Settings > Privacy & Security > Files and Folders, enable the folder for node, then run `powerplant init`.";
107444
+
107445
+ // src/version.ts
107446
+ var CLI_VERSION = true ? "0.4.44" : "0.0.0-checkout";
107447
+ var CLI_RELEASE_BUILD = true ? true : false;
107448
+ var CLI_DEVELOPMENT_COPY = false;
107449
+ function updateRefusal(tarball, developmentCopy = CLI_DEVELOPMENT_COPY) {
107450
+ if (!developmentCopy || tarball) return null;
107451
+ return "This development copy installs no release. To update it, run `pnpm --filter @usepowerplant/cli exe:install-dev` in your checkout.";
107452
+ }
107453
+
107454
+ // src/statusReport.ts
107455
+ var block = (line, ...details) => ({ line, details });
107456
+ function run(i, args) {
107457
+ return `\`powerplant ${args}${i.config.appEnv === "production" ? "" : ` --env ${i.config.appEnv}`}\``;
107458
+ }
107459
+ function renderStatus(i, out) {
107460
+ const stopping = syncProblems(i);
107461
+ const sections = [
107462
+ ...stopping.map((problem) => [problem]),
107463
+ machineBlock(i, stopping.length === 0),
107464
+ ...warnings(i).map((warning2) => [warning2]),
107465
+ i.connections.map((connection) => mcpBlock(i, connection)),
107466
+ [cliBlock(i, stopping.length === 0)]
107467
+ ];
107468
+ sections.filter((section) => section.length > 0).forEach((section, index) => {
107469
+ if (index > 0) out.log("");
107470
+ for (const { line, details } of section) {
107471
+ out.log(line);
107472
+ details.forEach(out.detail);
107473
+ }
107474
+ });
107475
+ }
107476
+ function daemonStatus(i) {
107477
+ return "status" in i.daemon ? i.daemon.status : null;
107478
+ }
107479
+ function syncProblems(i) {
107480
+ if (i.credentialsError !== void 0) {
107481
+ return [block(`\u2717 ${i.credentialsError}`, `Run ${run(i, "init")} to enroll again.`)];
107482
+ }
107483
+ if (i.credentials === null) return [block("! Not enrolled", `Run ${run(i, "init")}.`)];
107484
+ const problems = [];
107485
+ if (i.control.paused) {
107486
+ problems.push(block(`! ${pausedSince(i.control, i.now)}`, `To resume sync, run ${run(i, "resume")}.`));
107487
+ }
107488
+ if (workspacesAfterLeavingHome(i.credentials)?.length === 0) {
107489
+ problems.push(block("! Not a member of any workspace", "Syncing starts again when a workspace adds you."));
107490
+ }
107491
+ const service = serviceProblem(i);
107492
+ if (service !== null) problems.push(service);
107493
+ const status = i.daemon.state === "running" && !i.control.paused ? i.daemon.status : null;
107494
+ const problem = status && syncProblem(i.credentials, status, run(i, "doctor"));
107495
+ if (problem) problems.push(block(problem.line, problem.detail));
107496
+ return problems;
107497
+ }
107498
+ function unavailableProbe(i) {
107499
+ return block(
107500
+ `! Background sync status unavailable${i.serviceError ? `, ${i.serviceError}` : ""}`,
107501
+ `Run ${run(i, "doctor")} for diagnostics.`
107502
+ );
107503
+ }
107504
+ function serviceProblem(i) {
107505
+ switch (i.service) {
107506
+ case "unavailable":
107507
+ break;
107508
+ case "unsupported":
107509
+ return block(
107510
+ "! Background sync is not supported on this platform yet",
107511
+ `Run ${run(i, "sync")} on a schedule instead.`
107512
+ );
107513
+ case "not-installed":
107514
+ return block("! Background sync is not installed", `Run ${run(i, "init")}.`);
107515
+ case "not-loaded":
107516
+ return block("! Background sync is installed but not loaded", `Run ${run(i, "restart")}.`);
107517
+ case "loaded":
107518
+ break;
107519
+ }
107520
+ switch (i.daemon.state) {
107521
+ case "unreadable":
107522
+ return block(
107523
+ "! Background sync status file is unreadable",
107524
+ `A different version may have written it. Run ${run(i, "restart")}.`
107525
+ );
107526
+ case "not-running":
107527
+ if (i.service === "unavailable") return unavailableProbe(i);
107528
+ return block(
107529
+ "! Background sync has not reported its status",
107530
+ `It may still be starting. If this persists, run ${run(i, "restart")}.`,
107531
+ `The log is at ${serviceLogPath2(i.config.appEnv)}.`
107532
+ );
107533
+ case "stalled":
107534
+ return block(`\u2717 Background sync stalled, no heartbeat for ${duration3(i.daemon.staleMs)}`, `Run ${run(i, "restart")}.`);
107535
+ case "restarting":
107536
+ return block("! Background sync is restarting", "It starts again within a minute.");
107537
+ case "running":
107538
+ return null;
107539
+ }
107540
+ }
107541
+ function machineBlock(i, syncing) {
107542
+ const credentials = i.credentials;
107543
+ if (credentials === null) return [];
107544
+ const org = syncWorkspaceName(credentials);
107545
+ const status = daemonStatus(i);
107546
+ const coverage = syncCoverage(credentials, status, run(i, "doctor"));
107547
+ const line = syncing ? coverage.headline(`${credentials.machineName}${org ? ` to ${org}` : ""}`) : `${credentials.machineName}${org ? ` in ${org}` : ""}`;
107548
+ const details = [`${describeStoredCaptureSummary(credentials)}.`, ...coverage.details];
107549
+ if (status !== null) {
107550
+ const signals = describeSyncSignals(
107551
+ {
107552
+ lastSessionActivityAt: status.lastUploadAt ?? null,
107553
+ lastCheckedInAt: status.lastPass?.at ?? null,
107554
+ syncPaused: null,
107555
+ lastSyncErrorAt: syncFailure(credentials, status)?.at ?? null
107556
+ },
107557
+ new Date(i.now),
107558
+ "last upload unmeasured"
107559
+ );
107560
+ details.push(signals ?? "No sync has run since background sync started.");
107561
+ }
107562
+ if (i.sessionVisibility) details.push(i.sessionVisibility.line);
107563
+ return [block(line, ...details)];
107564
+ }
107565
+ function warnings(i) {
107566
+ const found = [];
107567
+ if (i.moveToInstalledCopy === true) found.push(block(`! Run ${run(i, "init")} to finish moving to the new install`));
107568
+ if (isUnsupportedVersion(i.cliVersion, i.oldestSupportedVersion)) {
107569
+ found.push(
107570
+ block(
107571
+ `! powerplant ${i.cliVersion} is no longer supported, the oldest supported is ${i.oldestSupportedVersion}`,
107572
+ `Run ${run(i, "update")} (or npm install -g @usepowerplant/cli). Unsupported versions can stop working without notice.`
107573
+ )
107574
+ );
107575
+ }
107576
+ for (const entry of i.protectedSessions ?? []) {
107577
+ const sessions = `${entry.sessionCount} recent agent session${entry.sessionCount === 1 ? "" : "s"}`;
107578
+ const staying = entry.sessionCount === 1 ? "is staying local" : "are staying local";
107579
+ found.push(
107580
+ i.credentials !== null && protectedRootReview(i.credentials, entry.root) === "blocked" ? block(
107581
+ `! macOS is blocking Powerplant from reading ${entry.displayRoot}`,
107582
+ `${sessions} ${staying}. ${MACOS_BLOCKED_FOLDER_REMEDY}`
107583
+ ) : block(
107584
+ `! ${sessions} under ${entry.displayRoot} ${staying}`,
107585
+ `Run ${run(i, "init")} to review Git repository scanning.`
107586
+ )
107587
+ );
107588
+ }
107589
+ if (i.service === "unavailable" && i.daemon.state !== "not-running") found.push(unavailableProbe(i));
107590
+ if (i.mcpPreferencesError !== void 0) found.push(block("! MCP choices can't be read", i.mcpPreferencesError));
107591
+ for (const hook of daemonStatus(i)?.hooks ?? []) {
107592
+ const silence = hookWarning(hook, i.now);
107593
+ if (silence) found.push(block(`! ${silence.problem}`, silence.fix));
107594
+ }
107595
+ return found;
107596
+ }
107597
+ function mcpBlock(i, connection) {
107598
+ const name = `${AGENT_DISPLAY_NAMES[connection.client]}${connection.target ? ` (${connection.target})` : ""}`;
107599
+ const fix = `Run ${run(i, `connect --client ${connection.client}`)}.`;
107600
+ const current = connectionIsCurrent(connection, i.now);
107601
+ const checked2 = current ? "" : `, checked ${ago(i.now - Date.parse(connection.checkedAt))}`;
107602
+ switch (connection.state) {
107603
+ case "signed-in":
107604
+ return block(`${current ? "\u2713 " : ""}${name}: MCP connected${checked2}`);
107605
+ case "sign-in-needed":
107606
+ return block(`! ${name}: MCP sign-in needed${checked2}`, fix);
107607
+ case "different-url":
107608
+ return block(
107609
+ `! ${name}: MCP points at a different Powerplant${connection.registeredUrl ? `, ${connection.registeredUrl}` : ""}`,
107610
+ fix
107611
+ );
107612
+ case "not-connected":
107613
+ return i.mcpPreferences?.clients[connection.client]?.optedIn === true ? block(`! ${name}: MCP not connected`, fix) : block(`${name}: MCP not connected`);
107614
+ case "configured":
107615
+ return block(`${name}: MCP configured, sign-in unknown`);
107616
+ case "check-failed":
107617
+ return block(`${name}: MCP check failed${connection.detail ? `, ${connection.detail}` : ""}`);
107618
+ }
107619
+ }
107620
+ function cliBlock(i, syncing) {
107621
+ const details = [];
107622
+ if (i.daemon.state === "running" && i.daemon.status.version !== i.cliVersion) {
107623
+ details.push(
107624
+ `Background sync is on ${i.daemon.status.version}. It restarts onto the installed version within minutes, or now with ${run(i, "restart")}.`
107625
+ );
107626
+ }
107627
+ const automatic = automaticUpdatesChoice(i.control);
107628
+ const version2 = `powerplant ${i.cliVersion}`;
107629
+ if (isUpdateAvailable(i.cliVersion, i.latestVersion) && !isUnsupportedVersion(i.cliVersion, i.oldestSupportedVersion)) {
107630
+ return block(`${version2}, ${i.latestVersion} is available`, ...details, `Run ${run(i, "update")}.`);
107631
+ }
107632
+ if (automatic === "not-chosen" && syncing) {
107633
+ details.push(`Turn them on with ${run(i, "update --automatic on")}.`);
107634
+ }
107635
+ return block(`${version2}, automatic updates ${automatic === "on" ? "on" : "off"}`, ...details);
107636
+ }
107637
+ function statusJson(i) {
107638
+ return {
107639
+ appEnv: i.config.appEnv,
107640
+ apiUrl: i.config.apiUrl,
107641
+ cliVersion: i.cliVersion,
107642
+ latestVersion: i.latestVersion,
107643
+ oldestSupportedVersion: i.oldestSupportedVersion,
107644
+ // null = couldn't tell (no line drawn, or this isn't a release build).
107645
+ supported: supportedFlag(i.cliVersion, i.oldestSupportedVersion),
107646
+ enrolled: i.credentials !== null,
107647
+ ...i.credentials && {
107648
+ machineId: i.credentials.machineId,
107649
+ machineName: i.credentials.machineName,
107650
+ orgId: i.credentials.orgId ?? null,
107651
+ orgName: i.credentials.orgName ?? null,
107652
+ capture: describeStoredCapture(i.credentials)
107653
+ },
107654
+ protectedRepoDiscoveryNeeded: (i.protectedSessions ?? []).map((entry) => ({
107655
+ displayRoot: entry.displayRoot,
107656
+ sessionCount: entry.sessionCount,
107657
+ // The member said yes and macOS refused: System Settings, not init,
107658
+ // is the fix, so a tool rendering this must not say "review".
107659
+ blockedByMacOS: i.credentials !== null && protectedRootReview(i.credentials, entry.root) === "blocked"
107660
+ })),
107661
+ ...i.credentialsError !== void 0 && { credentialsError: i.credentialsError },
107662
+ service: i.service,
107663
+ ...i.serviceError !== void 0 && { serviceError: i.serviceError },
107664
+ moveToInstalledCopy: i.moveToInstalledCopy === true,
107665
+ ...i.credentialStore !== void 0 && { credentialStore: i.credentialStore },
107666
+ ...i.credentialStoreError !== void 0 && { credentialStoreError: i.credentialStoreError },
107667
+ ...i.credentialMigration !== void 0 && { credentialMigration: i.credentialMigration },
107668
+ // "unreadable" passes through as its own state — a tool must be able to
107669
+ // tell "the daemon's report can't be parsed" from "the daemon is dead",
107670
+ // exactly like the human rendering above.
107671
+ daemon: "status" in i.daemon ? { state: i.daemon.state, ...i.daemon.status } : { state: i.daemon.state },
107672
+ paused: i.control.paused,
107673
+ automaticUpdates: automaticUpdatesChoice(i.control),
107674
+ pausedAt: i.control.pausedAt ?? null,
107675
+ // The same saved checks the human rendering reads, each with when it ran.
107676
+ mcpConnections: i.connections,
107677
+ sessionVisibility: i.sessionVisibility ?? null
107678
+ };
107679
+ }
107680
+ function supportedFlag(cliVersion2, oldestSupportedVersion) {
107681
+ if (oldestSupportedVersion === null) return null;
107682
+ const order = compareReleaseVersions(cliVersion2, oldestSupportedVersion);
107683
+ return order === null ? null : order !== -1;
107684
+ }
107685
+ var npmLatestSchema = external_exports.object({ version: external_exports.string().min(1) });
107686
+ async function fetchDistTag(packageName, distTag, fetchImpl = fetch) {
107687
+ try {
107688
+ const response = await fetchImpl(
107689
+ `https://registry.npmjs.org/${encodeURIComponent(packageName)}/${distTag}`,
107690
+ { signal: AbortSignal.timeout(3e3) }
107691
+ );
107692
+ if (response.status === 404) return { kind: "absent" };
107693
+ if (!response.ok) return { kind: "unreachable" };
107694
+ const parsed = npmLatestSchema.safeParse(await response.json());
107695
+ return parsed.success ? { kind: "found", version: parsed.data.version } : { kind: "unreachable" };
107696
+ } catch {
107697
+ return { kind: "unreachable" };
107698
+ }
107699
+ }
107700
+ async function fetchNewestRelease(packageName, fetchImpl = fetch) {
107701
+ const next = await fetchDistTag(packageName, "next", fetchImpl);
107702
+ if (next.kind === "found") return next.version;
107703
+ if (next.kind === "unreachable") return null;
107704
+ const latest2 = await fetchDistTag(packageName, "latest", fetchImpl);
107705
+ return latest2.kind === "found" ? latest2.version : null;
107706
+ }
107707
+ function releaseSource(appEnv) {
107708
+ return appEnv === "production" ? "promoted" : "npm";
107709
+ }
107710
+ function fetchVersionFacts(appEnv, credentials, packageName, fetchImpl = fetch, developmentCopy = CLI_DEVELOPMENT_COPY) {
107711
+ if (developmentCopy) return Promise.resolve([null, null]);
107712
+ const policy = credentials === null ? Promise.resolve(null) : fetchVersionPolicy(credentials.apiUrl, credentials.token, fetchImpl);
107713
+ const latest2 = releaseSource(appEnv) === "npm" ? fetchNewestRelease(packageName, fetchImpl) : policy.then((found) => found?.promotedVersion ?? null);
107714
+ return Promise.all([latest2, policy.then((found) => found?.oldestSupportedVersion ?? null)]);
107715
+ }
107716
+
107717
+ // src/doctorCommand.ts
107718
+ async function runDoctor(i) {
107719
+ if (i.repairMenuStartup && !i.menuStartupSupported) {
107720
+ throw new ExpectedCliError("Menu startup repair is available for the production Mac app only.");
107721
+ }
107722
+ const found = await i.activity("Collecting diagnostics\u2026", async () => {
107723
+ const service = i.readService();
107724
+ const stored = i.readCredentials();
107725
+ const [[latestVersion, oldestSupportedVersion], serviceRead] = await Promise.all([
107726
+ fetchVersionFacts(i.config.appEnv, stored.credentials, CLI_PACKAGE_NAME),
107727
+ service
107728
+ ]);
107729
+ const installed = i.menuStartupSupported ? i.installedApp() : null;
107730
+ const menuStartup = installed === null ? void 0 : inspectMenubarLoginItem(
107731
+ installed.present ? installed.appPath : null,
107732
+ i.repairMenuStartup
107733
+ );
107734
+ return { stored, latestVersion, oldestSupportedVersion, serviceRead, menuStartup };
107735
+ });
107736
+ const failedRepair = i.repairMenuStartup && (found.menuStartup === void 0 || !menuStartupRepairSucceeded(found.menuStartup));
107737
+ return {
107738
+ exitCode: failedRepair ? 1 : 0,
107739
+ lines: renderDoctorReport({
107740
+ config: i.config,
107741
+ cliVersion: CLI_VERSION,
107742
+ latestVersion: found.latestVersion,
107743
+ oldestSupportedVersion: found.oldestSupportedVersion,
107744
+ nodeVersion: process.version,
107745
+ platform: `${process.platform} ${process.arch}`,
107746
+ install: i.inspectInstall(),
107747
+ ...found.stored,
107748
+ ...found.serviceRead,
107749
+ ...i.readCredentialStore(),
107750
+ daemon: describeDaemonState(readCollectorStatus(i.config.appEnv)),
107751
+ control: readCollectorControl(i.config.appEnv),
107752
+ menuStartup: found.menuStartup,
107753
+ menuStartupRepairRequested: i.repairMenuStartup,
107754
+ logTail: readDoctorLogTail(serviceLogPath2(i.config.appEnv)),
107755
+ now: Date.now()
107756
+ })
107757
+ };
107758
+ }
107759
+
107266
107760
  // src/env.ts
107267
107761
  var SHARED_SENTRY_DSN = "https://e82214a5c58b312296cdacc3a2de1c8d@o4507827225886720.ingest.us.sentry.io/4511759864627200";
107268
107762
  var CLI_ENVIRONMENTS = {
@@ -107284,8 +107778,8 @@ var CLI_ENVIRONMENTS = {
107284
107778
  },
107285
107779
  agent: {
107286
107780
  appEnv: "agent",
107287
- supabaseUrl: "https://ujyqfbfgfqfeyptbsplx.supabase.co",
107288
- supabasePublishableKey: "sb_publishable_9kKpRx2p-zcUc8xbEfUUFg_920wmXat",
107781
+ supabaseUrl: "http://127.0.0.1:55321",
107782
+ supabasePublishableKey: "sb_publishable_ACJWlzQHlZjBrEguHvfOxg_3BJgxAaH",
107289
107783
  apiUrl: "http://localhost:3000",
107290
107784
  webUrl: "http://localhost:5173"
107291
107785
  },
@@ -107364,77 +107858,6 @@ function readinessError() {
107364
107858
 
107365
107859
  // src/init.ts
107366
107860
  import { createInterface as createInterface3 } from "node:readline/promises";
107367
-
107368
- // src/pause.ts
107369
- function pausedControl(existing, now) {
107370
- return { ...existing, paused: true, pausedAt: new Date(now).toISOString() };
107371
- }
107372
- function resumedControl(existing, now) {
107373
- return { ...existing, paused: false, resumedAt: new Date(now).toISOString() };
107374
- }
107375
- function pauseSyncing(appEnv) {
107376
- updateCollectorControl(appEnv, (control) => pausedControl(control, Date.now()));
107377
- }
107378
- function resumeSyncing(appEnv) {
107379
- updateCollectorControl(appEnv, (control) => resumedControl(control, Date.now()));
107380
- }
107381
- function realPauseDeps(appEnv, resumeCommand2, promptLine) {
107382
- return {
107383
- readControl: () => readCollectorControl(appEnv),
107384
- resume: () => resumeSyncing(appEnv),
107385
- promptLine,
107386
- resumeCommand: resumeCommand2,
107387
- now: Date.now
107388
- };
107389
- }
107390
- function pausedFor(control, now) {
107391
- if (!control.paused || control.pausedAt === void 0) return null;
107392
- const ms = now - Date.parse(control.pausedAt);
107393
- return Number.isFinite(ms) && ms >= 0 ? duration3(ms) : null;
107394
- }
107395
- function pausedSince(control, now) {
107396
- const age = pausedFor(control, now);
107397
- return age === null ? "Syncing is paused" : `Syncing has been paused for ${age}`;
107398
- }
107399
- function pausedNotice(control, resumeCommand2, now) {
107400
- if (!control.paused) return null;
107401
- return `! ${pausedSince(control, now)}. To resume sync, run \`${resumeCommand2}\`.`;
107402
- }
107403
- function pausedSyncNotice(control, resumeCommand2, now, dryRun) {
107404
- if (!control.paused || dryRun) return pausedNotice(control, resumeCommand2, now);
107405
- return `! ${pausedSince(control, now)}. This pass uploads because you asked for it. Background syncing stays paused until you run \`${resumeCommand2}\`.`;
107406
- }
107407
- async function offerResume(deps, options) {
107408
- const { output: output2 } = options;
107409
- const control = deps.readControl();
107410
- if (!control.paused) return "not-paused";
107411
- const now = deps.now();
107412
- const age = pausedFor(control, now);
107413
- output2.log(`! ${pausedSince(control, now)}, the background sync is running but uploads nothing`);
107414
- if (options.promptAllowed && await confirmResume(deps, output2)) {
107415
- deps.resume();
107416
- output2.log(
107417
- `\u2713 Syncing resumed, the background sync is catching up on ${age === null ? "the pause" : `the paused ${age}`}`
107418
- );
107419
- return "resumed";
107420
- }
107421
- output2.log(`To resume sync, run \`${deps.resumeCommand}\``);
107422
- return "still-paused";
107423
- }
107424
- async function confirmResume(deps, output2) {
107425
- for (; ; ) {
107426
- const answer = await deps.promptLine(`${output2.indent}Resume syncing now? [Y/n] `);
107427
- const normalized = answer?.trim().toLowerCase() ?? "";
107428
- if (answer === null || normalized === "n" || normalized === "no") return false;
107429
- if (normalized === "" || normalized === "y" || normalized === "yes") return true;
107430
- output2.log('Please answer "y" or "n".');
107431
- }
107432
- }
107433
-
107434
- // src/protectedFolders.ts
107435
- var MACOS_BLOCKED_FOLDER_REMEDY = "To allow it, open System Settings > Privacy & Security > Files and Folders, enable the folder for node, then run `powerplant init`.";
107436
-
107437
- // src/init.ts
107438
107861
  var INIT_PREFLIGHT_LABELS = {
107439
107862
  move: "Finishing background sync setup\u2026",
107440
107863
  restart: "Restarting background sync\u2026"
@@ -107772,275 +108195,25 @@ function runResumeSession(source, sessionId, deps = {}) {
107772
108195
  }
107773
108196
  }
107774
108197
 
107775
- // src/version.ts
107776
- var CLI_VERSION = true ? "0.4.42" : "0.0.0-checkout";
107777
- var CLI_RELEASE_BUILD = true ? true : false;
107778
- var CLI_DEVELOPMENT_COPY = false;
107779
- function updateRefusal(tarball, developmentCopy = CLI_DEVELOPMENT_COPY) {
107780
- if (!developmentCopy || tarball) return null;
107781
- return "This development copy installs no release. To update it, run `pnpm --filter @usepowerplant/cli exe:install-dev` in your checkout.";
107782
- }
107783
-
107784
- // src/statusReport.ts
107785
- var block = (line, ...details) => ({ line, details });
107786
- function run(i, args) {
107787
- return `\`powerplant ${args}${i.config.appEnv === "production" ? "" : ` --env ${i.config.appEnv}`}\``;
107788
- }
107789
- function renderStatus(i, out) {
107790
- const stopping = syncProblems(i);
107791
- const sections = [
107792
- ...stopping.map((problem) => [problem]),
107793
- machineBlock(i, stopping.length === 0),
107794
- ...warnings(i).map((warning2) => [warning2]),
107795
- i.connections.map((connection) => mcpBlock(i, connection)),
107796
- [cliBlock(i, stopping.length === 0)]
107797
- ];
107798
- sections.filter((section) => section.length > 0).forEach((section, index) => {
107799
- if (index > 0) out.log("");
107800
- for (const { line, details } of section) {
107801
- out.log(line);
107802
- details.forEach(out.detail);
107803
- }
107804
- });
107805
- }
107806
- function daemonStatus(i) {
107807
- return "status" in i.daemon ? i.daemon.status : null;
107808
- }
107809
- function syncProblems(i) {
107810
- if (i.credentialsError !== void 0) {
107811
- return [block(`\u2717 ${i.credentialsError}`, `Run ${run(i, "init")} to enroll again.`)];
107812
- }
107813
- if (i.credentials === null) return [block("! Not enrolled", `Run ${run(i, "init")}.`)];
107814
- const problems = [];
107815
- if (i.control.paused) {
107816
- problems.push(block(`! ${pausedSince(i.control, i.now)}`, `To resume sync, run ${run(i, "resume")}.`));
107817
- }
107818
- if (workspacesAfterLeavingHome(i.credentials)?.length === 0) {
107819
- problems.push(block("! Not a member of any workspace", "Syncing starts again when a workspace adds you."));
107820
- }
107821
- const service = serviceProblem(i);
107822
- if (service !== null) problems.push(service);
107823
- const status = i.daemon.state === "running" && !i.control.paused ? i.daemon.status : null;
107824
- const problem = status && syncProblem(i.credentials, status, run(i, "doctor"));
107825
- if (problem) problems.push(block(problem.line, problem.detail));
107826
- return problems;
107827
- }
107828
- function unavailableProbe(i) {
107829
- return block(
107830
- `! Background sync status unavailable${i.serviceError ? `, ${i.serviceError}` : ""}`,
107831
- `Run ${run(i, "doctor")} for diagnostics.`
107832
- );
107833
- }
107834
- function serviceProblem(i) {
107835
- switch (i.service) {
107836
- case "unavailable":
107837
- break;
107838
- case "unsupported":
107839
- return block(
107840
- "! Background sync is not supported on this platform yet",
107841
- `Run ${run(i, "sync")} on a schedule instead.`
107842
- );
107843
- case "not-installed":
107844
- return block("! Background sync is not installed", `Run ${run(i, "init")}.`);
107845
- case "not-loaded":
107846
- return block("! Background sync is installed but not loaded", `Run ${run(i, "restart")}.`);
107847
- case "loaded":
107848
- break;
107849
- }
107850
- switch (i.daemon.state) {
107851
- case "unreadable":
107852
- return block(
107853
- "! Background sync status file is unreadable",
107854
- `A different version may have written it. Run ${run(i, "restart")}.`
107855
- );
107856
- case "not-running":
107857
- if (i.service === "unavailable") return unavailableProbe(i);
107858
- return block(
107859
- "! Background sync has not reported its status",
107860
- `It may still be starting. If this persists, run ${run(i, "restart")}.`,
107861
- `The log is at ${serviceLogPath2(i.config.appEnv)}.`
107862
- );
107863
- case "stalled":
107864
- return block(`\u2717 Background sync stalled, no heartbeat for ${duration3(i.daemon.staleMs)}`, `Run ${run(i, "restart")}.`);
107865
- case "restarting":
107866
- return block("! Background sync is restarting", "It starts again within a minute.");
107867
- case "running":
107868
- return null;
107869
- }
107870
- }
107871
- function machineBlock(i, syncing) {
107872
- const credentials = i.credentials;
107873
- if (credentials === null) return [];
107874
- const org = syncWorkspaceName(credentials);
107875
- const status = daemonStatus(i);
107876
- const coverage = syncCoverage(credentials, status, run(i, "doctor"));
107877
- const line = syncing ? coverage.headline(`${credentials.machineName}${org ? ` to ${org}` : ""}`) : `${credentials.machineName}${org ? ` in ${org}` : ""}`;
107878
- const details = [`${describeStoredCaptureSummary(credentials)}.`, ...coverage.details];
107879
- if (status !== null) {
107880
- const signals = describeSyncSignals(
107881
- {
107882
- lastSessionActivityAt: status.lastUploadAt ?? null,
107883
- lastCheckedInAt: status.lastPass?.at ?? null,
107884
- syncPaused: null,
107885
- lastSyncErrorAt: syncFailure(credentials, status)?.at ?? null
107886
- },
107887
- new Date(i.now),
107888
- "last upload unmeasured"
107889
- );
107890
- details.push(signals ?? "No sync has run since background sync started.");
107891
- }
107892
- return [block(line, ...details)];
107893
- }
107894
- function warnings(i) {
107895
- const found = [];
107896
- if (i.moveToInstalledCopy === true) found.push(block(`! Run ${run(i, "init")} to finish moving to the new install`));
107897
- if (isUnsupportedVersion(i.cliVersion, i.oldestSupportedVersion)) {
107898
- found.push(
107899
- block(
107900
- `! powerplant ${i.cliVersion} is no longer supported, the oldest supported is ${i.oldestSupportedVersion}`,
107901
- `Run ${run(i, "update")} (or npm install -g @usepowerplant/cli). Unsupported versions can stop working without notice.`
107902
- )
107903
- );
107904
- }
107905
- for (const entry of i.protectedSessions ?? []) {
107906
- const sessions = `${entry.sessionCount} recent agent session${entry.sessionCount === 1 ? "" : "s"}`;
107907
- const staying = entry.sessionCount === 1 ? "is staying local" : "are staying local";
107908
- found.push(
107909
- i.credentials !== null && protectedRootReview(i.credentials, entry.root) === "blocked" ? block(
107910
- `! macOS is blocking Powerplant from reading ${entry.displayRoot}`,
107911
- `${sessions} ${staying}. ${MACOS_BLOCKED_FOLDER_REMEDY}`
107912
- ) : block(
107913
- `! ${sessions} under ${entry.displayRoot} ${staying}`,
107914
- `Run ${run(i, "init")} to review Git repository scanning.`
107915
- )
107916
- );
107917
- }
107918
- if (i.service === "unavailable" && i.daemon.state !== "not-running") found.push(unavailableProbe(i));
107919
- if (i.mcpPreferencesError !== void 0) found.push(block("! MCP choices can't be read", i.mcpPreferencesError));
107920
- for (const hook of daemonStatus(i)?.hooks ?? []) {
107921
- const silence = hookWarning(hook, i.now);
107922
- if (silence) found.push(block(`! ${silence.problem}`, silence.fix));
107923
- }
107924
- return found;
107925
- }
107926
- function mcpBlock(i, connection) {
107927
- const name = `${AGENT_DISPLAY_NAMES[connection.client]}${connection.target ? ` (${connection.target})` : ""}`;
107928
- const fix = `Run ${run(i, `connect --client ${connection.client}`)}.`;
107929
- const current = connectionIsCurrent(connection, i.now);
107930
- const checked2 = current ? "" : `, checked ${ago(i.now - Date.parse(connection.checkedAt))}`;
107931
- switch (connection.state) {
107932
- case "signed-in":
107933
- return block(`${current ? "\u2713 " : ""}${name}: MCP connected${checked2}`);
107934
- case "sign-in-needed":
107935
- return block(`! ${name}: MCP sign-in needed${checked2}`, fix);
107936
- case "different-url":
107937
- return block(
107938
- `! ${name}: MCP points at a different Powerplant${connection.registeredUrl ? `, ${connection.registeredUrl}` : ""}`,
107939
- fix
107940
- );
107941
- case "not-connected":
107942
- return i.mcpPreferences?.clients[connection.client]?.optedIn === true ? block(`! ${name}: MCP not connected`, fix) : block(`${name}: MCP not connected`);
107943
- case "configured":
107944
- return block(`${name}: MCP configured, sign-in unknown`);
107945
- case "check-failed":
107946
- return block(`${name}: MCP check failed${connection.detail ? `, ${connection.detail}` : ""}`);
107947
- }
107948
- }
107949
- function cliBlock(i, syncing) {
107950
- const details = [];
107951
- if (i.daemon.state === "running" && i.daemon.status.version !== i.cliVersion) {
107952
- details.push(
107953
- `Background sync is on ${i.daemon.status.version}. It restarts onto the installed version within minutes, or now with ${run(i, "restart")}.`
107954
- );
107955
- }
107956
- const automatic = automaticUpdatesChoice(i.control);
107957
- const version2 = `powerplant ${i.cliVersion}`;
107958
- if (isUpdateAvailable(i.cliVersion, i.latestVersion) && !isUnsupportedVersion(i.cliVersion, i.oldestSupportedVersion)) {
107959
- return block(`${version2}, ${i.latestVersion} is available`, ...details, `Run ${run(i, "update")}.`);
107960
- }
107961
- if (automatic === "not-chosen" && syncing) {
107962
- details.push(`Turn them on with ${run(i, "update --automatic on")}.`);
107963
- }
107964
- return block(`${version2}, automatic updates ${automatic === "on" ? "on" : "off"}`, ...details);
107965
- }
107966
- function statusJson(i) {
107967
- return {
107968
- appEnv: i.config.appEnv,
107969
- apiUrl: i.config.apiUrl,
107970
- cliVersion: i.cliVersion,
107971
- latestVersion: i.latestVersion,
107972
- oldestSupportedVersion: i.oldestSupportedVersion,
107973
- // null = couldn't tell (no line drawn, or this isn't a release build).
107974
- supported: supportedFlag(i.cliVersion, i.oldestSupportedVersion),
107975
- enrolled: i.credentials !== null,
107976
- ...i.credentials && {
107977
- machineId: i.credentials.machineId,
107978
- machineName: i.credentials.machineName,
107979
- orgId: i.credentials.orgId ?? null,
107980
- orgName: i.credentials.orgName ?? null,
107981
- capture: describeStoredCapture(i.credentials)
107982
- },
107983
- protectedRepoDiscoveryNeeded: (i.protectedSessions ?? []).map((entry) => ({
107984
- displayRoot: entry.displayRoot,
107985
- sessionCount: entry.sessionCount,
107986
- // The member said yes and macOS refused: System Settings, not init,
107987
- // is the fix, so a tool rendering this must not say "review".
107988
- blockedByMacOS: i.credentials !== null && protectedRootReview(i.credentials, entry.root) === "blocked"
107989
- })),
107990
- ...i.credentialsError !== void 0 && { credentialsError: i.credentialsError },
107991
- service: i.service,
107992
- ...i.serviceError !== void 0 && { serviceError: i.serviceError },
107993
- moveToInstalledCopy: i.moveToInstalledCopy === true,
107994
- ...i.credentialStore !== void 0 && { credentialStore: i.credentialStore },
107995
- ...i.credentialStoreError !== void 0 && { credentialStoreError: i.credentialStoreError },
107996
- ...i.credentialMigration !== void 0 && { credentialMigration: i.credentialMigration },
107997
- // "unreadable" passes through as its own state — a tool must be able to
107998
- // tell "the daemon's report can't be parsed" from "the daemon is dead",
107999
- // exactly like the human rendering above.
108000
- daemon: "status" in i.daemon ? { state: i.daemon.state, ...i.daemon.status } : { state: i.daemon.state },
108001
- paused: i.control.paused,
108002
- automaticUpdates: automaticUpdatesChoice(i.control),
108003
- pausedAt: i.control.pausedAt ?? null,
108004
- // The same saved checks the human rendering reads, each with when it ran.
108005
- mcpConnections: i.connections
108006
- };
108007
- }
108008
- function supportedFlag(cliVersion2, oldestSupportedVersion) {
108009
- if (oldestSupportedVersion === null) return null;
108010
- const order = compareReleaseVersions(cliVersion2, oldestSupportedVersion);
108011
- return order === null ? null : order !== -1;
108012
- }
108013
- var npmLatestSchema = external_exports.object({ version: external_exports.string().min(1) });
108014
- async function fetchDistTag(packageName, distTag, fetchImpl = fetch) {
108198
+ // src/sessionVisibilityLine.ts
108199
+ var FETCH_TIMEOUT_MS2 = 3e3;
108200
+ var workspacesAnswer = external_exports.object({
108201
+ data: external_exports.object({ sessionVisibility: sessionVisibilitySettingSchema.optional().catch(void 0) })
108202
+ });
108203
+ async function readSessionVisibilityLine(credentials, fetchImpl = fetch) {
108204
+ if (credentials === null) return null;
108015
108205
  try {
108016
- const response = await fetchImpl(
108017
- `https://registry.npmjs.org/${encodeURIComponent(packageName)}/${distTag}`,
108018
- { signal: AbortSignal.timeout(3e3) }
108019
- );
108020
- if (response.status === 404) return { kind: "absent" };
108021
- if (!response.ok) return { kind: "unreachable" };
108022
- const parsed = npmLatestSchema.safeParse(await response.json());
108023
- return parsed.success ? { kind: "found", version: parsed.data.version } : { kind: "unreachable" };
108206
+ const response = await fetchImpl(`${credentials.apiUrl}/api/collector/workspaces`, {
108207
+ headers: { authorization: `Bearer ${credentials.token}`, ...cliVersionHeaders() },
108208
+ signal: AbortSignal.timeout(FETCH_TIMEOUT_MS2)
108209
+ });
108210
+ if (!response.ok) return null;
108211
+ const setting = workspacesAnswer.safeParse(await response.json()).data?.data.sessionVisibility;
108212
+ return setting === void 0 ? null : { setting, line: describeOwnSessionVisibility(setting) };
108024
108213
  } catch {
108025
- return { kind: "unreachable" };
108214
+ return null;
108026
108215
  }
108027
108216
  }
108028
- async function fetchNewestRelease(packageName, fetchImpl = fetch) {
108029
- const next = await fetchDistTag(packageName, "next", fetchImpl);
108030
- if (next.kind === "found") return next.version;
108031
- if (next.kind === "unreachable") return null;
108032
- const latest2 = await fetchDistTag(packageName, "latest", fetchImpl);
108033
- return latest2.kind === "found" ? latest2.version : null;
108034
- }
108035
- function releaseSource(appEnv) {
108036
- return appEnv === "production" ? "promoted" : "npm";
108037
- }
108038
- function fetchVersionFacts(appEnv, credentials, packageName, fetchImpl = fetch, developmentCopy = CLI_DEVELOPMENT_COPY) {
108039
- if (developmentCopy) return Promise.resolve([null, null]);
108040
- const policy = credentials === null ? Promise.resolve(null) : fetchVersionPolicy(credentials.apiUrl, credentials.token, fetchImpl);
108041
- const latest2 = releaseSource(appEnv) === "npm" ? fetchNewestRelease(packageName, fetchImpl) : policy.then((found) => found?.promotedVersion ?? null);
108042
- return Promise.all([latest2, policy.then((found) => found?.oldestSupportedVersion ?? null)]);
108043
- }
108044
108217
 
108045
108218
  // src/installProgress.ts
108046
108219
  function installProgress(writer, update) {
@@ -108064,7 +108237,7 @@ function installProgress(writer, update) {
108064
108237
  // src/credentialUpgrade.ts
108065
108238
  import { spawn as spawn7 } from "node:child_process";
108066
108239
  import { closeSync as closeSync12, mkdirSync as mkdirSync31, openSync as openSync12 } from "node:fs";
108067
- import path66 from "node:path";
108240
+ import path67 from "node:path";
108068
108241
  async function prepareCredentialUpgrade(deps) {
108069
108242
  if (!deps.needsMigration()) return "ready";
108070
108243
  if (!deps.movesSync && !deps.serviceExists() || deps.block() === null) return "ready";
@@ -108104,7 +108277,7 @@ async function prepareCredentialUpgrade(deps) {
108104
108277
  }
108105
108278
  }
108106
108279
  async function tryCredentialUpgradeLock(file2) {
108107
- mkdirSync31(path66.dirname(file2), { recursive: true, mode: 448 });
108280
+ mkdirSync31(path67.dirname(file2), { recursive: true, mode: 448 });
108108
108281
  closeSync12(openSync12(file2, "a", 384));
108109
108282
  const child = spawn7("/usr/bin/lockf", ["-k", "-s", "-t", "0", file2, "/bin/sh", "-c", "printf 'ready\\n'; exec /bin/cat >/dev/null"], {
108110
108283
  detached: true,
@@ -108224,21 +108397,28 @@ async function tryCredentialUpgradeLock(file2) {
108224
108397
  // src/menubarApp.ts
108225
108398
  import { existsSync as existsSync21, mkdirSync as mkdirSync32, renameSync as renameSync7, rmSync as rmSync17 } from "node:fs";
108226
108399
  import os31 from "node:os";
108227
- import path67 from "node:path";
108228
- import { spawnSync as spawnSync8 } from "node:child_process";
108400
+ import path68 from "node:path";
108401
+ import { spawnSync as spawnSync9 } from "node:child_process";
108229
108402
  var MENUBAR_APP_ZIP = "dist/menubar/Powerplant.app.zip";
108230
108403
  var MENUBAR_APP_NAME = "Powerplant.app";
108231
108404
  var UNREGISTER_LOGIN_ITEM_FLAG = "--unregister-login-item";
108232
108405
  var UNREGISTER_TIMEOUT_MS = 1e4;
108233
108406
  var FIRST_LAUNCH_ATTEMPT_KEY = "registeredLaunchAtLoginOnFirstLaunch";
108234
108407
  function forgetFirstLaunchAttempt(domain2) {
108235
- const result = spawnSync8("/usr/bin/defaults", ["delete", domain2, FIRST_LAUNCH_ATTEMPT_KEY], { encoding: "utf8", timeout: 1e4 });
108236
- if (result.status === 0) return null;
108237
- const detail = result.error?.message ?? result.stderr.trim();
108238
- return /does not exist|Could not find key|not found/.test(detail) ? null : detail || `exit ${result.status ?? result.signal}`;
108408
+ for (const key of [FIRST_LAUNCH_ATTEMPT_KEY, "launchAtLoginEnabled"]) {
108409
+ const result = spawnSync9("/usr/bin/defaults", ["delete", domain2, key], {
108410
+ encoding: "utf8",
108411
+ timeout: 1e4
108412
+ });
108413
+ if (result.status === 0) continue;
108414
+ const detail = result.error?.message ?? result.stderr.trim();
108415
+ if (!/does not exist|Could not find key|not found/.test(detail))
108416
+ return detail || `exit ${result.status ?? result.signal}`;
108417
+ }
108418
+ return null;
108239
108419
  }
108240
108420
  function menubarAppPaths(homeDir) {
108241
- return [path67.join(homeDir, "Applications", MENUBAR_APP_NAME), path67.join("/Applications", MENUBAR_APP_NAME)];
108421
+ return [path68.join(homeDir, "Applications", MENUBAR_APP_NAME), path68.join("/Applications", MENUBAR_APP_NAME)];
108242
108422
  }
108243
108423
  async function syncMenubarApp(ops, context3) {
108244
108424
  const zip = ops.packagedZip();
@@ -108295,21 +108475,21 @@ function realMenubarAppOps(input2) {
108295
108475
  throw new Error(`the running app at ${appPath} did not quit`);
108296
108476
  },
108297
108477
  replace: (zip, appPath) => {
108298
- const parent = path67.dirname(appPath);
108478
+ const parent = path68.dirname(appPath);
108299
108479
  mkdirSync32(parent, { recursive: true });
108300
- const staging = path67.join(parent, `.${MENUBAR_APP_NAME}.swap-${process.pid}`);
108301
- const retired = path67.join(parent, `.${MENUBAR_APP_NAME}.old-${process.pid}`);
108480
+ const staging = path68.join(parent, `.${MENUBAR_APP_NAME}.swap-${process.pid}`);
108481
+ const retired = path68.join(parent, `.${MENUBAR_APP_NAME}.old-${process.pid}`);
108302
108482
  rmSync17(staging, { recursive: true, force: true });
108303
108483
  rmSync17(retired, { recursive: true, force: true });
108304
108484
  try {
108305
- const extract = spawnSync8("ditto", ["-xk", zip, staging]);
108485
+ const extract = spawnSync9("ditto", ["-xk", zip, staging]);
108306
108486
  if (extract.status !== 0) {
108307
108487
  throw new Error(
108308
108488
  `ditto could not extract ${zip} (${extract.stderr?.toString().trim() || `exit ${extract.status}`})`
108309
108489
  );
108310
108490
  }
108311
- const extracted = path67.join(staging, MENUBAR_APP_NAME);
108312
- if (!existsSync21(path67.join(extracted, "Contents", "Info.plist"))) {
108491
+ const extracted = path68.join(staging, MENUBAR_APP_NAME);
108492
+ if (!existsSync21(path68.join(extracted, "Contents", "Info.plist"))) {
108313
108493
  throw new Error(`${zip} does not contain ${MENUBAR_APP_NAME}`);
108314
108494
  }
108315
108495
  const hadOld = existsSync21(appPath);
@@ -108326,7 +108506,7 @@ function realMenubarAppOps(input2) {
108326
108506
  }
108327
108507
  },
108328
108508
  launch: (appPath) => {
108329
- const result = spawnSync8("open", ["-g", appPath]);
108509
+ const result = spawnSync9("open", ["-g", appPath]);
108330
108510
  if (result.status !== 0) {
108331
108511
  throw new Error(
108332
108512
  `open could not launch ${appPath} (${result.stderr?.toString().trim() || `exit ${result.status}`})`
@@ -108347,7 +108527,7 @@ function removeMenubarApp(appPaths, options) {
108347
108527
  if (Date.now() >= deadline) throw new Error(`the running app at ${appPath} did not quit`);
108348
108528
  Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 250);
108349
108529
  }
108350
- const result = spawnSync8(path67.join(appPath, "Contents", "MacOS", "PowerplantMenubar"), [UNREGISTER_LOGIN_ITEM_FLAG], {
108530
+ const result = spawnSync9(path68.join(appPath, "Contents", "MacOS", "PowerplantMenubar"), [UNREGISTER_LOGIN_ITEM_FLAG], {
108351
108531
  encoding: "utf8",
108352
108532
  timeout: unregisterTimeoutMs
108353
108533
  });
@@ -108360,8 +108540,8 @@ function unregisterFailure(result, timeoutMs) {
108360
108540
  return result.error?.message ?? (result.stderr.trim().split("\n")[0] || `exit ${result.status ?? result.signal}`);
108361
108541
  }
108362
108542
  function appProcessIds(appPath) {
108363
- const executable = path67.join(appPath, "Contents", "MacOS", "PowerplantMenubar");
108364
- const result = spawnSync8("ps", ["-axo", "pid=,comm="], { encoding: "utf8" });
108543
+ const executable = path68.join(appPath, "Contents", "MacOS", "PowerplantMenubar");
108544
+ const result = spawnSync9("ps", ["-axo", "pid=,comm="], { encoding: "utf8" });
108365
108545
  if (result.status !== 0) {
108366
108546
  throw new Error(`ps could not list processes (${result.error?.message ?? `exit ${result.status}`})`);
108367
108547
  }
@@ -108497,18 +108677,18 @@ var workspaceSchema = external_exports.object({
108497
108677
  role: external_exports.string().min(1),
108498
108678
  active: external_exports.boolean()
108499
108679
  });
108500
- var FETCH_TIMEOUT_MS2 = 1e4;
108501
- async function callApi(credentials, path69, init3, fetchImpl) {
108680
+ var FETCH_TIMEOUT_MS3 = 1e4;
108681
+ async function callApi(credentials, path70, init3, fetchImpl) {
108502
108682
  let response;
108503
108683
  try {
108504
- response = await fetchImpl(`${credentials.apiUrl}${path69}`, {
108684
+ response = await fetchImpl(`${credentials.apiUrl}${path70}`, {
108505
108685
  ...init3,
108506
108686
  headers: {
108507
108687
  authorization: `Bearer ${credentials.token}`,
108508
108688
  "content-type": "application/json",
108509
108689
  ...cliVersionHeaders()
108510
108690
  },
108511
- signal: AbortSignal.timeout(FETCH_TIMEOUT_MS2)
108691
+ signal: AbortSignal.timeout(FETCH_TIMEOUT_MS3)
108512
108692
  });
108513
108693
  } catch (error63) {
108514
108694
  const detail = error63 instanceof Error ? error63.message : String(error63);
@@ -108520,7 +108700,7 @@ async function callApi(credentials, path69, init3, fetchImpl) {
108520
108700
  );
108521
108701
  }
108522
108702
  if (!response.ok) {
108523
- throw new ExpectedCliError(`Powerplant answered ${response.status} for ${path69}.`);
108703
+ throw new ExpectedCliError(`Powerplant answered ${response.status} for ${path70}.`);
108524
108704
  }
108525
108705
  return response.json();
108526
108706
  }
@@ -108600,7 +108780,8 @@ Commands:
108600
108780
  enroll (Re-)enroll this machine into your org (browser approval).
108601
108781
  status What the background sync is doing on this machine (--json for tools).
108602
108782
  doctor A diagnostics summary for support: status plus the redacted
108603
- tail of the background sync log. Prints only, nothing is uploaded.
108783
+ tail of the background sync log. Nothing is uploaded.
108784
+ --repair-menu-startup enables the Mac menu at login.
108604
108785
  Paste the output into your email to support@usepowerplant.com.
108605
108786
  update Update this CLI to the latest published version, using the
108606
108787
  package manager that installed it, and restart background sync.
@@ -108665,6 +108846,7 @@ function parseCliArgs() {
108665
108846
  "dry-run": { type: "boolean", default: false },
108666
108847
  json: { type: "boolean", default: false },
108667
108848
  forget: { type: "boolean", default: false },
108849
+ "repair-menu-startup": { type: "boolean", default: false },
108668
108850
  // Internal: connect reports unfinished login as failure to the menu.
108669
108851
  // For update, hands the update to a
108670
108852
  // detached copy of this command so the app's verb deadline can't kill
@@ -108714,6 +108896,9 @@ ${USAGE}`);
108714
108896
  }
108715
108897
  const command = positionals[0];
108716
108898
  cliCommand = command ?? "none";
108899
+ if (values["repair-menu-startup"] && command !== "doctor") {
108900
+ throw new ExpectedCliError("Use powerplant doctor --repair-menu-startup to enable menu startup.");
108901
+ }
108717
108902
  if (values.help || command === void 0 || command === "help") {
108718
108903
  console.log(USAGE);
108719
108904
  return;
@@ -108792,7 +108977,7 @@ ${USAGE}`);
108792
108977
  changed = true;
108793
108978
  },
108794
108979
  startingNextWorker: () => describeDaemonState(readCollectorStatus(config2.appEnv)).state === "restarting",
108795
- tryLock: () => tryCredentialUpgradeLock(path68.join(collectorStateDir(), `credential-upgrade-${config2.appEnv}.lock`)),
108980
+ tryLock: () => tryCredentialUpgradeLock(path69.join(collectorStateDir(), `credential-upgrade-${config2.appEnv}.lock`)),
108796
108981
  now: Date.now,
108797
108982
  sleep: () => new Promise((resolve2) => setTimeout(resolve2, 250)),
108798
108983
  savesCredentials: command !== "menu",
@@ -109046,8 +109231,9 @@ The access you granted these agents stays on your Powerplant account until you r
109046
109231
  const service2 = readServiceSafelyAsync(copy.service);
109047
109232
  const stored = loadCredentialsSafely(config2);
109048
109233
  const credentials = stored.credentials;
109049
- const [[latestVersion, oldestSupportedVersion], protectedSessions, serviceRead, moving] = await Promise.all([
109234
+ const [[latestVersion, oldestSupportedVersion], sessionVisibility, protectedSessions, serviceRead, moving] = await Promise.all([
109050
109235
  fetchVersionFacts(config2.appEnv, credentials, CLI_PACKAGE_NAME),
109236
+ readSessionVisibilityLine(credentials),
109051
109237
  process.platform === "darwin" && credentials ? findRecentProtectedSessions({
109052
109238
  environment: { allowedProtectedRoots: credentials.repoDiscoveryRoots ?? [] }
109053
109239
  }).then(
@@ -109056,7 +109242,7 @@ The access you granted these agents stays on your Powerplant account until you r
109056
109242
  service2,
109057
109243
  moveToInstalledCopy(config2, copy)
109058
109244
  ]);
109059
- return { stored, latestVersion, oldestSupportedVersion, protectedSessions, serviceRead, moving };
109245
+ return { stored, latestVersion, oldestSupportedVersion, sessionVisibility, protectedSessions, serviceRead, moving };
109060
109246
  };
109061
109247
  const found = values.json ? await read2() : await terminal.command.activity("Checking sync status\u2026", read2);
109062
109248
  const inputs = {
@@ -109071,6 +109257,7 @@ The access you granted these agents stays on your Powerplant account until you r
109071
109257
  oldestSupportedVersion: found.oldestSupportedVersion,
109072
109258
  protectedSessions: found.protectedSessions,
109073
109259
  moveToInstalledCopy: found.moving,
109260
+ sessionVisibility: found.sessionVisibility,
109074
109261
  connections: readHarnessConnections(config2.appEnv, realReadTextFile),
109075
109262
  ...readMcpPreferencesForMenu(config2.appEnv),
109076
109263
  now: Date.now()
@@ -109080,33 +109267,19 @@ The access you granted these agents stays on your Powerplant account until you r
109080
109267
  return;
109081
109268
  }
109082
109269
  case "doctor": {
109083
- const found = await terminal.command.activity("Collecting diagnostics\u2026", async () => {
109084
- const service2 = readServiceSafelyAsync(copy.service);
109085
- const stored = loadCredentialsSafely(config2);
109086
- const [[latestVersion, oldestSupportedVersion], serviceRead] = await Promise.all([
109087
- fetchVersionFacts(config2.appEnv, stored.credentials, CLI_PACKAGE_NAME),
109088
- service2
109089
- ]);
109090
- return { stored, latestVersion, oldestSupportedVersion, serviceRead };
109270
+ const result = await runDoctor({
109271
+ config: config2,
109272
+ repairMenuStartup: values["repair-menu-startup"],
109273
+ menuStartupSupported: managesMenubarApp(config2),
109274
+ activity: terminal.command.activity,
109275
+ readService: () => readServiceSafelyAsync(copy.service),
109276
+ readCredentials: () => loadCredentialsSafely(config2),
109277
+ readCredentialStore: () => readCredentialStoreSafely(config2),
109278
+ inspectInstall: () => inspectThisInstall(copy),
109279
+ installedApp: () => menubarAppOps(copy).installedApp()
109091
109280
  });
109092
- console.log(
109093
- renderDoctorReport({
109094
- config: config2,
109095
- cliVersion: CLI_VERSION,
109096
- latestVersion: found.latestVersion,
109097
- oldestSupportedVersion: found.oldestSupportedVersion,
109098
- nodeVersion: process.version,
109099
- platform: `${process.platform} ${process.arch}`,
109100
- install: inspectThisInstall(copy),
109101
- ...found.stored,
109102
- ...found.serviceRead,
109103
- ...readCredentialStoreSafely(config2),
109104
- daemon: describeDaemonState(readCollectorStatus(config2.appEnv)),
109105
- control: readCollectorControl(config2.appEnv),
109106
- logTail: readDoctorLogTail(serviceLogPath2(config2.appEnv)),
109107
- now: Date.now()
109108
- }).join("\n")
109109
- );
109281
+ process.exitCode = result.exitCode;
109282
+ console.log(result.lines.join("\n"));
109110
109283
  return;
109111
109284
  }
109112
109285
  // Deliberately absent from USAGE until the menu-bar app ships — the
@@ -109481,7 +109654,7 @@ function tarballOption(tarball, sha2562) {
109481
109654
  if (sha2562 === void 0 || !/^[0-9a-f]{64}$/.test(sha2562)) {
109482
109655
  throw new ExpectedCliError("--tarball needs --sha256 with the package's SHA-256 in lowercase hex.");
109483
109656
  }
109484
- return { file: path68.resolve(tarball), sha256: sha2562 };
109657
+ return { file: path69.resolve(tarball), sha256: sha2562 };
109485
109658
  }
109486
109659
  function thisPowerplant() {
109487
109660
  return thisPowerplantCommand(entryPath);
@@ -109519,7 +109692,7 @@ function backgroundUpdateDeps(config2, copy, target, tarball = null) {
109519
109692
  readProgress: updateProgress.read,
109520
109693
  writeProgress: updateProgress.write,
109521
109694
  spawnChild: () => {
109522
- mkdirSync33(path68.dirname(updateLogPath()), { recursive: true });
109695
+ mkdirSync33(path69.dirname(updateLogPath()), { recursive: true });
109523
109696
  const log3 = openSync13(updateLogPath(), "a");
109524
109697
  const child = spawn8(...spawnArguments(thisPowerplant(), ["update", ...envArgsFor(config2), ...tarballArgs]), {
109525
109698
  detached: true,
@@ -109577,7 +109750,7 @@ function managesMenubarApp(config2) {
109577
109750
  function menubarAppOps(copy) {
109578
109751
  if (copy.kind === "installed") return realMenubarAppOps({ cliVersion: CLI_VERSION, zip: copy.menubarAppZip() });
109579
109752
  const { packageDir } = inspectThisInstall(copy);
109580
- return realMenubarAppOps({ cliVersion: CLI_VERSION, zip: packageDir === null ? null : path68.join(packageDir, MENUBAR_APP_ZIP) });
109753
+ return realMenubarAppOps({ cliVersion: CLI_VERSION, zip: packageDir === null ? null : path69.join(packageDir, MENUBAR_APP_ZIP) });
109581
109754
  }
109582
109755
  function moveSyncTo(service, config2, command) {
109583
109756
  const state = serviceState2(service);
@@ -109591,7 +109764,7 @@ async function moveToInstalledCopy(config2, copy) {
109591
109764
  const { installAvailable } = copy;
109592
109765
  const available = await cachedLatestVersion({
109593
109766
  now: Date.now(),
109594
- cacheFile: path68.join(collectorStateDir(), `installed-copy-release-${config2.appEnv}.json`),
109767
+ cacheFile: path69.join(collectorStateDir(), `installed-copy-release-${config2.appEnv}.json`),
109595
109768
  readTextFile: realReadTextFile,
109596
109769
  writeTextFile: realWriteTextFile,
109597
109770
  fetchLatest: () => installAvailable().then((yes) => yes ? "available" : null)
@@ -109682,4 +109855,4 @@ undici/lib/web/websocket/frame.js:
109682
109855
  (*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
109683
109856
  */
109684
109857
 
109685
- //# debugId=4a7f0d72-480c-5c4a-9ad7-eecd1b852192
109858
+ //# debugId=e21c9e8f-a5a6-561f-b7c6-99dd92ba2436