@usepowerplant/cli 0.4.13 → 0.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +519 -362
- package/dist/menubar/Powerplant.app.zip +0 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
!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]="
|
|
3
|
+
!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]="81d65aee-a279-58bd-9476-cc1269e40adf")}catch(e){}}();
|
|
4
4
|
const __cliNodeMajor = Number(process.versions.node.split('.')[0]);
|
|
5
5
|
if (__cliNodeMajor < 20) {
|
|
6
6
|
console.error(`powerplant needs Node 20 or newer — this is Node ${process.versions.node}.`);
|
|
@@ -6879,19 +6879,19 @@ var require_module_details_from_path = __commonJS({
|
|
|
6879
6879
|
basedir += segments[i] + sep2;
|
|
6880
6880
|
}
|
|
6881
6881
|
}
|
|
6882
|
-
var
|
|
6882
|
+
var path33 = "";
|
|
6883
6883
|
var lastSegmentIndex = segments.length - 1;
|
|
6884
6884
|
for (var i2 = index + offset; i2 <= lastSegmentIndex; i2++) {
|
|
6885
6885
|
if (i2 === lastSegmentIndex) {
|
|
6886
|
-
|
|
6886
|
+
path33 += segments[i2];
|
|
6887
6887
|
} else {
|
|
6888
|
-
|
|
6888
|
+
path33 += segments[i2] + sep2;
|
|
6889
6889
|
}
|
|
6890
6890
|
}
|
|
6891
6891
|
return {
|
|
6892
6892
|
name,
|
|
6893
6893
|
basedir,
|
|
6894
|
-
path:
|
|
6894
|
+
path: path33
|
|
6895
6895
|
};
|
|
6896
6896
|
};
|
|
6897
6897
|
}
|
|
@@ -6901,7 +6901,7 @@ var require_module_details_from_path = __commonJS({
|
|
|
6901
6901
|
var require_require_in_the_middle = __commonJS({
|
|
6902
6902
|
"../../node_modules/.pnpm/require-in-the-middle@8.0.1/node_modules/require-in-the-middle/index.js"(exports, module2) {
|
|
6903
6903
|
"use strict";
|
|
6904
|
-
var
|
|
6904
|
+
var path33 = __require("path");
|
|
6905
6905
|
var Module = __require("module");
|
|
6906
6906
|
var debug2 = require_src3()("require-in-the-middle");
|
|
6907
6907
|
var moduleDetailsFromPath = require_module_details_from_path();
|
|
@@ -7046,7 +7046,7 @@ var require_require_in_the_middle = __commonJS({
|
|
|
7046
7046
|
}
|
|
7047
7047
|
moduleName = filename;
|
|
7048
7048
|
} else if (hasWhitelist === true && modules.includes(filename)) {
|
|
7049
|
-
const parsedPath =
|
|
7049
|
+
const parsedPath = path33.parse(filename);
|
|
7050
7050
|
moduleName = parsedPath.name;
|
|
7051
7051
|
basedir = parsedPath.dir;
|
|
7052
7052
|
} else {
|
|
@@ -7084,7 +7084,7 @@ var require_require_in_the_middle = __commonJS({
|
|
|
7084
7084
|
}
|
|
7085
7085
|
if (res !== filename) {
|
|
7086
7086
|
if (internals === true) {
|
|
7087
|
-
moduleName = moduleName +
|
|
7087
|
+
moduleName = moduleName + path33.sep + path33.relative(basedir, filename);
|
|
7088
7088
|
debug2("preparing to process require of internal file: %s", moduleName);
|
|
7089
7089
|
} else {
|
|
7090
7090
|
debug2("ignoring require of non-main module file: %s", res);
|
|
@@ -7120,8 +7120,8 @@ var require_require_in_the_middle = __commonJS({
|
|
|
7120
7120
|
}
|
|
7121
7121
|
};
|
|
7122
7122
|
function resolveModuleName(stat) {
|
|
7123
|
-
const normalizedPath =
|
|
7124
|
-
return
|
|
7123
|
+
const normalizedPath = path33.sep !== "/" ? stat.path.split(path33.sep).join("/") : stat.path;
|
|
7124
|
+
return path33.posix.join(stat.name, normalizedPath).replace(normalize3, "");
|
|
7125
7125
|
}
|
|
7126
7126
|
}
|
|
7127
7127
|
});
|
|
@@ -7206,7 +7206,7 @@ var require_RequireInTheMiddleSingleton = __commonJS({
|
|
|
7206
7206
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7207
7207
|
exports.RequireInTheMiddleSingleton = void 0;
|
|
7208
7208
|
var require_in_the_middle_1 = require_require_in_the_middle();
|
|
7209
|
-
var
|
|
7209
|
+
var path33 = __require("path");
|
|
7210
7210
|
var ModuleNameTrie_1 = require_ModuleNameTrie();
|
|
7211
7211
|
var isMocha = [
|
|
7212
7212
|
"afterEach",
|
|
@@ -7270,7 +7270,7 @@ var require_RequireInTheMiddleSingleton = __commonJS({
|
|
|
7270
7270
|
};
|
|
7271
7271
|
exports.RequireInTheMiddleSingleton = RequireInTheMiddleSingleton;
|
|
7272
7272
|
function normalizePathSeparators(moduleNameOrPath) {
|
|
7273
|
-
return
|
|
7273
|
+
return path33.sep !== ModuleNameTrie_1.ModuleNameSeparator ? moduleNameOrPath.split(path33.sep).join(ModuleNameTrie_1.ModuleNameSeparator) : moduleNameOrPath;
|
|
7274
7274
|
}
|
|
7275
7275
|
}
|
|
7276
7276
|
});
|
|
@@ -7480,7 +7480,7 @@ var require_register = __commonJS({
|
|
|
7480
7480
|
// ../../node_modules/.pnpm/import-in-the-middle@3.5.1/node_modules/import-in-the-middle/index.js
|
|
7481
7481
|
var require_import_in_the_middle = __commonJS({
|
|
7482
7482
|
"../../node_modules/.pnpm/import-in-the-middle@3.5.1/node_modules/import-in-the-middle/index.js"(exports, module2) {
|
|
7483
|
-
var
|
|
7483
|
+
var path33 = __require("path");
|
|
7484
7484
|
var moduleDetailsFromPath = require_module_details_from_path();
|
|
7485
7485
|
var { fileURLToPath: fileURLToPath3 } = __require("url");
|
|
7486
7486
|
var { MessageChannel } = __require("worker_threads");
|
|
@@ -7599,7 +7599,7 @@ var require_import_in_the_middle = __commonJS({
|
|
|
7599
7599
|
} else if (baseDir.endsWith(specifiers.get(loadUrl)) || isTurbopackSpecifier(specifiers.get(loadUrl), baseDir)) {
|
|
7600
7600
|
callHookFn(hookFn, namespace, name, baseDir);
|
|
7601
7601
|
} else if (internals) {
|
|
7602
|
-
const internalPath = name +
|
|
7602
|
+
const internalPath = name + path33.sep + path33.relative(baseDir, filePath);
|
|
7603
7603
|
callHookFn(hookFn, namespace, internalPath, baseDir);
|
|
7604
7604
|
}
|
|
7605
7605
|
} else if (matchArg === specifier) {
|
|
@@ -7674,7 +7674,7 @@ var require_instrumentation2 = __commonJS({
|
|
|
7674
7674
|
"use strict";
|
|
7675
7675
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7676
7676
|
exports.InstrumentationBase = void 0;
|
|
7677
|
-
var
|
|
7677
|
+
var path33 = __require("path");
|
|
7678
7678
|
var util_1 = __require("util");
|
|
7679
7679
|
var semver_1 = require_semver();
|
|
7680
7680
|
var shimmer_1 = require_shimmer();
|
|
@@ -7775,7 +7775,7 @@ var require_instrumentation2 = __commonJS({
|
|
|
7775
7775
|
}
|
|
7776
7776
|
_extractPackageVersion(baseDir) {
|
|
7777
7777
|
try {
|
|
7778
|
-
const json2 = (0, fs_1.readFileSync)(
|
|
7778
|
+
const json2 = (0, fs_1.readFileSync)(path33.join(baseDir, "package.json"), {
|
|
7779
7779
|
encoding: "utf8"
|
|
7780
7780
|
});
|
|
7781
7781
|
const version2 = JSON.parse(json2).version;
|
|
@@ -7817,7 +7817,7 @@ var require_instrumentation2 = __commonJS({
|
|
|
7817
7817
|
return exports2;
|
|
7818
7818
|
}
|
|
7819
7819
|
const files = module3.files ?? [];
|
|
7820
|
-
const normalizedName =
|
|
7820
|
+
const normalizedName = path33.normalize(name);
|
|
7821
7821
|
const supportedFileInstrumentations = files.filter((f) => f.name === normalizedName && isSupported(f.supportedVersions, version2, module3.includePrerelease));
|
|
7822
7822
|
return supportedFileInstrumentations.reduce((patchedExports, file2) => {
|
|
7823
7823
|
file2.moduleExports = patchedExports;
|
|
@@ -7863,8 +7863,8 @@ var require_instrumentation2 = __commonJS({
|
|
|
7863
7863
|
this._warnOnPreloadedModules();
|
|
7864
7864
|
for (const module3 of this._modules) {
|
|
7865
7865
|
const hookFn = (exports2, name, baseDir) => {
|
|
7866
|
-
if (!baseDir &&
|
|
7867
|
-
const parsedPath =
|
|
7866
|
+
if (!baseDir && path33.isAbsolute(name)) {
|
|
7867
|
+
const parsedPath = path33.parse(name);
|
|
7868
7868
|
name = parsedPath.name;
|
|
7869
7869
|
baseDir = parsedPath.dir;
|
|
7870
7870
|
}
|
|
@@ -7873,7 +7873,7 @@ var require_instrumentation2 = __commonJS({
|
|
|
7873
7873
|
const onRequire = (exports2, name, baseDir) => {
|
|
7874
7874
|
return this._onRequire(module3, exports2, name, baseDir);
|
|
7875
7875
|
};
|
|
7876
|
-
const hook =
|
|
7876
|
+
const hook = path33.isAbsolute(module3.name) ? new require_in_the_middle_1.Hook([module3.name], { internals: true }, onRequire) : this._requireInTheMiddleSingleton.register(module3.name, onRequire);
|
|
7877
7877
|
this._hooks.push(hook);
|
|
7878
7878
|
const esmHook = new import_in_the_middle_1.Hook([module3.name], { internals: true }, hookFn);
|
|
7879
7879
|
this._hooks.push(esmHook);
|
|
@@ -8481,9 +8481,9 @@ var require_getMachineId_linux = __commonJS({
|
|
|
8481
8481
|
var api_1 = (init_esm(), __toCommonJS(esm_exports));
|
|
8482
8482
|
async function getMachineId() {
|
|
8483
8483
|
const paths = ["/etc/machine-id", "/var/lib/dbus/machine-id"];
|
|
8484
|
-
for (const
|
|
8484
|
+
for (const path33 of paths) {
|
|
8485
8485
|
try {
|
|
8486
|
-
const result = await fs_1.promises.readFile(
|
|
8486
|
+
const result = await fs_1.promises.readFile(path33, { encoding: "utf8" });
|
|
8487
8487
|
return result.trim();
|
|
8488
8488
|
} catch (e) {
|
|
8489
8489
|
api_1.diag.debug(`error reading machine id: ${e}`);
|
|
@@ -11843,14 +11843,14 @@ var require_util = __commonJS({
|
|
|
11843
11843
|
}
|
|
11844
11844
|
const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
|
|
11845
11845
|
let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`;
|
|
11846
|
-
let
|
|
11846
|
+
let path33 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
|
|
11847
11847
|
if (origin[origin.length - 1] === "/") {
|
|
11848
11848
|
origin = origin.slice(0, origin.length - 1);
|
|
11849
11849
|
}
|
|
11850
|
-
if (
|
|
11851
|
-
|
|
11850
|
+
if (path33 && path33[0] !== "/") {
|
|
11851
|
+
path33 = `/${path33}`;
|
|
11852
11852
|
}
|
|
11853
|
-
return new URL(`${origin}${
|
|
11853
|
+
return new URL(`${origin}${path33}`);
|
|
11854
11854
|
}
|
|
11855
11855
|
if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) {
|
|
11856
11856
|
throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
@@ -12671,9 +12671,9 @@ var require_diagnostics = __commonJS({
|
|
|
12671
12671
|
"undici:client:sendHeaders",
|
|
12672
12672
|
(evt) => {
|
|
12673
12673
|
const {
|
|
12674
|
-
request: { method, path:
|
|
12674
|
+
request: { method, path: path33, origin }
|
|
12675
12675
|
} = evt;
|
|
12676
|
-
debugLog3("sending request to %s %s%s", method, origin,
|
|
12676
|
+
debugLog3("sending request to %s %s%s", method, origin, path33);
|
|
12677
12677
|
}
|
|
12678
12678
|
);
|
|
12679
12679
|
}
|
|
@@ -12691,14 +12691,14 @@ var require_diagnostics = __commonJS({
|
|
|
12691
12691
|
"undici:request:headers",
|
|
12692
12692
|
(evt) => {
|
|
12693
12693
|
const {
|
|
12694
|
-
request: { method, path:
|
|
12694
|
+
request: { method, path: path33, origin },
|
|
12695
12695
|
response: { statusCode }
|
|
12696
12696
|
} = evt;
|
|
12697
12697
|
debugLog3(
|
|
12698
12698
|
"received response to %s %s%s - HTTP %d",
|
|
12699
12699
|
method,
|
|
12700
12700
|
origin,
|
|
12701
|
-
|
|
12701
|
+
path33,
|
|
12702
12702
|
statusCode
|
|
12703
12703
|
);
|
|
12704
12704
|
}
|
|
@@ -12707,23 +12707,23 @@ var require_diagnostics = __commonJS({
|
|
|
12707
12707
|
"undici:request:trailers",
|
|
12708
12708
|
(evt) => {
|
|
12709
12709
|
const {
|
|
12710
|
-
request: { method, path:
|
|
12710
|
+
request: { method, path: path33, origin }
|
|
12711
12711
|
} = evt;
|
|
12712
|
-
debugLog3("trailers received from %s %s%s", method, origin,
|
|
12712
|
+
debugLog3("trailers received from %s %s%s", method, origin, path33);
|
|
12713
12713
|
}
|
|
12714
12714
|
);
|
|
12715
12715
|
diagnosticsChannel9.subscribe(
|
|
12716
12716
|
"undici:request:error",
|
|
12717
12717
|
(evt) => {
|
|
12718
12718
|
const {
|
|
12719
|
-
request: { method, path:
|
|
12719
|
+
request: { method, path: path33, origin },
|
|
12720
12720
|
error: error63
|
|
12721
12721
|
} = evt;
|
|
12722
12722
|
debugLog3(
|
|
12723
12723
|
"request to %s %s%s errored - %s",
|
|
12724
12724
|
method,
|
|
12725
12725
|
origin,
|
|
12726
|
-
|
|
12726
|
+
path33,
|
|
12727
12727
|
error63.message
|
|
12728
12728
|
);
|
|
12729
12729
|
}
|
|
@@ -12838,7 +12838,7 @@ var require_request = __commonJS({
|
|
|
12838
12838
|
var kHandler = /* @__PURE__ */ Symbol("handler");
|
|
12839
12839
|
var Request2 = class {
|
|
12840
12840
|
constructor(origin, {
|
|
12841
|
-
path:
|
|
12841
|
+
path: path33,
|
|
12842
12842
|
method,
|
|
12843
12843
|
body,
|
|
12844
12844
|
headers,
|
|
@@ -12855,11 +12855,11 @@ var require_request = __commonJS({
|
|
|
12855
12855
|
maxRedirections,
|
|
12856
12856
|
typeOfService
|
|
12857
12857
|
}, handler) {
|
|
12858
|
-
if (typeof
|
|
12858
|
+
if (typeof path33 !== "string") {
|
|
12859
12859
|
throw new InvalidArgumentError("path must be a string");
|
|
12860
|
-
} else if (
|
|
12860
|
+
} else if (path33[0] !== "/" && !(path33.startsWith("http://") || path33.startsWith("https://")) && method !== "CONNECT") {
|
|
12861
12861
|
throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
|
|
12862
|
-
} else if (invalidPathRegex.test(
|
|
12862
|
+
} else if (invalidPathRegex.test(path33)) {
|
|
12863
12863
|
throw new InvalidArgumentError("invalid request path");
|
|
12864
12864
|
}
|
|
12865
12865
|
if (typeof method !== "string") {
|
|
@@ -12934,7 +12934,7 @@ var require_request = __commonJS({
|
|
|
12934
12934
|
this.completed = false;
|
|
12935
12935
|
this.aborted = false;
|
|
12936
12936
|
this.upgrade = upgrade || null;
|
|
12937
|
-
this.path = query ? serializePathWithQuery(
|
|
12937
|
+
this.path = query ? serializePathWithQuery(path33, query) : path33;
|
|
12938
12938
|
this.origin = origin;
|
|
12939
12939
|
this.protocol = getProtocolFromUrlString(origin);
|
|
12940
12940
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
@@ -18116,7 +18116,7 @@ var require_client_h1 = __commonJS({
|
|
|
18116
18116
|
return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
|
|
18117
18117
|
}
|
|
18118
18118
|
function writeH1(client, request2) {
|
|
18119
|
-
const { method, path:
|
|
18119
|
+
const { method, path: path33, host, upgrade, blocking, reset } = request2;
|
|
18120
18120
|
let { body, headers, contentLength } = request2;
|
|
18121
18121
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
18122
18122
|
if (util2.isFormDataLike(body)) {
|
|
@@ -18194,7 +18194,7 @@ var require_client_h1 = __commonJS({
|
|
|
18194
18194
|
if (socket.setTypeOfService) {
|
|
18195
18195
|
socket.setTypeOfService(request2.typeOfService);
|
|
18196
18196
|
}
|
|
18197
|
-
let header = `${method} ${
|
|
18197
|
+
let header = `${method} ${path33} HTTP/1.1\r
|
|
18198
18198
|
`;
|
|
18199
18199
|
if (typeof host === "string") {
|
|
18200
18200
|
header += `host: ${host}\r
|
|
@@ -18873,7 +18873,7 @@ var require_client_h2 = __commonJS({
|
|
|
18873
18873
|
const headersTimeout = request2.headersTimeout ?? client[kHeadersTimeout];
|
|
18874
18874
|
const bodyTimeout = request2.bodyTimeout ?? client[kBodyTimeout];
|
|
18875
18875
|
const session = client[kHTTP2Session];
|
|
18876
|
-
const { method, path:
|
|
18876
|
+
const { method, path: path33, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request2;
|
|
18877
18877
|
let { body } = request2;
|
|
18878
18878
|
if (upgrade != null && upgrade !== "websocket") {
|
|
18879
18879
|
util2.errorRequest(client, request2, new InvalidArgumentError(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
|
|
@@ -18942,7 +18942,7 @@ var require_client_h2 = __commonJS({
|
|
|
18942
18942
|
}
|
|
18943
18943
|
headers[HTTP2_HEADER_METHOD] = "CONNECT";
|
|
18944
18944
|
headers[HTTP2_HEADER_PROTOCOL] = "websocket";
|
|
18945
|
-
headers[HTTP2_HEADER_PATH] =
|
|
18945
|
+
headers[HTTP2_HEADER_PATH] = path33;
|
|
18946
18946
|
if (protocol === "ws:" || protocol === "wss:") {
|
|
18947
18947
|
headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
|
|
18948
18948
|
} else {
|
|
@@ -18984,7 +18984,7 @@ var require_client_h2 = __commonJS({
|
|
|
18984
18984
|
stream.setTimeout(headersTimeout);
|
|
18985
18985
|
return true;
|
|
18986
18986
|
}
|
|
18987
|
-
headers[HTTP2_HEADER_PATH] =
|
|
18987
|
+
headers[HTTP2_HEADER_PATH] = path33;
|
|
18988
18988
|
headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
|
|
18989
18989
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
18990
18990
|
if (body && typeof body.read === "function") {
|
|
@@ -21336,10 +21336,10 @@ var require_proxy_agent = __commonJS({
|
|
|
21336
21336
|
};
|
|
21337
21337
|
const {
|
|
21338
21338
|
origin,
|
|
21339
|
-
path:
|
|
21339
|
+
path: path33 = "/",
|
|
21340
21340
|
headers = {}
|
|
21341
21341
|
} = opts;
|
|
21342
|
-
opts.path = origin +
|
|
21342
|
+
opts.path = origin + path33;
|
|
21343
21343
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
21344
21344
|
const { host } = new URL(origin);
|
|
21345
21345
|
headers.host = host;
|
|
@@ -23448,20 +23448,20 @@ var require_mock_utils = __commonJS({
|
|
|
23448
23448
|
}
|
|
23449
23449
|
return normalizedQp;
|
|
23450
23450
|
}
|
|
23451
|
-
function safeUrl(
|
|
23452
|
-
if (typeof
|
|
23453
|
-
return
|
|
23451
|
+
function safeUrl(path33) {
|
|
23452
|
+
if (typeof path33 !== "string") {
|
|
23453
|
+
return path33;
|
|
23454
23454
|
}
|
|
23455
|
-
const pathSegments =
|
|
23455
|
+
const pathSegments = path33.split("?", 3);
|
|
23456
23456
|
if (pathSegments.length !== 2) {
|
|
23457
|
-
return
|
|
23457
|
+
return path33;
|
|
23458
23458
|
}
|
|
23459
23459
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
23460
23460
|
qp.sort();
|
|
23461
23461
|
return [...pathSegments, qp.toString()].join("?");
|
|
23462
23462
|
}
|
|
23463
|
-
function matchKey(mockDispatch2, { path:
|
|
23464
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
23463
|
+
function matchKey(mockDispatch2, { path: path33, method, body, headers }) {
|
|
23464
|
+
const pathMatch = matchValue(mockDispatch2.path, path33);
|
|
23465
23465
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
23466
23466
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
23467
23467
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -23486,8 +23486,8 @@ var require_mock_utils = __commonJS({
|
|
|
23486
23486
|
const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
|
|
23487
23487
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
23488
23488
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
|
|
23489
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
23490
|
-
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(
|
|
23489
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path33, ignoreTrailingSlash }) => {
|
|
23490
|
+
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path33)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path33), resolvedPath);
|
|
23491
23491
|
});
|
|
23492
23492
|
if (matchedMockDispatches.length === 0) {
|
|
23493
23493
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
@@ -23526,19 +23526,19 @@ var require_mock_utils = __commonJS({
|
|
|
23526
23526
|
mockDispatches.splice(index, 1);
|
|
23527
23527
|
}
|
|
23528
23528
|
}
|
|
23529
|
-
function removeTrailingSlash(
|
|
23530
|
-
while (
|
|
23531
|
-
|
|
23529
|
+
function removeTrailingSlash(path33) {
|
|
23530
|
+
while (path33.endsWith("/")) {
|
|
23531
|
+
path33 = path33.slice(0, -1);
|
|
23532
23532
|
}
|
|
23533
|
-
if (
|
|
23534
|
-
|
|
23533
|
+
if (path33.length === 0) {
|
|
23534
|
+
path33 = "/";
|
|
23535
23535
|
}
|
|
23536
|
-
return
|
|
23536
|
+
return path33;
|
|
23537
23537
|
}
|
|
23538
23538
|
function buildKey(opts) {
|
|
23539
|
-
const { path:
|
|
23539
|
+
const { path: path33, method, body, headers, query } = opts;
|
|
23540
23540
|
return {
|
|
23541
|
-
path:
|
|
23541
|
+
path: path33,
|
|
23542
23542
|
method,
|
|
23543
23543
|
body,
|
|
23544
23544
|
headers,
|
|
@@ -24228,10 +24228,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
24228
24228
|
}
|
|
24229
24229
|
format(pendingInterceptors) {
|
|
24230
24230
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
24231
|
-
({ method, path:
|
|
24231
|
+
({ method, path: path33, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
|
|
24232
24232
|
Method: method,
|
|
24233
24233
|
Origin: origin,
|
|
24234
|
-
Path:
|
|
24234
|
+
Path: path33,
|
|
24235
24235
|
"Status code": statusCode,
|
|
24236
24236
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
24237
24237
|
Invocations: timesInvoked,
|
|
@@ -24313,9 +24313,9 @@ var require_mock_agent = __commonJS({
|
|
|
24313
24313
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
24314
24314
|
const dispatchOpts = { ...opts };
|
|
24315
24315
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
24316
|
-
const [
|
|
24316
|
+
const [path33, searchParams] = dispatchOpts.path.split("?");
|
|
24317
24317
|
const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
|
|
24318
|
-
dispatchOpts.path = `${
|
|
24318
|
+
dispatchOpts.path = `${path33}?${normalizedSearchParams}`;
|
|
24319
24319
|
}
|
|
24320
24320
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
24321
24321
|
}
|
|
@@ -24716,12 +24716,12 @@ var require_snapshot_recorder = __commonJS({
|
|
|
24716
24716
|
* @return {Promise<void>} - Resolves when snapshots are loaded
|
|
24717
24717
|
*/
|
|
24718
24718
|
async loadSnapshots(filePath) {
|
|
24719
|
-
const
|
|
24720
|
-
if (!
|
|
24719
|
+
const path33 = filePath || this.#snapshotPath;
|
|
24720
|
+
if (!path33) {
|
|
24721
24721
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
24722
24722
|
}
|
|
24723
24723
|
try {
|
|
24724
|
-
const data = await readFile3(resolve2(
|
|
24724
|
+
const data = await readFile3(resolve2(path33), "utf8");
|
|
24725
24725
|
const parsed = JSON.parse(data);
|
|
24726
24726
|
if (Array.isArray(parsed)) {
|
|
24727
24727
|
this.#snapshots.clear();
|
|
@@ -24735,7 +24735,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
24735
24735
|
if (error63.code === "ENOENT") {
|
|
24736
24736
|
this.#snapshots.clear();
|
|
24737
24737
|
} else {
|
|
24738
|
-
throw new UndiciError(`Failed to load snapshots from ${
|
|
24738
|
+
throw new UndiciError(`Failed to load snapshots from ${path33}`, { cause: error63 });
|
|
24739
24739
|
}
|
|
24740
24740
|
}
|
|
24741
24741
|
}
|
|
@@ -24746,11 +24746,11 @@ var require_snapshot_recorder = __commonJS({
|
|
|
24746
24746
|
* @returns {Promise<void>} - Resolves when snapshots are saved
|
|
24747
24747
|
*/
|
|
24748
24748
|
async saveSnapshots(filePath) {
|
|
24749
|
-
const
|
|
24750
|
-
if (!
|
|
24749
|
+
const path33 = filePath || this.#snapshotPath;
|
|
24750
|
+
if (!path33) {
|
|
24751
24751
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
24752
24752
|
}
|
|
24753
|
-
const resolvedPath = resolve2(
|
|
24753
|
+
const resolvedPath = resolve2(path33);
|
|
24754
24754
|
await mkdir(dirname2(resolvedPath), { recursive: true });
|
|
24755
24755
|
const data = Array.from(this.#snapshots.entries()).map(([hash2, snapshot]) => ({
|
|
24756
24756
|
hash: hash2,
|
|
@@ -25382,15 +25382,15 @@ var require_redirect_handler = __commonJS({
|
|
|
25382
25382
|
return;
|
|
25383
25383
|
}
|
|
25384
25384
|
const { origin, pathname, search } = util2.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
25385
|
-
const
|
|
25386
|
-
const redirectUrlString = `${origin}${
|
|
25385
|
+
const path33 = search ? `${pathname}${search}` : pathname;
|
|
25386
|
+
const redirectUrlString = `${origin}${path33}`;
|
|
25387
25387
|
for (const historyUrl of this.history) {
|
|
25388
25388
|
if (historyUrl.toString() === redirectUrlString) {
|
|
25389
25389
|
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.`);
|
|
25390
25390
|
}
|
|
25391
25391
|
}
|
|
25392
25392
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
25393
|
-
this.opts.path =
|
|
25393
|
+
this.opts.path = path33;
|
|
25394
25394
|
this.opts.origin = origin;
|
|
25395
25395
|
this.opts.query = null;
|
|
25396
25396
|
}
|
|
@@ -27150,10 +27150,10 @@ var require_cache_handler = __commonJS({
|
|
|
27150
27150
|
}
|
|
27151
27151
|
return locationUrl.pathname + locationUrl.search;
|
|
27152
27152
|
}
|
|
27153
|
-
function deleteCachedUri(store, cacheKey,
|
|
27153
|
+
function deleteCachedUri(store, cacheKey, path33) {
|
|
27154
27154
|
deleteCachedValue(store, {
|
|
27155
27155
|
...cacheKey,
|
|
27156
|
-
path:
|
|
27156
|
+
path: path33
|
|
27157
27157
|
});
|
|
27158
27158
|
for (let i = 0; i < util2.safeHTTPMethods.length; i++) {
|
|
27159
27159
|
const method = util2.safeHTTPMethods[i];
|
|
@@ -27161,7 +27161,7 @@ var require_cache_handler = __commonJS({
|
|
|
27161
27161
|
deleteCachedValue(store, {
|
|
27162
27162
|
...cacheKey,
|
|
27163
27163
|
method,
|
|
27164
|
-
path:
|
|
27164
|
+
path: path33
|
|
27165
27165
|
});
|
|
27166
27166
|
}
|
|
27167
27167
|
}
|
|
@@ -27172,9 +27172,9 @@ var require_cache_handler = __commonJS({
|
|
|
27172
27172
|
}
|
|
27173
27173
|
const values = Array.isArray(headerValue) ? headerValue : [headerValue];
|
|
27174
27174
|
for (let i = 0; i < values.length; i++) {
|
|
27175
|
-
const
|
|
27176
|
-
if (
|
|
27177
|
-
deleteCachedUri(store, cacheKey,
|
|
27175
|
+
const path33 = getSameOriginPath(cacheKey, values[i]);
|
|
27176
|
+
if (path33 !== void 0) {
|
|
27177
|
+
deleteCachedUri(store, cacheKey, path33);
|
|
27178
27178
|
}
|
|
27179
27179
|
}
|
|
27180
27180
|
}
|
|
@@ -32174,11 +32174,11 @@ var require_fetch = __commonJS({
|
|
|
32174
32174
|
function dispatch({ body }) {
|
|
32175
32175
|
const url2 = requestCurrentURL(request2);
|
|
32176
32176
|
const agent = fetchParams.controller.dispatcher;
|
|
32177
|
-
const
|
|
32177
|
+
const path33 = url2.pathname + url2.search;
|
|
32178
32178
|
const hasTrailingQuestionMark = url2.search.length === 0 && url2.href[url2.href.length - url2.hash.length - 1] === "?";
|
|
32179
32179
|
return new Promise((resolve2, reject) => agent.dispatch(
|
|
32180
32180
|
{
|
|
32181
|
-
path: hasTrailingQuestionMark ? `${
|
|
32181
|
+
path: hasTrailingQuestionMark ? `${path33}?` : path33,
|
|
32182
32182
|
origin: url2.origin,
|
|
32183
32183
|
method: request2.method,
|
|
32184
32184
|
body: agent.isMockActive ? request2.body && (request2.body.source || request2.body.stream) : body,
|
|
@@ -33125,9 +33125,9 @@ var require_util4 = __commonJS({
|
|
|
33125
33125
|
}
|
|
33126
33126
|
}
|
|
33127
33127
|
}
|
|
33128
|
-
function validateCookiePath(
|
|
33129
|
-
for (let i = 0; i <
|
|
33130
|
-
const code =
|
|
33128
|
+
function validateCookiePath(path33) {
|
|
33129
|
+
for (let i = 0; i < path33.length; ++i) {
|
|
33130
|
+
const code = path33.charCodeAt(i);
|
|
33131
33131
|
if (code < 32 || // exclude CTLs (0-31)
|
|
33132
33132
|
code > 126 || // exclude DEL and non-ascii
|
|
33133
33133
|
code === 59) {
|
|
@@ -36475,11 +36475,11 @@ var require_undici = __commonJS({
|
|
|
36475
36475
|
if (typeof opts.path !== "string") {
|
|
36476
36476
|
throw new InvalidArgumentError("invalid opts.path");
|
|
36477
36477
|
}
|
|
36478
|
-
let
|
|
36478
|
+
let path33 = opts.path;
|
|
36479
36479
|
if (!opts.path.startsWith("/")) {
|
|
36480
|
-
|
|
36480
|
+
path33 = `/${path33}`;
|
|
36481
36481
|
}
|
|
36482
|
-
url2 = new URL(util2.parseOrigin(url2).origin +
|
|
36482
|
+
url2 = new URL(util2.parseOrigin(url2).origin + path33);
|
|
36483
36483
|
} else {
|
|
36484
36484
|
if (!opts) {
|
|
36485
36485
|
opts = typeof url2 === "object" ? url2 : {};
|
|
@@ -36588,14 +36588,6 @@ ${captureLines}` : capture.stack;
|
|
|
36588
36588
|
}
|
|
36589
36589
|
});
|
|
36590
36590
|
|
|
36591
|
-
// src/clientFailure.ts
|
|
36592
|
-
import { constants } from "node:os";
|
|
36593
|
-
|
|
36594
|
-
// ../../apps/collector/src/credentials.ts
|
|
36595
|
-
import { chmodSync as chmodSync4, existsSync as existsSync7, mkdirSync as mkdirSync9, readFileSync as readFileSync8, unlinkSync as unlinkSync3, writeFileSync as writeFileSync8 } from "node:fs";
|
|
36596
|
-
import os12 from "node:os";
|
|
36597
|
-
import path14 from "node:path";
|
|
36598
|
-
|
|
36599
36591
|
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/external.js
|
|
36600
36592
|
var external_exports = {};
|
|
36601
36593
|
__export(external_exports, {
|
|
@@ -37412,10 +37404,10 @@ function mergeDefs(...defs) {
|
|
|
37412
37404
|
function cloneDef(schema) {
|
|
37413
37405
|
return mergeDefs(schema._zod.def);
|
|
37414
37406
|
}
|
|
37415
|
-
function getElementAtPath(obj,
|
|
37416
|
-
if (!
|
|
37407
|
+
function getElementAtPath(obj, path33) {
|
|
37408
|
+
if (!path33)
|
|
37417
37409
|
return obj;
|
|
37418
|
-
return
|
|
37410
|
+
return path33.reduce((acc, key) => acc?.[key], obj);
|
|
37419
37411
|
}
|
|
37420
37412
|
function promiseAllObject(promisesObj) {
|
|
37421
37413
|
const keys = Object.keys(promisesObj);
|
|
@@ -37755,11 +37747,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
37755
37747
|
}
|
|
37756
37748
|
return false;
|
|
37757
37749
|
}
|
|
37758
|
-
function prefixIssues(
|
|
37750
|
+
function prefixIssues(path33, issues) {
|
|
37759
37751
|
return issues.map((iss) => {
|
|
37760
37752
|
var _a4;
|
|
37761
37753
|
(_a4 = iss).path ?? (_a4.path = []);
|
|
37762
|
-
iss.path.unshift(
|
|
37754
|
+
iss.path.unshift(path33);
|
|
37763
37755
|
return iss;
|
|
37764
37756
|
});
|
|
37765
37757
|
}
|
|
@@ -38209,16 +38201,16 @@ function flattenError(error63, mapper = (issue2) => issue2.message) {
|
|
|
38209
38201
|
}
|
|
38210
38202
|
function formatError(error63, mapper = (issue2) => issue2.message) {
|
|
38211
38203
|
const fieldErrors = { _errors: [] };
|
|
38212
|
-
const processError = (error64,
|
|
38204
|
+
const processError = (error64, path33 = []) => {
|
|
38213
38205
|
for (const issue2 of error64.issues) {
|
|
38214
38206
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
38215
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
38207
|
+
issue2.errors.map((issues) => processError({ issues }, [...path33, ...issue2.path]));
|
|
38216
38208
|
} else if (issue2.code === "invalid_key") {
|
|
38217
|
-
processError({ issues: issue2.issues }, [...
|
|
38209
|
+
processError({ issues: issue2.issues }, [...path33, ...issue2.path]);
|
|
38218
38210
|
} else if (issue2.code === "invalid_element") {
|
|
38219
|
-
processError({ issues: issue2.issues }, [...
|
|
38211
|
+
processError({ issues: issue2.issues }, [...path33, ...issue2.path]);
|
|
38220
38212
|
} else {
|
|
38221
|
-
const fullpath = [...
|
|
38213
|
+
const fullpath = [...path33, ...issue2.path];
|
|
38222
38214
|
if (fullpath.length === 0) {
|
|
38223
38215
|
fieldErrors._errors.push(mapper(issue2));
|
|
38224
38216
|
} else {
|
|
@@ -38257,17 +38249,17 @@ function formatError(error63, mapper = (issue2) => issue2.message) {
|
|
|
38257
38249
|
}
|
|
38258
38250
|
function treeifyError(error63, mapper = (issue2) => issue2.message) {
|
|
38259
38251
|
const result = { errors: [] };
|
|
38260
|
-
const processError = (error64,
|
|
38252
|
+
const processError = (error64, path33 = []) => {
|
|
38261
38253
|
var _a4;
|
|
38262
38254
|
for (const issue2 of error64.issues) {
|
|
38263
38255
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
38264
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
38256
|
+
issue2.errors.map((issues) => processError({ issues }, [...path33, ...issue2.path]));
|
|
38265
38257
|
} else if (issue2.code === "invalid_key") {
|
|
38266
|
-
processError({ issues: issue2.issues }, [...
|
|
38258
|
+
processError({ issues: issue2.issues }, [...path33, ...issue2.path]);
|
|
38267
38259
|
} else if (issue2.code === "invalid_element") {
|
|
38268
|
-
processError({ issues: issue2.issues }, [...
|
|
38260
|
+
processError({ issues: issue2.issues }, [...path33, ...issue2.path]);
|
|
38269
38261
|
} else {
|
|
38270
|
-
const fullpath = [...
|
|
38262
|
+
const fullpath = [...path33, ...issue2.path];
|
|
38271
38263
|
if (fullpath.length === 0) {
|
|
38272
38264
|
result.errors.push(mapper(issue2));
|
|
38273
38265
|
continue;
|
|
@@ -38306,8 +38298,8 @@ function treeifyError(error63, mapper = (issue2) => issue2.message) {
|
|
|
38306
38298
|
}
|
|
38307
38299
|
function toDotPath(_path) {
|
|
38308
38300
|
const segs = [];
|
|
38309
|
-
const
|
|
38310
|
-
for (const seg of
|
|
38301
|
+
const path33 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
38302
|
+
for (const seg of path33) {
|
|
38311
38303
|
if (typeof seg === "number")
|
|
38312
38304
|
segs.push(`[${seg}]`);
|
|
38313
38305
|
else if (typeof seg === "symbol")
|
|
@@ -55409,13 +55401,13 @@ function resolveRef(ref, ctx) {
|
|
|
55409
55401
|
if (!ref.startsWith("#")) {
|
|
55410
55402
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
55411
55403
|
}
|
|
55412
|
-
const
|
|
55413
|
-
if (
|
|
55404
|
+
const path33 = ref.slice(1).split("/").filter(Boolean);
|
|
55405
|
+
if (path33.length === 0) {
|
|
55414
55406
|
return ctx.rootSchema;
|
|
55415
55407
|
}
|
|
55416
55408
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
55417
|
-
if (
|
|
55418
|
-
const key =
|
|
55409
|
+
if (path33[0] === defsKey) {
|
|
55410
|
+
const key = path33[1] === void 0 ? void 0 : decodeJSONPointerSegment(path33[1]);
|
|
55419
55411
|
if (!key || !ctx.defs[key]) {
|
|
55420
55412
|
throw new Error(`Reference not found: ${ref}`);
|
|
55421
55413
|
}
|
|
@@ -56264,6 +56256,53 @@ function date4(params) {
|
|
|
56264
56256
|
return _coercedDate(ZodDate, params);
|
|
56265
56257
|
}
|
|
56266
56258
|
|
|
56259
|
+
// ../core/src/mcpWarning.ts
|
|
56260
|
+
var mcpClientSchema = external_exports.enum(["claude", "codex", "cursor"]);
|
|
56261
|
+
var mcpWarningSchema = external_exports.enum(["not-connected", "sign-in-needed", "different-url"]);
|
|
56262
|
+
var mcpWarningDismissalSchema = external_exports.object({
|
|
56263
|
+
client: mcpClientSchema,
|
|
56264
|
+
warning: mcpWarningSchema
|
|
56265
|
+
}).strict();
|
|
56266
|
+
|
|
56267
|
+
// ../core/src/sessionIngest.ts
|
|
56268
|
+
var SESSION_SOURCES = [
|
|
56269
|
+
"claude-code",
|
|
56270
|
+
"claude-cloud",
|
|
56271
|
+
"codex",
|
|
56272
|
+
"cursor",
|
|
56273
|
+
"cursor-cloud",
|
|
56274
|
+
"github-pr"
|
|
56275
|
+
];
|
|
56276
|
+
var SESSION_SPEED_MODES = ["standard", "fast"];
|
|
56277
|
+
var SESSION_SPEED_OBSERVATIONS = [...SESSION_SPEED_MODES, "unknown"];
|
|
56278
|
+
function isSessionSource(source) {
|
|
56279
|
+
return typeof source === "string" && SESSION_SOURCES.includes(source);
|
|
56280
|
+
}
|
|
56281
|
+
var SESSION_ACTIVE_WINDOW_MS = 30 * 60 * 1e3;
|
|
56282
|
+
var COLLECTOR_SESSION_SOURCES = ["claude-code", "codex", "cursor"];
|
|
56283
|
+
var PREVIEW_REGISTRABLE_SOURCES = [
|
|
56284
|
+
...COLLECTOR_SESSION_SOURCES,
|
|
56285
|
+
"cursor-cloud"
|
|
56286
|
+
];
|
|
56287
|
+
var MAX_INGEST_BATCH = 500;
|
|
56288
|
+
var MAX_RAW_UPLOAD_BYTES = 256 * 1024 * 1024;
|
|
56289
|
+
var MAX_PREVIEW_URL_LENGTH = 2e3;
|
|
56290
|
+
var MAX_REGISTERED_PREVIEWS = 10;
|
|
56291
|
+
var MAX_PREVIEW_LABEL_LENGTH = 60;
|
|
56292
|
+
var MAX_BRANCH_FACTS = 50;
|
|
56293
|
+
|
|
56294
|
+
// ../core/src/menubarAnalytics.ts
|
|
56295
|
+
var MENUBAR_AGENT_CLICK = "menubar:agent_click";
|
|
56296
|
+
var MENUBAR_MCP_WARNING_REMOVE = "menubar:mcp_warning_remove";
|
|
56297
|
+
var menubarAgentClickSchema = external_exports.object({
|
|
56298
|
+
source: external_exports.enum([...SESSION_SOURCES, "unknown"]),
|
|
56299
|
+
destination: external_exports.enum(["focus", "resume", "desktop", "web"])
|
|
56300
|
+
}).strict();
|
|
56301
|
+
var menubarEventSchema = external_exports.discriminatedUnion("event", [
|
|
56302
|
+
menubarAgentClickSchema.extend({ event: external_exports.literal(MENUBAR_AGENT_CLICK) }),
|
|
56303
|
+
mcpWarningDismissalSchema.extend({ event: external_exports.literal(MENUBAR_MCP_WARNING_REMOVE) })
|
|
56304
|
+
]);
|
|
56305
|
+
|
|
56267
56306
|
// ../core/src/messageOrigin.ts
|
|
56268
56307
|
var CLAUDE_CODE_NATIVE_ORIGINS = /* @__PURE__ */ new Set(["human", "agent", "harness", "tool"]);
|
|
56269
56308
|
var CLAUDE_CODE_TASK_NOTIFICATION_ORIGIN = "task-notification";
|
|
@@ -56725,16 +56764,16 @@ function githubRepositoryOfRemote(url2) {
|
|
|
56725
56764
|
const afterUser = url2.replace(REMOTE_SCHEME, "").replace(REMOTE_USER, "");
|
|
56726
56765
|
const host = afterUser.startsWith("ssh.") ? afterUser.slice("ssh.".length) : afterUser;
|
|
56727
56766
|
if (!host.startsWith("github.com")) return null;
|
|
56728
|
-
let
|
|
56729
|
-
const port = hasScheme ? REMOTE_PORT.exec(
|
|
56730
|
-
if (port !== null)
|
|
56731
|
-
else if (
|
|
56767
|
+
let path33 = host.slice("github.com".length);
|
|
56768
|
+
const port = hasScheme ? REMOTE_PORT.exec(path33) : null;
|
|
56769
|
+
if (port !== null) path33 = path33.slice(port[0].length);
|
|
56770
|
+
else if (path33.startsWith("/") || path33.startsWith(":")) path33 = path33.slice(1);
|
|
56732
56771
|
else return null;
|
|
56733
|
-
if (
|
|
56734
|
-
if (
|
|
56735
|
-
const segments =
|
|
56772
|
+
if (path33.endsWith("/")) path33 = path33.slice(0, -1);
|
|
56773
|
+
if (path33.endsWith(".git")) path33 = path33.slice(0, -".git".length);
|
|
56774
|
+
const segments = path33.split("/");
|
|
56736
56775
|
if (segments.length !== 2 || !segments.every((segment) => REMOTE_PATH_SEGMENT.test(segment))) return null;
|
|
56737
|
-
return
|
|
56776
|
+
return path33;
|
|
56738
56777
|
}
|
|
56739
56778
|
var PUSH_DESTINATION = /\bTo\s+([^\s\\"]+)/g;
|
|
56740
56779
|
function pushDestinationsInText(text) {
|
|
@@ -57669,10 +57708,10 @@ function boundUnfamiliarPayload(record2) {
|
|
|
57669
57708
|
}
|
|
57670
57709
|
function excludeImageCarriers(record2) {
|
|
57671
57710
|
const excludedKeys = [];
|
|
57672
|
-
const withoutImages = (value,
|
|
57711
|
+
const withoutImages = (value, path33) => {
|
|
57673
57712
|
if (Array.isArray(value)) {
|
|
57674
57713
|
return value.map((item, index) => {
|
|
57675
|
-
const itemPath = `${
|
|
57714
|
+
const itemPath = `${path33}[${index}]`;
|
|
57676
57715
|
if (typeof item === "string" && isImageCarrier(item)) {
|
|
57677
57716
|
excludedKeys.push(itemPath);
|
|
57678
57717
|
return null;
|
|
@@ -57683,7 +57722,7 @@ function excludeImageCarriers(record2) {
|
|
|
57683
57722
|
if (!isRecord2(value)) return value;
|
|
57684
57723
|
const kept = [];
|
|
57685
57724
|
for (const [key, item] of Object.entries(value)) {
|
|
57686
|
-
const keyPath =
|
|
57725
|
+
const keyPath = path33 === "" ? key : `${path33}.${key}`;
|
|
57687
57726
|
if (isImageBase64Payload(value, key) || typeof item === "string" && isImageCarrier(item)) {
|
|
57688
57727
|
excludedKeys.push(keyPath);
|
|
57689
57728
|
continue;
|
|
@@ -58404,8 +58443,8 @@ function primaryArg(args) {
|
|
|
58404
58443
|
function readFilePath(name, primary) {
|
|
58405
58444
|
if (!primary || !READ_TOOLS.has(name)) return null;
|
|
58406
58445
|
if (ARTIFACT_PATH_RE.test(primary)) return null;
|
|
58407
|
-
const
|
|
58408
|
-
return
|
|
58446
|
+
const path33 = primary.startsWith("/workspace/") ? primary.slice("/workspace/".length) : primary;
|
|
58447
|
+
return path33.length > 0 ? path33 : null;
|
|
58409
58448
|
}
|
|
58410
58449
|
function asRecord3(value) {
|
|
58411
58450
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
@@ -58738,33 +58777,6 @@ function describeSyncSignals(member, now, noUpload = "no sessions uploaded yet")
|
|
|
58738
58777
|
return `${line.charAt(0).toUpperCase()}${line.slice(1)}.`;
|
|
58739
58778
|
}
|
|
58740
58779
|
|
|
58741
|
-
// ../core/src/sessionIngest.ts
|
|
58742
|
-
var SESSION_SOURCES = [
|
|
58743
|
-
"claude-code",
|
|
58744
|
-
"claude-cloud",
|
|
58745
|
-
"codex",
|
|
58746
|
-
"cursor",
|
|
58747
|
-
"cursor-cloud",
|
|
58748
|
-
"github-pr"
|
|
58749
|
-
];
|
|
58750
|
-
var SESSION_SPEED_MODES = ["standard", "fast"];
|
|
58751
|
-
var SESSION_SPEED_OBSERVATIONS = [...SESSION_SPEED_MODES, "unknown"];
|
|
58752
|
-
function isSessionSource(source) {
|
|
58753
|
-
return typeof source === "string" && SESSION_SOURCES.includes(source);
|
|
58754
|
-
}
|
|
58755
|
-
var SESSION_ACTIVE_WINDOW_MS = 30 * 60 * 1e3;
|
|
58756
|
-
var COLLECTOR_SESSION_SOURCES = ["claude-code", "codex", "cursor"];
|
|
58757
|
-
var PREVIEW_REGISTRABLE_SOURCES = [
|
|
58758
|
-
...COLLECTOR_SESSION_SOURCES,
|
|
58759
|
-
"cursor-cloud"
|
|
58760
|
-
];
|
|
58761
|
-
var MAX_INGEST_BATCH = 500;
|
|
58762
|
-
var MAX_RAW_UPLOAD_BYTES = 256 * 1024 * 1024;
|
|
58763
|
-
var MAX_PREVIEW_URL_LENGTH = 2e3;
|
|
58764
|
-
var MAX_REGISTERED_PREVIEWS = 10;
|
|
58765
|
-
var MAX_PREVIEW_LABEL_LENGTH = 60;
|
|
58766
|
-
var MAX_BRANCH_FACTS = 50;
|
|
58767
|
-
|
|
58768
58780
|
// ../core/src/version.ts
|
|
58769
58781
|
function parseReleaseVersion(version2) {
|
|
58770
58782
|
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version2);
|
|
@@ -58837,6 +58849,15 @@ var recentSessionCursorSchema = external_exports.object({
|
|
|
58837
58849
|
id: external_exports.uuid()
|
|
58838
58850
|
});
|
|
58839
58851
|
|
|
58852
|
+
// src/mcpPreferences.ts
|
|
58853
|
+
import { mkdirSync as mkdirSync10, readFileSync as readFileSync11, renameSync as renameSync5, writeFileSync as writeFileSync9 } from "node:fs";
|
|
58854
|
+
import path21 from "node:path";
|
|
58855
|
+
|
|
58856
|
+
// ../../apps/collector/src/credentials.ts
|
|
58857
|
+
import { chmodSync as chmodSync4, existsSync as existsSync7, mkdirSync as mkdirSync9, readFileSync as readFileSync8, unlinkSync as unlinkSync3, writeFileSync as writeFileSync8 } from "node:fs";
|
|
58858
|
+
import os12 from "node:os";
|
|
58859
|
+
import path14 from "node:path";
|
|
58860
|
+
|
|
58840
58861
|
// ../../node_modules/.pnpm/@sentry+core@10.74.0/node_modules/@sentry/core/build/esm/debug-build.js
|
|
58841
58862
|
var DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
|
|
58842
58863
|
|
|
@@ -59017,8 +59038,8 @@ function getFunctionName(fn) {
|
|
|
59017
59038
|
return defaultFunctionName;
|
|
59018
59039
|
}
|
|
59019
59040
|
}
|
|
59020
|
-
function normalizeStackTracePath(
|
|
59021
|
-
let filename =
|
|
59041
|
+
function normalizeStackTracePath(path33) {
|
|
59042
|
+
let filename = path33?.startsWith("file://") ? path33.slice(7) : path33;
|
|
59022
59043
|
if (filename?.match(/\/[A-Z]:/)) {
|
|
59023
59044
|
filename = filename.slice(1);
|
|
59024
59045
|
}
|
|
@@ -60828,8 +60849,8 @@ function isValidProtocol(protocol) {
|
|
|
60828
60849
|
return protocol === "http" || protocol === "https";
|
|
60829
60850
|
}
|
|
60830
60851
|
function dsnToString(dsn, withPassword = false) {
|
|
60831
|
-
const { host, path:
|
|
60832
|
-
return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ""}@${host}${port ? `:${port}` : ""}/${
|
|
60852
|
+
const { host, path: path33, pass, port, projectId, protocol, publicKey } = dsn;
|
|
60853
|
+
return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ""}@${host}${port ? `:${port}` : ""}/${path33 ? `${path33}/` : path33}${projectId}`;
|
|
60833
60854
|
}
|
|
60834
60855
|
function dsnFromString(str) {
|
|
60835
60856
|
const match = DSN_REGEX.exec(str);
|
|
@@ -60840,11 +60861,11 @@ function dsnFromString(str) {
|
|
|
60840
60861
|
return void 0;
|
|
60841
60862
|
}
|
|
60842
60863
|
const [protocol, publicKey, pass = "", host = "", port = "", lastPath = ""] = match.slice(1);
|
|
60843
|
-
let
|
|
60864
|
+
let path33 = "";
|
|
60844
60865
|
let projectId = lastPath;
|
|
60845
60866
|
const split = projectId.split("/");
|
|
60846
60867
|
if (split.length > 1) {
|
|
60847
|
-
|
|
60868
|
+
path33 = split.slice(0, -1).join("/");
|
|
60848
60869
|
projectId = split.pop();
|
|
60849
60870
|
}
|
|
60850
60871
|
if (projectId) {
|
|
@@ -60853,7 +60874,7 @@ function dsnFromString(str) {
|
|
|
60853
60874
|
projectId = projectMatch[0];
|
|
60854
60875
|
}
|
|
60855
60876
|
}
|
|
60856
|
-
return dsnFromComponents({ host, pass, path:
|
|
60877
|
+
return dsnFromComponents({ host, pass, path: path33, projectId, port, protocol, publicKey });
|
|
60857
60878
|
}
|
|
60858
60879
|
function dsnFromComponents(components) {
|
|
60859
60880
|
return {
|
|
@@ -65382,9 +65403,9 @@ function stripUrlQueryAndFragment(urlPath) {
|
|
|
65382
65403
|
return urlPath.split(/[?#]/, 1)[0];
|
|
65383
65404
|
}
|
|
65384
65405
|
function getSanitizedUrlString(url2) {
|
|
65385
|
-
const { protocol, host, path:
|
|
65406
|
+
const { protocol, host, path: path33 } = url2;
|
|
65386
65407
|
const filteredHost = host?.replace(/^.*@/, "[filtered]:[filtered]@").replace(/(:80)$/, "").replace(/(:443)$/, "") || "";
|
|
65387
|
-
return `${protocol ? `${protocol}://` : ""}${filteredHost}${
|
|
65408
|
+
return `${protocol ? `${protocol}://` : ""}${filteredHost}${path33}`;
|
|
65388
65409
|
}
|
|
65389
65410
|
function stripDataUrlContent(url2, includeDataPrefix = true) {
|
|
65390
65411
|
if (url2.startsWith("data:")) {
|
|
@@ -66329,8 +66350,8 @@ function splitPath(filename) {
|
|
|
66329
66350
|
const parts = splitPathRe.exec(truncated);
|
|
66330
66351
|
return parts ? parts.slice(1) : [];
|
|
66331
66352
|
}
|
|
66332
|
-
function dirname(
|
|
66333
|
-
const result = splitPath(
|
|
66353
|
+
function dirname(path33) {
|
|
66354
|
+
const result = splitPath(path33);
|
|
66334
66355
|
const root = result[0] || "";
|
|
66335
66356
|
let dir = result[1];
|
|
66336
66357
|
if (!root && !dir) {
|
|
@@ -70173,15 +70194,15 @@ var getLayerMetadata = (route, layer, layerPath) => {
|
|
|
70173
70194
|
};
|
|
70174
70195
|
}
|
|
70175
70196
|
};
|
|
70176
|
-
var getRouterPath = (
|
|
70197
|
+
var getRouterPath = (path33, layer) => {
|
|
70177
70198
|
const stackLayer = Array.isArray(layer.handle?.stack) ? layer.handle?.stack?.[0] : void 0;
|
|
70178
70199
|
if (stackLayer?.route?.path) {
|
|
70179
|
-
return `${
|
|
70200
|
+
return `${path33}${stackLayer.route.path}`;
|
|
70180
70201
|
}
|
|
70181
70202
|
if (stackLayer && Array.isArray(stackLayer?.handle?.stack)) {
|
|
70182
|
-
return getRouterPath(
|
|
70203
|
+
return getRouterPath(path33, stackLayer);
|
|
70183
70204
|
}
|
|
70184
|
-
return
|
|
70205
|
+
return path33;
|
|
70185
70206
|
};
|
|
70186
70207
|
var isLayerIgnored = (name, type, config2) => {
|
|
70187
70208
|
if (Array.isArray(config2?.ignoreLayersType) && config2?.ignoreLayersType?.includes(type)) {
|
|
@@ -70201,7 +70222,7 @@ function getActualMatchedRoute(req, constructedRoute) {
|
|
|
70201
70222
|
if (layersStore.length === 0) {
|
|
70202
70223
|
return void 0;
|
|
70203
70224
|
}
|
|
70204
|
-
if (layersStore.every((
|
|
70225
|
+
if (layersStore.every((path33) => path33 === "/")) {
|
|
70205
70226
|
return req.originalUrl === "/" ? "/" : void 0;
|
|
70206
70227
|
}
|
|
70207
70228
|
if (constructedRoute === "*") {
|
|
@@ -70217,11 +70238,11 @@ function getActualMatchedRoute(req, constructedRoute) {
|
|
|
70217
70238
|
function getConstructedRoute(req) {
|
|
70218
70239
|
const layersStore = getStoredLayers(req);
|
|
70219
70240
|
let constructedRoute = "";
|
|
70220
|
-
for (const
|
|
70221
|
-
if (
|
|
70241
|
+
for (const path33 of layersStore) {
|
|
70242
|
+
if (path33 === "/" || path33 === "/*") {
|
|
70222
70243
|
continue;
|
|
70223
70244
|
}
|
|
70224
|
-
constructedRoute += !constructedRoute || constructedRoute.endsWith("/") ?
|
|
70245
|
+
constructedRoute += !constructedRoute || constructedRoute.endsWith("/") ? path33 : `/${path33}`;
|
|
70225
70246
|
}
|
|
70226
70247
|
return constructedRoute.replace(/\/{2,}/g, "/");
|
|
70227
70248
|
}
|
|
@@ -70726,9 +70747,9 @@ function getRequestUrlObject(requestOptions) {
|
|
|
70726
70747
|
const hostHeader = requestOptions.headers?.host && String(requestOptions.headers?.host);
|
|
70727
70748
|
const hostname4 = hostHeader || requestOptions.hostname || requestOptions.host || "";
|
|
70728
70749
|
const port = !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 || /^(.*):(\d+)$/.test(hostname4) ? "" : `:${requestOptions.port}`;
|
|
70729
|
-
const
|
|
70750
|
+
const path33 = requestOptions.path ? requestOptions.path : "/";
|
|
70730
70751
|
const base = `${protocol}//${hostname4}${port}`;
|
|
70731
|
-
return new URL(
|
|
70752
|
+
return new URL(path33.startsWith("//") ? `${base}${path33}` : path33, base);
|
|
70732
70753
|
}
|
|
70733
70754
|
function getRequestUrlFromClientRequest(request2) {
|
|
70734
70755
|
return String(getRequestUrl(getRequestOptions(request2)));
|
|
@@ -71401,11 +71422,11 @@ function shouldIgnoreSpansForIncomingRequest(request2, {
|
|
|
71401
71422
|
return false;
|
|
71402
71423
|
}
|
|
71403
71424
|
function isStaticAssetRequest(urlPath) {
|
|
71404
|
-
const
|
|
71405
|
-
if (
|
|
71425
|
+
const path33 = stripUrlQueryAndFragment(urlPath);
|
|
71426
|
+
if (path33.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)) {
|
|
71406
71427
|
return true;
|
|
71407
71428
|
}
|
|
71408
|
-
if (
|
|
71429
|
+
if (path33.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/)) {
|
|
71409
71430
|
return true;
|
|
71410
71431
|
}
|
|
71411
71432
|
return false;
|
|
@@ -71646,11 +71667,11 @@ function isKnownPrefetchRequest2(req) {
|
|
|
71646
71667
|
return req.headers["next-router-prefetch"] === "1";
|
|
71647
71668
|
}
|
|
71648
71669
|
function isStaticAssetRequest2(urlPath) {
|
|
71649
|
-
const
|
|
71650
|
-
if (
|
|
71670
|
+
const path33 = stripUrlQueryAndFragment(urlPath);
|
|
71671
|
+
if (path33.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)) {
|
|
71651
71672
|
return true;
|
|
71652
71673
|
}
|
|
71653
|
-
if (
|
|
71674
|
+
if (path33.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/)) {
|
|
71654
71675
|
return true;
|
|
71655
71676
|
}
|
|
71656
71677
|
return false;
|
|
@@ -72010,19 +72031,19 @@ function getBreadcrumbData(request2) {
|
|
|
72010
72031
|
return {};
|
|
72011
72032
|
}
|
|
72012
72033
|
}
|
|
72013
|
-
function getAbsoluteUrl2(origin,
|
|
72034
|
+
function getAbsoluteUrl2(origin, path33 = "/") {
|
|
72014
72035
|
try {
|
|
72015
|
-
const url2 = new URL(
|
|
72036
|
+
const url2 = new URL(path33, origin);
|
|
72016
72037
|
return url2.toString();
|
|
72017
72038
|
} catch {
|
|
72018
72039
|
const url2 = `${origin}`;
|
|
72019
|
-
if (url2.endsWith("/") &&
|
|
72020
|
-
return `${url2}${
|
|
72040
|
+
if (url2.endsWith("/") && path33.startsWith("/")) {
|
|
72041
|
+
return `${url2}${path33.slice(1)}`;
|
|
72021
72042
|
}
|
|
72022
|
-
if (!url2.endsWith("/") && !
|
|
72023
|
-
return `${url2}/${
|
|
72043
|
+
if (!url2.endsWith("/") && !path33.startsWith("/")) {
|
|
72044
|
+
return `${url2}/${path33}`;
|
|
72024
72045
|
}
|
|
72025
|
-
return `${url2}${
|
|
72046
|
+
return `${url2}${path33}`;
|
|
72026
72047
|
}
|
|
72027
72048
|
}
|
|
72028
72049
|
|
|
@@ -72267,15 +72288,15 @@ function getRequestMethod(original) {
|
|
|
72267
72288
|
}
|
|
72268
72289
|
return "_OTHER";
|
|
72269
72290
|
}
|
|
72270
|
-
function getAbsoluteUrl3(origin,
|
|
72291
|
+
function getAbsoluteUrl3(origin, path33 = "/") {
|
|
72271
72292
|
const url2 = `${origin}`;
|
|
72272
|
-
if (url2.endsWith("/") &&
|
|
72273
|
-
return `${url2}${
|
|
72293
|
+
if (url2.endsWith("/") && path33.startsWith("/")) {
|
|
72294
|
+
return `${url2}${path33.slice(1)}`;
|
|
72274
72295
|
}
|
|
72275
|
-
if (!url2.endsWith("/") && !
|
|
72276
|
-
return `${url2}/${
|
|
72296
|
+
if (!url2.endsWith("/") && !path33.startsWith("/")) {
|
|
72297
|
+
return `${url2}/${path33}`;
|
|
72277
72298
|
}
|
|
72278
|
-
return `${url2}${
|
|
72299
|
+
return `${url2}${path33}`;
|
|
72279
72300
|
}
|
|
72280
72301
|
|
|
72281
72302
|
// ../../node_modules/.pnpm/@sentry+node-core@10.74.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.11.0_@opentele_b542b1cf9336850aabd631474d797bed/node_modules/@sentry/node-core/build/esm/integrations/node-fetch/index.js
|
|
@@ -74768,12 +74789,12 @@ function emplace(map2, key, contents) {
|
|
|
74768
74789
|
}
|
|
74769
74790
|
return value;
|
|
74770
74791
|
}
|
|
74771
|
-
function shouldSkipContextLinesForFile(
|
|
74772
|
-
if (
|
|
74773
|
-
if (
|
|
74774
|
-
if (
|
|
74775
|
-
if (
|
|
74776
|
-
if (
|
|
74792
|
+
function shouldSkipContextLinesForFile(path33) {
|
|
74793
|
+
if (path33.startsWith("node:")) return true;
|
|
74794
|
+
if (path33.endsWith(".min.js")) return true;
|
|
74795
|
+
if (path33.endsWith(".min.cjs")) return true;
|
|
74796
|
+
if (path33.endsWith(".min.mjs")) return true;
|
|
74797
|
+
if (path33.startsWith("data:")) return true;
|
|
74777
74798
|
return false;
|
|
74778
74799
|
}
|
|
74779
74800
|
function shouldSkipContextLinesForFrame(frame) {
|
|
@@ -74821,9 +74842,9 @@ function makeLineReaderRanges(lines, linecontext) {
|
|
|
74821
74842
|
}
|
|
74822
74843
|
return out;
|
|
74823
74844
|
}
|
|
74824
|
-
function getContextLinesFromFile(
|
|
74845
|
+
function getContextLinesFromFile(path33, ranges, output2) {
|
|
74825
74846
|
return new Promise((resolve2, _reject) => {
|
|
74826
|
-
const stream = createReadStream(
|
|
74847
|
+
const stream = createReadStream(path33);
|
|
74827
74848
|
const lineReaded = createInterface({
|
|
74828
74849
|
input: stream
|
|
74829
74850
|
});
|
|
@@ -74841,8 +74862,8 @@ function getContextLinesFromFile(path32, ranges, output2) {
|
|
|
74841
74862
|
let rangeStart = range[0];
|
|
74842
74863
|
let rangeEnd = range[1];
|
|
74843
74864
|
function onStreamError(e) {
|
|
74844
|
-
LRU_FILE_CONTENTS_FS_READ_FAILED.set(
|
|
74845
|
-
DEBUG_BUILD2 && debug.error(`Failed to read file: ${
|
|
74865
|
+
LRU_FILE_CONTENTS_FS_READ_FAILED.set(path33, 1);
|
|
74866
|
+
DEBUG_BUILD2 && debug.error(`Failed to read file: ${path33}. Error: ${e}`);
|
|
74846
74867
|
lineReaded.close();
|
|
74847
74868
|
lineReaded.removeAllListeners();
|
|
74848
74869
|
destroyStreamAndResolve();
|
|
@@ -76281,8 +76302,8 @@ function getSpotlightConfig(optionsSpotlight) {
|
|
|
76281
76302
|
|
|
76282
76303
|
// ../../node_modules/.pnpm/@sentry+node-core@10.74.0_@opentelemetry+api@1.9.1_@opentelemetry+core@2.11.0_@opentele_b542b1cf9336850aabd631474d797bed/node_modules/@sentry/node-core/build/esm/utils/module.js
|
|
76283
76304
|
import { posix, sep } from "node:path";
|
|
76284
|
-
function normalizeWindowsPath(
|
|
76285
|
-
return
|
|
76305
|
+
function normalizeWindowsPath(path33) {
|
|
76306
|
+
return path33.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
|
|
76286
76307
|
}
|
|
76287
76308
|
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname(process.argv[1]) : process.cwd(), isWindows = sep === "\\") {
|
|
76288
76309
|
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
|
|
@@ -79167,22 +79188,22 @@ function addSpanSource(span, loc, start, end) {
|
|
|
79167
79188
|
span.setAttribute(AttributeNames2.SOURCE, source);
|
|
79168
79189
|
}
|
|
79169
79190
|
}
|
|
79170
|
-
function createFieldIfNotExists(contextValue, info,
|
|
79171
|
-
let field = getField(contextValue,
|
|
79191
|
+
function createFieldIfNotExists(contextValue, info, path33) {
|
|
79192
|
+
let field = getField(contextValue, path33);
|
|
79172
79193
|
if (field) {
|
|
79173
79194
|
return { field, spanAdded: false };
|
|
79174
79195
|
}
|
|
79175
|
-
const parentSpan = getParentFieldSpan(contextValue,
|
|
79196
|
+
const parentSpan = getParentFieldSpan(contextValue, path33);
|
|
79176
79197
|
field = {
|
|
79177
|
-
span: createResolverSpan(contextValue, info,
|
|
79198
|
+
span: createResolverSpan(contextValue, info, path33, parentSpan)
|
|
79178
79199
|
};
|
|
79179
|
-
addField(contextValue,
|
|
79200
|
+
addField(contextValue, path33, field);
|
|
79180
79201
|
return { field, spanAdded: true };
|
|
79181
79202
|
}
|
|
79182
|
-
function createResolverSpan(contextValue, info,
|
|
79203
|
+
function createResolverSpan(contextValue, info, path33, parentSpan) {
|
|
79183
79204
|
const attributes = {
|
|
79184
79205
|
[AttributeNames2.FIELD_NAME]: info.fieldName,
|
|
79185
|
-
[AttributeNames2.FIELD_PATH]:
|
|
79206
|
+
[AttributeNames2.FIELD_PATH]: path33.join("."),
|
|
79186
79207
|
[AttributeNames2.FIELD_TYPE]: info.returnType.toString(),
|
|
79187
79208
|
[AttributeNames2.PARENT_NAME]: info.parentType.name
|
|
79188
79209
|
};
|
|
@@ -79214,15 +79235,15 @@ function getOperation(document2, operationName) {
|
|
|
79214
79235
|
return document2.definitions.find((definition) => OPERATION_VALUES.indexOf(definition?.operation) !== -1);
|
|
79215
79236
|
}
|
|
79216
79237
|
}
|
|
79217
|
-
function addField(contextValue,
|
|
79218
|
-
return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[
|
|
79238
|
+
function addField(contextValue, path33, field) {
|
|
79239
|
+
return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[path33.join(".")] = field;
|
|
79219
79240
|
}
|
|
79220
|
-
function getField(contextValue,
|
|
79221
|
-
return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[
|
|
79241
|
+
function getField(contextValue, path33) {
|
|
79242
|
+
return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].fields[path33.join(".")];
|
|
79222
79243
|
}
|
|
79223
|
-
function getParentFieldSpan(contextValue,
|
|
79224
|
-
for (let i =
|
|
79225
|
-
const field = getField(contextValue,
|
|
79244
|
+
function getParentFieldSpan(contextValue, path33) {
|
|
79245
|
+
for (let i = path33.length - 1; i > 0; i--) {
|
|
79246
|
+
const field = getField(contextValue, path33.slice(0, i));
|
|
79226
79247
|
if (field) {
|
|
79227
79248
|
return field.span;
|
|
79228
79249
|
}
|
|
@@ -79232,9 +79253,9 @@ function getParentFieldSpan(contextValue, path32) {
|
|
|
79232
79253
|
function getRootSpan2(contextValue) {
|
|
79233
79254
|
return contextValue[OTEL_GRAPHQL_DATA_SYMBOL].span;
|
|
79234
79255
|
}
|
|
79235
|
-
function pathToArray(
|
|
79256
|
+
function pathToArray(path33) {
|
|
79236
79257
|
const flattened = [];
|
|
79237
|
-
let curr =
|
|
79258
|
+
let curr = path33;
|
|
79238
79259
|
while (curr) {
|
|
79239
79260
|
flattened.push(String(curr.key));
|
|
79240
79261
|
curr = curr.prev;
|
|
@@ -79375,8 +79396,8 @@ function wrapFieldResolver(getConfig3, fieldResolver, isDefaultResolver = false)
|
|
|
79375
79396
|
if (!contextValue[OTEL_GRAPHQL_DATA_SYMBOL]) {
|
|
79376
79397
|
return fieldResolver.call(this, source, args, contextValue, info);
|
|
79377
79398
|
}
|
|
79378
|
-
const
|
|
79379
|
-
const { field, spanAdded } = createFieldIfNotExists(contextValue, info,
|
|
79399
|
+
const path33 = pathToArray(info?.path);
|
|
79400
|
+
const { field, spanAdded } = createFieldIfNotExists(contextValue, info, path33);
|
|
79380
79401
|
const span = field.span;
|
|
79381
79402
|
const shouldEndSpan = spanAdded;
|
|
79382
79403
|
return withActiveSpan(span, () => {
|
|
@@ -82359,10 +82380,10 @@ var PostgresJsInstrumentation = class extends import_instrumentation24.Instrumen
|
|
|
82359
82380
|
},
|
|
82360
82381
|
(exports) => exports
|
|
82361
82382
|
);
|
|
82362
|
-
["src", "cf/src", "cjs/src"].forEach((
|
|
82383
|
+
["src", "cf/src", "cjs/src"].forEach((path33) => {
|
|
82363
82384
|
module2.files.push(
|
|
82364
82385
|
new InstrumentationNodeModuleFile(
|
|
82365
|
-
`postgres/${
|
|
82386
|
+
`postgres/${path33}/query.js`,
|
|
82366
82387
|
SUPPORTED_VERSIONS4,
|
|
82367
82388
|
this._patchQueryPrototype.bind(this),
|
|
82368
82389
|
this._unpatchQueryPrototype.bind(this)
|
|
@@ -82993,13 +83014,13 @@ var HonoInstrumentation = class extends import_instrumentation27.Instrumentation
|
|
|
82993
83014
|
return function(original) {
|
|
82994
83015
|
return function wrappedHandler(...args) {
|
|
82995
83016
|
if (typeof args[0] === "string") {
|
|
82996
|
-
const
|
|
83017
|
+
const path33 = args[0];
|
|
82997
83018
|
if (args.length === 1) {
|
|
82998
|
-
return original.apply(this, [
|
|
83019
|
+
return original.apply(this, [path33]);
|
|
82999
83020
|
}
|
|
83000
83021
|
const handlers2 = args.slice(1);
|
|
83001
83022
|
return original.apply(this, [
|
|
83002
|
-
|
|
83023
|
+
path33,
|
|
83003
83024
|
...handlers2.map((handler) => instrumentation._wrapHandler(handler))
|
|
83004
83025
|
]);
|
|
83005
83026
|
}
|
|
@@ -83033,13 +83054,13 @@ var HonoInstrumentation = class extends import_instrumentation27.Instrumentation
|
|
|
83033
83054
|
return function(original) {
|
|
83034
83055
|
return function wrappedHandler(...args) {
|
|
83035
83056
|
if (typeof args[0] === "string") {
|
|
83036
|
-
const
|
|
83057
|
+
const path33 = args[0];
|
|
83037
83058
|
if (args.length === 1) {
|
|
83038
|
-
return original.apply(this, [
|
|
83059
|
+
return original.apply(this, [path33]);
|
|
83039
83060
|
}
|
|
83040
83061
|
const handlers2 = args.slice(1);
|
|
83041
83062
|
return original.apply(this, [
|
|
83042
|
-
|
|
83063
|
+
path33,
|
|
83043
83064
|
...handlers2.map((handler) => instrumentation._wrapHandler(handler))
|
|
83044
83065
|
]);
|
|
83045
83066
|
}
|
|
@@ -83059,8 +83080,8 @@ var HonoInstrumentation = class extends import_instrumentation27.Instrumentation
|
|
|
83059
83080
|
if (!instrumentation.isEnabled()) {
|
|
83060
83081
|
return handler.apply(this, [c, next]);
|
|
83061
83082
|
}
|
|
83062
|
-
const
|
|
83063
|
-
const span = instrumentation.tracer.startSpan(
|
|
83083
|
+
const path33 = c.req.path;
|
|
83084
|
+
const span = instrumentation.tracer.startSpan(path33);
|
|
83064
83085
|
return context.with(trace.setSpan(context.active(), span), () => {
|
|
83065
83086
|
return instrumentation._safeExecute(
|
|
83066
83087
|
() => {
|
|
@@ -83070,7 +83091,7 @@ var HonoInstrumentation = class extends import_instrumentation27.Instrumentation
|
|
|
83070
83091
|
const type = instrumentation._determineHandlerType(result2);
|
|
83071
83092
|
span.setAttributes({
|
|
83072
83093
|
[AttributeNames5.HONO_TYPE]: type,
|
|
83073
|
-
[AttributeNames5.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ?
|
|
83094
|
+
[AttributeNames5.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ? path33 : handler.name || "anonymous"
|
|
83074
83095
|
});
|
|
83075
83096
|
instrumentation.getConfig().responseHook?.(span);
|
|
83076
83097
|
return result2;
|
|
@@ -83079,7 +83100,7 @@ var HonoInstrumentation = class extends import_instrumentation27.Instrumentation
|
|
|
83079
83100
|
const type = instrumentation._determineHandlerType(result);
|
|
83080
83101
|
span.setAttributes({
|
|
83081
83102
|
[AttributeNames5.HONO_TYPE]: type,
|
|
83082
|
-
[AttributeNames5.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ?
|
|
83103
|
+
[AttributeNames5.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ? path33 : handler.name || "anonymous"
|
|
83083
83104
|
});
|
|
83084
83105
|
instrumentation.getConfig().responseHook?.(span);
|
|
83085
83106
|
return result;
|
|
@@ -83283,11 +83304,11 @@ var KoaInstrumentation = class extends import_instrumentation29.InstrumentationB
|
|
|
83283
83304
|
const router = dispatchLayer.router;
|
|
83284
83305
|
const routesStack = router?.stack ?? [];
|
|
83285
83306
|
for (const pathLayer of routesStack) {
|
|
83286
|
-
const
|
|
83307
|
+
const path33 = pathLayer.path;
|
|
83287
83308
|
const pathStack = pathLayer.stack;
|
|
83288
83309
|
for (let j = 0; j < pathStack.length; j++) {
|
|
83289
83310
|
const routedMiddleware = pathStack[j];
|
|
83290
|
-
pathStack[j] = this._patchLayer(routedMiddleware, true,
|
|
83311
|
+
pathStack[j] = this._patchLayer(routedMiddleware, true, path33);
|
|
83291
83312
|
}
|
|
83292
83313
|
}
|
|
83293
83314
|
return dispatchLayer;
|
|
@@ -85950,7 +85971,7 @@ import { createHmac } from "node:crypto";
|
|
|
85950
85971
|
// ../../apps/collector/src/http.ts
|
|
85951
85972
|
var import_undici = __toESM(require_undici(), 1);
|
|
85952
85973
|
var CLI_VERSION_HEADER = "x-powerplant-cli-version";
|
|
85953
|
-
var cliVersion = true ? "0.4.
|
|
85974
|
+
var cliVersion = true ? "0.4.14" : "0.0.0-checkout";
|
|
85954
85975
|
function cliVersionHeaders() {
|
|
85955
85976
|
return { [CLI_VERSION_HEADER]: cliVersion, "user-agent": `powerplant-cli/${cliVersion}` };
|
|
85956
85977
|
}
|
|
@@ -86074,8 +86095,8 @@ function createStructureDiagnostics() {
|
|
|
86074
86095
|
observe: (source) => (observation) => {
|
|
86075
86096
|
try {
|
|
86076
86097
|
const formatVersion = admitted("formatVersion", observation.formatVersion ?? null);
|
|
86077
|
-
const
|
|
86078
|
-
const key = [source,
|
|
86098
|
+
const path33 = observation.path.replace(/[^A-Za-z0-9_.$:/=[\]-]/g, "_").slice(0, 160) || "other";
|
|
86099
|
+
const key = [source, path33, observation.reason, observation.valueType, formatVersion].join("\0");
|
|
86079
86100
|
const count3 = observation.count ?? 1;
|
|
86080
86101
|
const existing = groups.get(key);
|
|
86081
86102
|
if (existing) {
|
|
@@ -86085,7 +86106,7 @@ function createStructureDiagnostics() {
|
|
|
86085
86106
|
if (samples.length >= MAX_STRUCTURE_DIAGNOSTICS) return;
|
|
86086
86107
|
const sample = {
|
|
86087
86108
|
source,
|
|
86088
|
-
path:
|
|
86109
|
+
path: path33,
|
|
86089
86110
|
reason: observation.reason,
|
|
86090
86111
|
valueType: observation.valueType,
|
|
86091
86112
|
formatVersion,
|
|
@@ -87170,21 +87191,21 @@ function createOmissionRecorder() {
|
|
|
87170
87191
|
const count3 = (reason, by = 1) => {
|
|
87171
87192
|
if (by > 0) counts[reason] = (counts[reason] ?? 0) + by;
|
|
87172
87193
|
};
|
|
87173
|
-
const shape = (reason,
|
|
87194
|
+
const shape = (reason, path33, valueType, formatVersion, by = 1) => {
|
|
87174
87195
|
if (!REPORTED_REASONS.has(reason)) return;
|
|
87175
|
-
const key = `${
|
|
87196
|
+
const key = `${path33}\0${reason}\0${valueType}\0${formatVersion ?? ""}`;
|
|
87176
87197
|
const group = groups.get(key);
|
|
87177
87198
|
if (group) group.count += by;
|
|
87178
87199
|
else if (groups.size < MAX_STRUCTURE_DIAGNOSTICS) {
|
|
87179
|
-
groups.set(key, { path:
|
|
87200
|
+
groups.set(key, { path: path33, reason, valueType, count: by, ...formatVersion !== void 0 && { formatVersion } });
|
|
87180
87201
|
}
|
|
87181
87202
|
};
|
|
87182
87203
|
return {
|
|
87183
87204
|
count: count3,
|
|
87184
87205
|
shape,
|
|
87185
|
-
note(reason,
|
|
87206
|
+
note(reason, path33, valueType, formatVersion) {
|
|
87186
87207
|
count3(reason);
|
|
87187
|
-
shape(reason,
|
|
87208
|
+
shape(reason, path33, valueType, formatVersion);
|
|
87188
87209
|
},
|
|
87189
87210
|
absorb(other) {
|
|
87190
87211
|
for (const [reason, by] of Object.entries(other.omissions())) {
|
|
@@ -87424,8 +87445,8 @@ var MODEL_INFO_FIELDS_INTERPRETED = /* @__PURE__ */ new Set(["modelName"]);
|
|
|
87424
87445
|
function collectUnfamiliar(record2, interpreted, excluded, prefix, into, recorder, formatVersion) {
|
|
87425
87446
|
for (const [key, value] of Object.entries(record2)) {
|
|
87426
87447
|
if (interpreted.has(key) || excluded.has(key)) continue;
|
|
87427
|
-
const
|
|
87428
|
-
into.set(
|
|
87448
|
+
const path33 = prefix === "" ? key : `${prefix}.${key}`;
|
|
87449
|
+
into.set(path33, value);
|
|
87429
87450
|
recorder.shape("unsupported", `bubble.${prefix === "" ? "" : `${prefix}.`}${nativeTypeLabel(key) ?? "other"}`, jsonValueType(value), formatVersion);
|
|
87430
87451
|
}
|
|
87431
87452
|
}
|
|
@@ -87511,8 +87532,8 @@ function bubbleLines(bubble, at, recorder) {
|
|
|
87511
87532
|
const formatVersion = typeof bubble._v === "number" || typeof bubble._v === "string" ? String(bubble._v) : void 0;
|
|
87512
87533
|
if (bubble.type !== 1 && bubble.type !== 2) {
|
|
87513
87534
|
const nativeType = nativeTypeLabel(String(bubble.type));
|
|
87514
|
-
const
|
|
87515
|
-
recorder.note("unsupported",
|
|
87535
|
+
const path33 = `bubble.type=${nativeType ?? "other"}`;
|
|
87536
|
+
recorder.note("unsupported", path33, jsonValueType(bubble.type), formatVersion);
|
|
87516
87537
|
const retained = Object.fromEntries(Object.entries(bubble).filter(([key]) => !BUBBLE_FIELDS_EXCLUDED.has(key)));
|
|
87517
87538
|
const bounded = boundUnfamiliarPayload(retained);
|
|
87518
87539
|
if (bounded.payload === void 0) recorder.count("truncated");
|
|
@@ -87863,12 +87884,12 @@ var CONTENT_LINE_TYPES2 = /* @__PURE__ */ new Set([
|
|
|
87863
87884
|
function parseCursorTranscriptFile(text) {
|
|
87864
87885
|
const lines = [];
|
|
87865
87886
|
const recorder = createOmissionRecorder();
|
|
87866
|
-
const retainUnsupported = (record2, at,
|
|
87887
|
+
const retainUnsupported = (record2, at, path33, discriminator) => {
|
|
87867
87888
|
const nativeType = nativeTypeLabel(discriminator);
|
|
87868
87889
|
const bounded = boundUnfamiliarPayload(record2);
|
|
87869
87890
|
lines.push({ type: "unsupported", ...nativeType !== void 0 && { nativeType }, ...at, ...bounded });
|
|
87870
|
-
recorder.note("unsupported", `${
|
|
87871
|
-
if (bounded.payload === void 0) recorder.note("truncated", `${
|
|
87891
|
+
recorder.note("unsupported", `${path33}=${nativeType ?? "other"}`, jsonValueType(discriminator));
|
|
87892
|
+
if (bounded.payload === void 0) recorder.note("truncated", `${path33}=${nativeType ?? "other"}`, "object");
|
|
87872
87893
|
};
|
|
87873
87894
|
text.split("\n").forEach((row, recordIndex) => {
|
|
87874
87895
|
if (!row.trim()) return;
|
|
@@ -87890,8 +87911,8 @@ function parseCursorTranscriptFile(text) {
|
|
|
87890
87911
|
}
|
|
87891
87912
|
const record2 = message.safeParse(value);
|
|
87892
87913
|
if (!record2.success) {
|
|
87893
|
-
const [
|
|
87894
|
-
retainUnsupported(value, { recordIndex },
|
|
87914
|
+
const [path33, discriminator] = typeof value.type === "string" ? ["record.type", value.type] : typeof value.role === "string" ? ["message.role", value.role] : ["record", void 0];
|
|
87915
|
+
retainUnsupported(value, { recordIndex }, path33, discriminator);
|
|
87895
87916
|
return;
|
|
87896
87917
|
}
|
|
87897
87918
|
const role = record2.data.role;
|
|
@@ -91749,6 +91770,7 @@ async function readLocalSessionFacts(sessions, onError2, home = os17.homedir(),
|
|
|
91749
91770
|
if (file2 === null || !existsSync9(file2)) continue;
|
|
91750
91771
|
const db = await openLocalDatabase(file2);
|
|
91751
91772
|
try {
|
|
91773
|
+
db.prepare("pragma busy_timeout = 250").get();
|
|
91752
91774
|
const columns = new Set(
|
|
91753
91775
|
external_exports.array(external_exports.object({ name: external_exports.string() })).parse(db.prepare(`pragma table_info(${store.table})`).all()).map((column) => column.name)
|
|
91754
91776
|
);
|
|
@@ -91817,7 +91839,90 @@ function localSessionKey(session) {
|
|
|
91817
91839
|
return JSON.stringify([session.source, session.externalId]);
|
|
91818
91840
|
}
|
|
91819
91841
|
|
|
91842
|
+
// src/mcpPreferences.ts
|
|
91843
|
+
var preferenceSchema = external_exports.object({
|
|
91844
|
+
optedIn: external_exports.boolean().optional(),
|
|
91845
|
+
dismissedWarning: mcpWarningSchema.optional()
|
|
91846
|
+
});
|
|
91847
|
+
var preferencesSchema = external_exports.object({
|
|
91848
|
+
version: external_exports.literal(1),
|
|
91849
|
+
clients: external_exports.object({
|
|
91850
|
+
claude: preferenceSchema.optional(),
|
|
91851
|
+
codex: preferenceSchema.optional(),
|
|
91852
|
+
cursor: preferenceSchema.optional()
|
|
91853
|
+
})
|
|
91854
|
+
});
|
|
91855
|
+
var emptyMcpPreferences = () => ({ version: 1, clients: {} });
|
|
91856
|
+
function mcpPreferencesPath(appEnv, home) {
|
|
91857
|
+
return path21.join(collectorStateDir(home), `mcp-preferences-${appEnv}.json`);
|
|
91858
|
+
}
|
|
91859
|
+
function readMcpPreferences(appEnv, home) {
|
|
91860
|
+
const file2 = mcpPreferencesPath(appEnv, home);
|
|
91861
|
+
try {
|
|
91862
|
+
return preferencesSchema.parse(JSON.parse(readFileSync11(file2, "utf8")));
|
|
91863
|
+
} catch (error63) {
|
|
91864
|
+
if (error63 instanceof Error && "code" in error63 && error63.code === "ENOENT") return emptyMcpPreferences();
|
|
91865
|
+
throw new ExpectedCliError(`Cannot read MCP preferences at ${file2}. Restore or remove that file, then retry.`, { cause: error63 });
|
|
91866
|
+
}
|
|
91867
|
+
}
|
|
91868
|
+
function writeMcpPreferences(appEnv, preferences, home) {
|
|
91869
|
+
const file2 = mcpPreferencesPath(appEnv, home);
|
|
91870
|
+
mkdirSync10(path21.dirname(file2), { recursive: true });
|
|
91871
|
+
const temporary = `${file2}.${process.pid}.tmp`;
|
|
91872
|
+
writeFileSync9(temporary, JSON.stringify(preferencesSchema.parse(preferences), null, 2), { mode: 384 });
|
|
91873
|
+
renameSync5(temporary, file2);
|
|
91874
|
+
}
|
|
91875
|
+
function recordMcpChoices(appEnv, offered, selected, home) {
|
|
91876
|
+
const preferences = readMcpPreferences(appEnv, home);
|
|
91877
|
+
for (const client of offered) {
|
|
91878
|
+
preferences.clients[client] = { optedIn: selected.includes(client) };
|
|
91879
|
+
}
|
|
91880
|
+
writeMcpPreferences(appEnv, preferences, home);
|
|
91881
|
+
}
|
|
91882
|
+
function recordMcpConnectChoices(appEnv, detected, requested, home) {
|
|
91883
|
+
const chosen = requested === void 0 ? detected : detected.filter((client) => requested.has(client));
|
|
91884
|
+
recordMcpChoices(appEnv, chosen, chosen, home);
|
|
91885
|
+
}
|
|
91886
|
+
function readMcpPreferencesForMenu(appEnv, home) {
|
|
91887
|
+
try {
|
|
91888
|
+
return { mcpPreferences: readMcpPreferences(appEnv, home) };
|
|
91889
|
+
} catch (error63) {
|
|
91890
|
+
if (!(error63 instanceof ExpectedCliError)) throw error63;
|
|
91891
|
+
return { mcpPreferencesError: error63.message };
|
|
91892
|
+
}
|
|
91893
|
+
}
|
|
91894
|
+
function dismissMcpWarning(appEnv, event, home) {
|
|
91895
|
+
const preferences = readMcpPreferences(appEnv, home);
|
|
91896
|
+
const previous = preferences.clients[event.client];
|
|
91897
|
+
if (previous?.dismissedWarning === event.warning) return false;
|
|
91898
|
+
preferences.clients[event.client] = { ...previous, dismissedWarning: event.warning };
|
|
91899
|
+
writeMcpPreferences(appEnv, preferences, home);
|
|
91900
|
+
return true;
|
|
91901
|
+
}
|
|
91902
|
+
|
|
91903
|
+
// src/menubarAnalytics.ts
|
|
91904
|
+
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
91905
|
+
async function reportMenubarEvent(event, credentials, warn2, fetchImpl = fetch) {
|
|
91906
|
+
if (credentials === null) return false;
|
|
91907
|
+
const runId = randomUUID3();
|
|
91908
|
+
let status;
|
|
91909
|
+
try {
|
|
91910
|
+
const response = await fetchImpl(`${credentials.apiUrl}/api/collector/menubar-events`, {
|
|
91911
|
+
method: "POST",
|
|
91912
|
+
headers: { authorization: `Bearer ${credentials.token}`, "content-type": "application/json", ...cliVersionHeaders() },
|
|
91913
|
+
body: JSON.stringify(event),
|
|
91914
|
+
signal: AbortSignal.timeout(3e3)
|
|
91915
|
+
});
|
|
91916
|
+
if (response.ok) return true;
|
|
91917
|
+
status = response.status;
|
|
91918
|
+
} catch {
|
|
91919
|
+
}
|
|
91920
|
+
warn2(JSON.stringify({ level: "warn", runId, operation: "menubar-analytics", outcome: status === void 0 ? "unavailable" : "refused", ...status === void 0 ? {} : { status } }));
|
|
91921
|
+
return false;
|
|
91922
|
+
}
|
|
91923
|
+
|
|
91820
91924
|
// src/clientFailure.ts
|
|
91925
|
+
import { constants } from "node:os";
|
|
91821
91926
|
function clientFailure(error63) {
|
|
91822
91927
|
if (error63 instanceof ExpectedCliError) {
|
|
91823
91928
|
return { outcome: "failed", domain: "Powerplant", code: "EXPECTED_CLI_OUTCOME" };
|
|
@@ -91835,14 +91940,14 @@ function nativeFailureRecord(error63) {
|
|
|
91835
91940
|
|
|
91836
91941
|
// src/desktopDiagnostics.ts
|
|
91837
91942
|
import os19 from "node:os";
|
|
91838
|
-
import
|
|
91943
|
+
import path23 from "node:path";
|
|
91839
91944
|
|
|
91840
91945
|
// src/memberSessions.ts
|
|
91841
91946
|
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
91842
91947
|
import { existsSync as existsSync10 } from "node:fs";
|
|
91843
91948
|
import { open as open2, readdir as readdir2 } from "node:fs/promises";
|
|
91844
91949
|
import os18 from "node:os";
|
|
91845
|
-
import
|
|
91950
|
+
import path22 from "node:path";
|
|
91846
91951
|
var memberSessionSchema = external_exports.object({
|
|
91847
91952
|
id: external_exports.string().min(1),
|
|
91848
91953
|
source: external_exports.string().min(1),
|
|
@@ -91959,10 +92064,10 @@ function detectClaudeDesktop(probe) {
|
|
|
91959
92064
|
return detectDesktopScheme(["Claude.app"], "claude", probe);
|
|
91960
92065
|
}
|
|
91961
92066
|
function detectDesktopScheme(bundles, scheme, probe = { exists: existsSync10, readUrlSchemes: realReadUrlSchemes }) {
|
|
91962
|
-
const roots = ["/Applications",
|
|
92067
|
+
const roots = ["/Applications", path22.join(os18.homedir(), "Applications")];
|
|
91963
92068
|
return roots.some(
|
|
91964
92069
|
(root) => bundles.some((bundle) => {
|
|
91965
|
-
const bundlePath =
|
|
92070
|
+
const bundlePath = path22.join(root, bundle);
|
|
91966
92071
|
return probe.exists(bundlePath) && probe.readUrlSchemes(bundlePath).includes(scheme);
|
|
91967
92072
|
})
|
|
91968
92073
|
);
|
|
@@ -91972,7 +92077,7 @@ function realReadUrlSchemes(bundlePath) {
|
|
|
91972
92077
|
try {
|
|
91973
92078
|
const json2 = execFileSync4(
|
|
91974
92079
|
"plutil",
|
|
91975
|
-
["-extract", "CFBundleURLTypes", "json", "-o", "-",
|
|
92080
|
+
["-extract", "CFBundleURLTypes", "json", "-o", "-", path22.join(bundlePath, "Contents", "Info.plist")],
|
|
91976
92081
|
{ stdio: ["ignore", "pipe", "ignore"] }
|
|
91977
92082
|
).toString();
|
|
91978
92083
|
const parsed = urlSchemesSchema.safeParse(JSON.parse(json2));
|
|
@@ -91991,7 +92096,7 @@ var claudeDesktopSessionSchema = external_exports.object({
|
|
|
91991
92096
|
* and still links: the flag must never cost the row its desktop link. */
|
|
91992
92097
|
isArchived: external_exports.unknown().optional()
|
|
91993
92098
|
});
|
|
91994
|
-
async function readClaudeDesktopSessions(wanted, root =
|
|
92099
|
+
async function readClaudeDesktopSessions(wanted, root = path22.join(os18.homedir(), "Library/Application Support/Claude/claude-code-sessions")) {
|
|
91995
92100
|
const sessions = /* @__PURE__ */ new Map();
|
|
91996
92101
|
const ambiguous = /* @__PURE__ */ new Set();
|
|
91997
92102
|
if (wanted.size === 0) return sessions;
|
|
@@ -92002,7 +92107,7 @@ async function readClaudeDesktopSessions(wanted, root = path21.join(os18.homedir
|
|
|
92002
92107
|
throw error63;
|
|
92003
92108
|
});
|
|
92004
92109
|
for (const entry of entries) {
|
|
92005
|
-
const file2 =
|
|
92110
|
+
const file2 = path22.join(directory, entry.name);
|
|
92006
92111
|
if (entry.isDirectory() && depth < 2) {
|
|
92007
92112
|
await visit3(file2, depth + 1);
|
|
92008
92113
|
} else if (depth === 2 && entry.isFile() && /^local_.*\.json$/.test(entry.name)) {
|
|
@@ -92042,7 +92147,7 @@ function isMissingFile(error63) {
|
|
|
92042
92147
|
}
|
|
92043
92148
|
|
|
92044
92149
|
// src/desktopDiagnostics.ts
|
|
92045
|
-
async function probeClaudeDesktopSessions(wanted, installed, reportFault, root =
|
|
92150
|
+
async function probeClaudeDesktopSessions(wanted, installed, reportFault, root = path23.join(os19.homedir(), "Library/Application Support/Claude/claude-code-sessions"), read = readClaudeDesktopSessions) {
|
|
92046
92151
|
if (!installed || wanted.size === 0) {
|
|
92047
92152
|
return { sessions: /* @__PURE__ */ new Map(), diagnostic: { outcome: "not-needed" } };
|
|
92048
92153
|
}
|
|
@@ -92059,24 +92164,25 @@ async function probeClaudeDesktopSessions(wanted, installed, reportFault, root =
|
|
|
92059
92164
|
|
|
92060
92165
|
// src/cli.ts
|
|
92061
92166
|
import { spawn as spawn3 } from "node:child_process";
|
|
92062
|
-
import {
|
|
92063
|
-
import
|
|
92167
|
+
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
92168
|
+
import { existsSync as existsSync14, mkdirSync as mkdirSync15, openSync as openSync9, realpathSync as realpathSync5, rmSync as rmSync7 } from "node:fs";
|
|
92169
|
+
import path32 from "node:path";
|
|
92064
92170
|
import { parseArgs } from "node:util";
|
|
92065
92171
|
|
|
92066
92172
|
// src/connect.ts
|
|
92067
92173
|
import { execFileSync as execFileSync5, spawnSync } from "node:child_process";
|
|
92068
92174
|
import {
|
|
92069
92175
|
existsSync as existsSync11,
|
|
92070
|
-
mkdirSync as
|
|
92176
|
+
mkdirSync as mkdirSync11,
|
|
92071
92177
|
mkdtempSync,
|
|
92072
92178
|
readdirSync as readdirSync5,
|
|
92073
|
-
readFileSync as
|
|
92179
|
+
readFileSync as readFileSync12,
|
|
92074
92180
|
realpathSync as realpathSync4,
|
|
92075
92181
|
statSync as statSync5,
|
|
92076
|
-
writeFileSync as
|
|
92182
|
+
writeFileSync as writeFileSync10
|
|
92077
92183
|
} from "node:fs";
|
|
92078
92184
|
import os20 from "node:os";
|
|
92079
|
-
import
|
|
92185
|
+
import path24 from "node:path";
|
|
92080
92186
|
import { emitKeypressEvents } from "node:readline";
|
|
92081
92187
|
|
|
92082
92188
|
// src/agentVersions.ts
|
|
@@ -92150,7 +92256,7 @@ function startTimeBudget(totalMs, now = Date.now) {
|
|
|
92150
92256
|
return { remainingMs: () => Math.max(0, deadline - now()) };
|
|
92151
92257
|
}
|
|
92152
92258
|
function defaultApplicationsDirs(homeDir) {
|
|
92153
|
-
return process.platform === "darwin" ? ["/Applications",
|
|
92259
|
+
return process.platform === "darwin" ? ["/Applications", path24.join(homeDir, "Applications")] : [];
|
|
92154
92260
|
}
|
|
92155
92261
|
function detectClients(options = {}) {
|
|
92156
92262
|
const homeDir = options.homeDir ?? os20.homedir();
|
|
@@ -92178,7 +92284,7 @@ function detectClients(options = {}) {
|
|
|
92178
92284
|
clients.push({ client, bin, ...configDir !== void 0 && { configDir } });
|
|
92179
92285
|
};
|
|
92180
92286
|
for (const bin of whichAll("claude")) add("claude", bin);
|
|
92181
|
-
const localClaude =
|
|
92287
|
+
const localClaude = path24.join(homeDir, ".local", "bin", "claude");
|
|
92182
92288
|
if (existsSync11(localClaude)) add("claude", localClaude);
|
|
92183
92289
|
for (const bin of desktopClaudeBinaries(homeDir)) add("claude", bin);
|
|
92184
92290
|
const claudeBins = clients.filter((client) => client.client === "claude" && client.configDir === void 0).map((client) => client.bin);
|
|
@@ -92186,12 +92292,12 @@ function detectClients(options = {}) {
|
|
|
92186
92292
|
for (const bin of claudeBins) add("claude", bin, configDir);
|
|
92187
92293
|
}
|
|
92188
92294
|
for (const bin of whichAll("codex")) add("codex", bin);
|
|
92189
|
-
const localCodex =
|
|
92295
|
+
const localCodex = path24.join(homeDir, ".local", "bin", "codex");
|
|
92190
92296
|
if (existsSync11(localCodex)) add("codex", localCodex);
|
|
92191
92297
|
for (const bin of codexBundleBinaries(applicationsDirs, bundleSeams)) add("codex", bin);
|
|
92192
|
-
const cursorDir =
|
|
92193
|
-
if (existsSync11(cursorDir) || cursorAppInstalled(applicationsDirs, bundleSeams)) {
|
|
92194
|
-
clients.push({ client: "cursor", bin:
|
|
92298
|
+
const cursorDir = path24.join(homeDir, ".cursor");
|
|
92299
|
+
if (!options.requireCursorApp && existsSync11(cursorDir) || cursorAppInstalled(applicationsDirs, bundleSeams)) {
|
|
92300
|
+
clients.push({ client: "cursor", bin: path24.join(cursorDir, "mcp.json") });
|
|
92195
92301
|
}
|
|
92196
92302
|
return clients;
|
|
92197
92303
|
}
|
|
@@ -92199,7 +92305,7 @@ function claudeConfigHomes(homeDir, env) {
|
|
|
92199
92305
|
const homes = [];
|
|
92200
92306
|
const seen = /* @__PURE__ */ new Set();
|
|
92201
92307
|
try {
|
|
92202
|
-
seen.add(realpathSync4(
|
|
92308
|
+
seen.add(realpathSync4(path24.join(homeDir, ".claude")));
|
|
92203
92309
|
} catch {
|
|
92204
92310
|
}
|
|
92205
92311
|
const add = (configDir) => {
|
|
@@ -92211,7 +92317,7 @@ function claudeConfigHomes(homeDir, env) {
|
|
|
92211
92317
|
}
|
|
92212
92318
|
if (seen.has(real)) return;
|
|
92213
92319
|
seen.add(real);
|
|
92214
|
-
homes.push(
|
|
92320
|
+
homes.push(path24.resolve(configDir));
|
|
92215
92321
|
};
|
|
92216
92322
|
let entries = [];
|
|
92217
92323
|
try {
|
|
@@ -92219,8 +92325,8 @@ function claudeConfigHomes(homeDir, env) {
|
|
|
92219
92325
|
} catch {
|
|
92220
92326
|
}
|
|
92221
92327
|
for (const entry of entries.sort()) {
|
|
92222
|
-
if (entry.startsWith(".claude-") && existsSync11(
|
|
92223
|
-
add(
|
|
92328
|
+
if (entry.startsWith(".claude-") && existsSync11(path24.join(homeDir, entry, ".claude.json"))) {
|
|
92329
|
+
add(path24.join(homeDir, entry));
|
|
92224
92330
|
}
|
|
92225
92331
|
}
|
|
92226
92332
|
if (env.CLAUDE_CONFIG_DIR) add(env.CLAUDE_CONFIG_DIR);
|
|
@@ -92248,7 +92354,7 @@ function appBundles(applicationsDirs, namePrefixes) {
|
|
|
92248
92354
|
for (const entry of entries) {
|
|
92249
92355
|
if (!entry.endsWith(".app")) continue;
|
|
92250
92356
|
if (!namePrefixes.some((prefix) => entry.startsWith(prefix))) continue;
|
|
92251
|
-
bundles.push(
|
|
92357
|
+
bundles.push(path24.join(dir, entry));
|
|
92252
92358
|
}
|
|
92253
92359
|
}
|
|
92254
92360
|
return bundles;
|
|
@@ -92268,7 +92374,7 @@ function codexBundleBinaries(applicationsDirs, seams) {
|
|
|
92268
92374
|
const infoTimeoutMs = budgetedTimeout(BUNDLE_INFO_TIMEOUT_MS, appDir, seams);
|
|
92269
92375
|
if (infoTimeoutMs === null) continue;
|
|
92270
92376
|
if (seams.readBundleInfo(appDir, infoTimeoutMs)?.bundleId !== CODEX_BUNDLE_ID) continue;
|
|
92271
|
-
const bin =
|
|
92377
|
+
const bin = path24.join(appDir, "Contents", "Resources", "codex");
|
|
92272
92378
|
if (!isExecutableFile(bin)) continue;
|
|
92273
92379
|
if (!signedByTeam(bin, OPENAI_TEAM_ID, "OpenAI", appDir, seams)) continue;
|
|
92274
92380
|
found.push(bin);
|
|
@@ -92280,7 +92386,7 @@ function trustedCursorBundle(appDir, seams) {
|
|
|
92280
92386
|
if (infoTimeoutMs === null) return null;
|
|
92281
92387
|
const info = seams.readBundleInfo(appDir, infoTimeoutMs);
|
|
92282
92388
|
if (info?.executable === void 0) return null;
|
|
92283
|
-
const bin =
|
|
92389
|
+
const bin = path24.join(appDir, "Contents", "MacOS", info.executable);
|
|
92284
92390
|
if (!isExecutableFile(bin)) return null;
|
|
92285
92391
|
if (!signedByTeam(bin, CURSOR_TEAM_ID, "Cursor", appDir, seams)) return null;
|
|
92286
92392
|
return info;
|
|
@@ -92317,7 +92423,7 @@ var bundleInfoSchema = external_exports.object({
|
|
|
92317
92423
|
function realReadBundleInfo(appDir, timeoutMs) {
|
|
92318
92424
|
const result = spawnSync(
|
|
92319
92425
|
"plutil",
|
|
92320
|
-
["-convert", "json", "-o", "-",
|
|
92426
|
+
["-convert", "json", "-o", "-", path24.join(appDir, "Contents", "Info.plist")],
|
|
92321
92427
|
{ encoding: "utf8", timeout: timeoutMs }
|
|
92322
92428
|
);
|
|
92323
92429
|
if (result.status !== 0) return null;
|
|
@@ -92339,14 +92445,14 @@ function realVerifySignature(binPath, teamId, timeoutMs) {
|
|
|
92339
92445
|
}).status === 0;
|
|
92340
92446
|
}
|
|
92341
92447
|
function desktopClaudeBinaries(homeDir) {
|
|
92342
|
-
const root =
|
|
92448
|
+
const root = path24.join(homeDir, "Library", "Application Support", "Claude", "claude-code");
|
|
92343
92449
|
let versions;
|
|
92344
92450
|
try {
|
|
92345
92451
|
versions = readdirSync5(root);
|
|
92346
92452
|
} catch {
|
|
92347
92453
|
return [];
|
|
92348
92454
|
}
|
|
92349
|
-
return versions.map((version2) =>
|
|
92455
|
+
return versions.map((version2) => path24.join(root, version2, "claude.app", "Contents", "MacOS", "claude")).filter((bin) => existsSync11(bin));
|
|
92350
92456
|
}
|
|
92351
92457
|
function defaultWhichAll(name) {
|
|
92352
92458
|
try {
|
|
@@ -92468,7 +92574,9 @@ async function pickAgents(clients, deps) {
|
|
|
92468
92574
|
const kept = new Set(selected);
|
|
92469
92575
|
const skippedNames = products.filter((product) => !kept.has(product)).map((product) => AGENT_DISPLAY_NAMES[product]);
|
|
92470
92576
|
if (skippedNames.length > 0) deps.log(`Skipping ${skippedNames.join(" and ")}.`);
|
|
92471
|
-
|
|
92577
|
+
const chosen = clients.filter((client) => kept.has(client.client));
|
|
92578
|
+
deps.onChoice?.(chosen);
|
|
92579
|
+
return chosen;
|
|
92472
92580
|
}
|
|
92473
92581
|
function realCheckboxPrompt(question, choices, seams = {}) {
|
|
92474
92582
|
const input2 = seams.input ?? process.stdin;
|
|
@@ -92939,7 +93047,9 @@ function runDisconnect(clients, deps) {
|
|
|
92939
93047
|
const results = [...groupByConnectionTarget(candidates).values()].map(
|
|
92940
93048
|
(targetCandidates) => disconnectTarget(agent, targetCandidates, deps)
|
|
92941
93049
|
);
|
|
92942
|
-
|
|
93050
|
+
const state = aggregateDisconnectTargets(results);
|
|
93051
|
+
outcome[state] += 1;
|
|
93052
|
+
if (state !== "failed") deps.onDisconnected?.(agent);
|
|
92943
93053
|
}
|
|
92944
93054
|
return outcome;
|
|
92945
93055
|
}
|
|
@@ -93045,11 +93155,11 @@ function anyClientStillConnected(clients, deps) {
|
|
|
93045
93155
|
});
|
|
93046
93156
|
}
|
|
93047
93157
|
function describeBinary(bin) {
|
|
93048
|
-
return `${
|
|
93158
|
+
return `${path24.basename(bin)} (${bin.replace(os20.homedir(), "~")})`;
|
|
93049
93159
|
}
|
|
93050
93160
|
function describeClaudeTarget(client) {
|
|
93051
93161
|
if (client.configDir === void 0) return describeBinary(client.bin);
|
|
93052
|
-
return `${
|
|
93162
|
+
return `${path24.basename(client.bin)} (${client.configDir.replace(os20.homedir(), "~")})`;
|
|
93053
93163
|
}
|
|
93054
93164
|
var FAILURE_DETAIL_MAX_CHARS = 200;
|
|
93055
93165
|
function describeFailure(result) {
|
|
@@ -93062,7 +93172,7 @@ function describeFailure(result) {
|
|
|
93062
93172
|
}
|
|
93063
93173
|
var neutralDirMemo;
|
|
93064
93174
|
function neutralWorkdir() {
|
|
93065
|
-
neutralDirMemo ??= mkdtempSync(
|
|
93175
|
+
neutralDirMemo ??= mkdtempSync(path24.join(os20.tmpdir(), "powerplant-connect-"));
|
|
93066
93176
|
return neutralDirMemo;
|
|
93067
93177
|
}
|
|
93068
93178
|
async function fetchOfficialClients(apiUrl, log3) {
|
|
@@ -93092,25 +93202,25 @@ async function fetchOfficialClients(apiUrl, log3) {
|
|
|
93092
93202
|
}
|
|
93093
93203
|
function realReadTextFile(filePath) {
|
|
93094
93204
|
try {
|
|
93095
|
-
return
|
|
93205
|
+
return readFileSync12(filePath, "utf8");
|
|
93096
93206
|
} catch {
|
|
93097
93207
|
return null;
|
|
93098
93208
|
}
|
|
93099
93209
|
}
|
|
93100
93210
|
function realReadTextFileStrict(filePath) {
|
|
93101
93211
|
try {
|
|
93102
|
-
return
|
|
93212
|
+
return readFileSync12(filePath, "utf8");
|
|
93103
93213
|
} catch (error63) {
|
|
93104
93214
|
if (error63 instanceof Error && error63.code === "ENOENT") return null;
|
|
93105
93215
|
throw error63;
|
|
93106
93216
|
}
|
|
93107
93217
|
}
|
|
93108
93218
|
function realWriteTextFile(filePath, content) {
|
|
93109
|
-
|
|
93110
|
-
|
|
93219
|
+
mkdirSync11(path24.dirname(filePath), { recursive: true });
|
|
93220
|
+
writeFileSync10(filePath, content);
|
|
93111
93221
|
}
|
|
93112
93222
|
function codexConfigPath(homeDir = os20.homedir()) {
|
|
93113
|
-
return
|
|
93223
|
+
return path24.join(process.env.CODEX_HOME ?? path24.join(homeDir, ".codex"), "config.toml");
|
|
93114
93224
|
}
|
|
93115
93225
|
function realOpenUrl(url2) {
|
|
93116
93226
|
const bin = process.platform === "darwin" ? "open" : process.platform === "linux" ? "xdg-open" : null;
|
|
@@ -93171,8 +93281,8 @@ function realRunInteractive(bin, args, env) {
|
|
|
93171
93281
|
|
|
93172
93282
|
// src/connections.ts
|
|
93173
93283
|
import { execFileSync as execFileSync6, spawnSync as spawnSync2 } from "node:child_process";
|
|
93174
|
-
import { mkdirSync as
|
|
93175
|
-
import
|
|
93284
|
+
import { mkdirSync as mkdirSync12, writeFileSync as writeFileSync11 } from "node:fs";
|
|
93285
|
+
import path25 from "node:path";
|
|
93176
93286
|
function probeConnections(clients, deps) {
|
|
93177
93287
|
const reports = [];
|
|
93178
93288
|
for (const kind of ["claude", "codex", "cursor"]) {
|
|
@@ -93216,7 +93326,7 @@ function aggregateClaudeTargets(targets) {
|
|
|
93216
93326
|
if (targets.length === 1 || worst.report.state === "signed-in") return worst.report;
|
|
93217
93327
|
return {
|
|
93218
93328
|
...worst.report,
|
|
93219
|
-
target: worst.configDir === void 0 ? "default profile" :
|
|
93329
|
+
target: worst.configDir === void 0 ? "default profile" : path25.basename(worst.configDir)
|
|
93220
93330
|
};
|
|
93221
93331
|
}
|
|
93222
93332
|
function probeClient(client, deps) {
|
|
@@ -93295,12 +93405,12 @@ var detectedClientsSchema = external_exports.object({
|
|
|
93295
93405
|
)
|
|
93296
93406
|
});
|
|
93297
93407
|
function detectedClientsPath(homeDir) {
|
|
93298
|
-
return
|
|
93408
|
+
return path25.join(collectorStateDir(homeDir), "detected-clients.json");
|
|
93299
93409
|
}
|
|
93300
93410
|
function saveDetectedClients(clients, pathValue, homeDir) {
|
|
93301
93411
|
try {
|
|
93302
93412
|
const file2 = detectedClientsPath(homeDir);
|
|
93303
|
-
|
|
93413
|
+
mkdirSync12(path25.dirname(file2), { recursive: true });
|
|
93304
93414
|
const record2 = {
|
|
93305
93415
|
detectedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
93306
93416
|
path: pathValue,
|
|
@@ -93310,7 +93420,7 @@ function saveDetectedClients(clients, pathValue, homeDir) {
|
|
|
93310
93420
|
...configDir !== void 0 && { configDir }
|
|
93311
93421
|
}))
|
|
93312
93422
|
};
|
|
93313
|
-
|
|
93423
|
+
writeFileSync11(file2, JSON.stringify(record2, null, 2));
|
|
93314
93424
|
} catch {
|
|
93315
93425
|
}
|
|
93316
93426
|
}
|
|
@@ -93332,7 +93442,7 @@ function mergeDetectedClients(detected, saved, exists) {
|
|
|
93332
93442
|
const known = new Set(detected.map(key));
|
|
93333
93443
|
const revived = saved.clients.filter((client) => {
|
|
93334
93444
|
const clientKey = key(client);
|
|
93335
|
-
if (known.has(clientKey) || client.bin.includes(".app/") || !exists(client.bin) || client.configDir !== void 0 && !exists(client.configDir)) {
|
|
93445
|
+
if (known.has(clientKey) || client.client === "cursor" || client.bin.includes(".app/") || !exists(client.bin) || client.configDir !== void 0 && !exists(client.configDir)) {
|
|
93336
93446
|
return false;
|
|
93337
93447
|
}
|
|
93338
93448
|
known.add(clientKey);
|
|
@@ -93387,7 +93497,7 @@ function whichAllWith(pathValue) {
|
|
|
93387
93497
|
import { closeSync as closeSync7, fstatSync, openSync as openSync7, readSync as readSync5 } from "node:fs";
|
|
93388
93498
|
|
|
93389
93499
|
// src/update.ts
|
|
93390
|
-
import
|
|
93500
|
+
import path27 from "node:path";
|
|
93391
93501
|
|
|
93392
93502
|
// src/duration.ts
|
|
93393
93503
|
function duration3(ms) {
|
|
@@ -93405,11 +93515,11 @@ function ago(ms) {
|
|
|
93405
93515
|
}
|
|
93406
93516
|
|
|
93407
93517
|
// src/installOwner.ts
|
|
93408
|
-
import { accessSync, constants as constants2, readFileSync as
|
|
93409
|
-
import
|
|
93518
|
+
import { accessSync, constants as constants2, readFileSync as readFileSync13 } from "node:fs";
|
|
93519
|
+
import path26 from "node:path";
|
|
93410
93520
|
|
|
93411
93521
|
// src/version.ts
|
|
93412
|
-
var CLI_VERSION = true ? "0.4.
|
|
93522
|
+
var CLI_VERSION = true ? "0.4.14" : "0.0.0-checkout";
|
|
93413
93523
|
var CLI_RELEASE_BUILD = true ? true : false;
|
|
93414
93524
|
var CLI_PACKAGE_NAME = "@usepowerplant/cli";
|
|
93415
93525
|
|
|
@@ -93433,13 +93543,13 @@ function inspectInstall(entryPath2, env) {
|
|
|
93433
93543
|
inPlace: { ok: false, reason: `the install at ${packageDir} isn't a layout this CLI recognises` }
|
|
93434
93544
|
};
|
|
93435
93545
|
}
|
|
93436
|
-
const modulesDir =
|
|
93437
|
-
const prefix = manager === "npm" ?
|
|
93546
|
+
const modulesDir = path26.dirname(path26.dirname(packageDir));
|
|
93547
|
+
const prefix = manager === "npm" ? path26.dirname(path26.dirname(modulesDir)) : null;
|
|
93438
93548
|
const group = /^(.*\/global\/v11\/[^/]+)\/node_modules\//.exec(packageDir)?.[1];
|
|
93439
93549
|
if (manager === "pnpm" && group !== void 0) {
|
|
93440
93550
|
let dependencies = [];
|
|
93441
93551
|
try {
|
|
93442
|
-
const raw = env.readTextFile?.(
|
|
93552
|
+
const raw = env.readTextFile?.(path26.join(group, "package.json"));
|
|
93443
93553
|
const manifest = external_exports.object({ dependencies: external_exports.record(external_exports.string(), external_exports.string()) }).parse(JSON.parse(raw ?? "null"));
|
|
93444
93554
|
dependencies = Object.keys(manifest.dependencies);
|
|
93445
93555
|
} catch {
|
|
@@ -93466,7 +93576,7 @@ function detectManager(packageDir, pnpmHome) {
|
|
|
93466
93576
|
return null;
|
|
93467
93577
|
}
|
|
93468
93578
|
function linkedEntryPath(realEntryPath, invokedEntryPath) {
|
|
93469
|
-
if (invokedEntryPath !== void 0 && /\/global\/v11\/[^/]+\/node_modules\//.test(invokedEntryPath) && invokedEntryPath.endsWith(`${PACKAGE_SEGMENT}dist/cli.js`)) return
|
|
93579
|
+
if (invokedEntryPath !== void 0 && /\/global\/v11\/[^/]+\/node_modules\//.test(invokedEntryPath) && invokedEntryPath.endsWith(`${PACKAGE_SEGMENT}dist/cli.js`)) return path26.normalize(invokedEntryPath);
|
|
93470
93580
|
const store = realEntryPath.lastIndexOf("/.pnpm/");
|
|
93471
93581
|
if (store === -1) return realEntryPath;
|
|
93472
93582
|
const at = realEntryPath.indexOf(PACKAGE_SEGMENT, store);
|
|
@@ -93493,7 +93603,7 @@ function manualUpdateCommand(manager, version2, prefix = null, channel3 = "lates
|
|
|
93493
93603
|
return [bin, ...args].join(" ");
|
|
93494
93604
|
}
|
|
93495
93605
|
function installedVersion(packageDir, readTextFile) {
|
|
93496
|
-
const raw = readTextFile(
|
|
93606
|
+
const raw = readTextFile(path26.join(packageDir, "package.json"));
|
|
93497
93607
|
if (raw === null) return null;
|
|
93498
93608
|
try {
|
|
93499
93609
|
const parsed = JSON.parse(raw);
|
|
@@ -93510,7 +93620,7 @@ function realInspectEnvironment() {
|
|
|
93510
93620
|
pnpmHome: process.env.PNPM_HOME,
|
|
93511
93621
|
readTextFile: (file2) => {
|
|
93512
93622
|
try {
|
|
93513
|
-
return
|
|
93623
|
+
return readFileSync13(file2, "utf8");
|
|
93514
93624
|
} catch (error63) {
|
|
93515
93625
|
if (error63 instanceof Error && "code" in error63 && error63.code === "ENOENT") return null;
|
|
93516
93626
|
throw error63;
|
|
@@ -93559,10 +93669,10 @@ function releaseNotServed(managerOutput) {
|
|
|
93559
93669
|
return /\bETARGET\b|\bnotarget\b|ERR_PNPM_NO_MATCHING_VERSION/.test(managerOutput);
|
|
93560
93670
|
}
|
|
93561
93671
|
function updateProgressPath(homeDir) {
|
|
93562
|
-
return
|
|
93672
|
+
return path27.join(collectorStateDir(homeDir), "cli-update.json");
|
|
93563
93673
|
}
|
|
93564
93674
|
function updateLogPath(homeDir) {
|
|
93565
|
-
return
|
|
93675
|
+
return path27.join(collectorStateDir(homeDir), "cli-update.log");
|
|
93566
93676
|
}
|
|
93567
93677
|
function readUpdateProgress(readTextFile, file2 = updateProgressPath()) {
|
|
93568
93678
|
const raw = readTextFile(file2);
|
|
@@ -93792,13 +93902,13 @@ function redactedLogTail(raw) {
|
|
|
93792
93902
|
while (lines.length > 0 && lines[lines.length - 1]?.trim() === "") lines.pop();
|
|
93793
93903
|
return lines.slice(-DOCTOR_LOG_TAIL_LINES);
|
|
93794
93904
|
}
|
|
93795
|
-
function readDoctorLogTail(
|
|
93905
|
+
function readDoctorLogTail(path33) {
|
|
93796
93906
|
let fd;
|
|
93797
93907
|
try {
|
|
93798
|
-
fd = openSync7(
|
|
93908
|
+
fd = openSync7(path33, "r");
|
|
93799
93909
|
} catch (error63) {
|
|
93800
|
-
if (error63.code === "ENOENT") return { path:
|
|
93801
|
-
return { path:
|
|
93910
|
+
if (error63.code === "ENOENT") return { path: path33, lines: null };
|
|
93911
|
+
return { path: path33, lines: null, readError: error63 instanceof Error ? error63.message : String(error63) };
|
|
93802
93912
|
}
|
|
93803
93913
|
try {
|
|
93804
93914
|
const size = fstatSync(fd).size;
|
|
@@ -93807,9 +93917,9 @@ function readDoctorLogTail(path32) {
|
|
|
93807
93917
|
readSync5(fd, buffer, 0, buffer.length, offset);
|
|
93808
93918
|
let text = buffer.toString("utf8");
|
|
93809
93919
|
if (offset > 0) text = text.slice(text.indexOf("\n") + 1);
|
|
93810
|
-
return { path:
|
|
93920
|
+
return { path: path33, lines: redactedLogTail(text) };
|
|
93811
93921
|
} catch (error63) {
|
|
93812
|
-
return { path:
|
|
93922
|
+
return { path: path33, lines: null, readError: error63 instanceof Error ? error63.message : String(error63) };
|
|
93813
93923
|
} finally {
|
|
93814
93924
|
closeSync7(fd);
|
|
93815
93925
|
}
|
|
@@ -94366,7 +94476,7 @@ async function realPromptLine(question) {
|
|
|
94366
94476
|
}
|
|
94367
94477
|
|
|
94368
94478
|
// src/menu.ts
|
|
94369
|
-
import
|
|
94479
|
+
import path28 from "node:path";
|
|
94370
94480
|
var MENU_CONTRACT = 1;
|
|
94371
94481
|
var CLIENT_NAMES = { claude: "Claude Code", codex: "Codex", cursor: "Cursor" };
|
|
94372
94482
|
function renderMenu(i) {
|
|
@@ -94382,13 +94492,22 @@ function renderMenu(i) {
|
|
|
94382
94492
|
more.push({ type: "section", title: "Agents authorized for MCP" });
|
|
94383
94493
|
for (const connection of i.connections) {
|
|
94384
94494
|
const { row, action, warns } = connectionRow(connection, envArgs);
|
|
94385
|
-
|
|
94495
|
+
const preference = i.mcpPreferences?.clients[connection.client];
|
|
94496
|
+
const eligible = warns && (connection.state !== "not-connected" || preference?.optedIn === true);
|
|
94497
|
+
const visible = eligible && preference?.dismissedWarning !== connection.state;
|
|
94498
|
+
const dismiss = i.mcpPreferencesError === void 0 ? {
|
|
94499
|
+
type: "action",
|
|
94500
|
+
title: `Dismiss ${CLIENT_NAMES[connection.client]} warning`,
|
|
94501
|
+
run: ["dismiss-mcp-warning", connection.client, connection.state, ...envArgs]
|
|
94502
|
+
} : void 0;
|
|
94503
|
+
if (visible) {
|
|
94386
94504
|
attention = true;
|
|
94387
|
-
items.push(row);
|
|
94505
|
+
items.push({ ...row, ...dismiss && { dismiss } });
|
|
94388
94506
|
if (action) items.push(action);
|
|
94389
94507
|
}
|
|
94390
|
-
more.push(row);
|
|
94508
|
+
more.push(warns && !visible ? { ...row, mark: "muted" } : row);
|
|
94391
94509
|
if (action) more.push(action);
|
|
94510
|
+
if (visible && dismiss) more.push(dismiss);
|
|
94392
94511
|
}
|
|
94393
94512
|
more.push({ type: "separator" });
|
|
94394
94513
|
}
|
|
@@ -94414,6 +94533,11 @@ function renderMenu(i) {
|
|
|
94414
94533
|
items.push({ type: "action", title: "Restart background sync\u2026", terminal: ["restart", ...envArgs] });
|
|
94415
94534
|
items.push({ type: "separator" });
|
|
94416
94535
|
}
|
|
94536
|
+
if (i.mcpPreferencesError !== void 0) {
|
|
94537
|
+
items.push(problem("MCP choices can't be read", "Restore or remove the preferences file."));
|
|
94538
|
+
items.push({ type: "action", title: "Copy MCP repair details", copy: i.mcpPreferencesError });
|
|
94539
|
+
items.push({ type: "separator" });
|
|
94540
|
+
}
|
|
94417
94541
|
if (i.credentialsError !== void 0) {
|
|
94418
94542
|
items.push(problem("Stored enrollment can't be read", i.credentialsError));
|
|
94419
94543
|
items.push({ type: "action", title: "Enroll Again\u2026", terminal: ["init", ...envArgs] });
|
|
@@ -94648,6 +94772,12 @@ function agentRow(session, i) {
|
|
|
94648
94772
|
agent.harness = {
|
|
94649
94773
|
type: "action",
|
|
94650
94774
|
title: links.extra.label,
|
|
94775
|
+
reportClick: [
|
|
94776
|
+
"report-agent-click",
|
|
94777
|
+
isSessionSource(session.source) ? session.source : "unknown",
|
|
94778
|
+
"focus" in links.extra ? "focus" : "terminal" in links.extra ? "resume" : /^(codex|claude):/.test(links.extra.url) ? "desktop" : "web",
|
|
94779
|
+
...envArgs
|
|
94780
|
+
],
|
|
94651
94781
|
..."url" in links.extra ? { url: links.extra.url } : {
|
|
94652
94782
|
..."focus" in links.extra && { focus: links.extra.focus },
|
|
94653
94783
|
terminal: [...links.extra.terminal, ...envArgs]
|
|
@@ -94764,7 +94894,7 @@ function daemonVersionNote(i) {
|
|
|
94764
94894
|
}
|
|
94765
94895
|
var VERSION_CACHE_TTL_MS = 60 * 6e4;
|
|
94766
94896
|
function versionCachePath(homeDir, source = "npm") {
|
|
94767
|
-
return
|
|
94897
|
+
return path28.join(collectorStateDir(homeDir), source === "npm" ? "version-check.json" : "version-check-promoted.json");
|
|
94768
94898
|
}
|
|
94769
94899
|
async function cachedLatestVersion(options) {
|
|
94770
94900
|
const raw = options.readTextFile(options.cacheFile);
|
|
@@ -94796,7 +94926,7 @@ function writeVersionCache(options) {
|
|
|
94796
94926
|
import { execFileSync as execFileSync7 } from "node:child_process";
|
|
94797
94927
|
import { readdir as readdir3, readFile as readFile2 } from "node:fs/promises";
|
|
94798
94928
|
import os21 from "node:os";
|
|
94799
|
-
import
|
|
94929
|
+
import path29 from "node:path";
|
|
94800
94930
|
var sessionFileAsObserved = external_exports.looseObject({
|
|
94801
94931
|
pid: external_exports.number().int().positive(),
|
|
94802
94932
|
sessionId: external_exports.string().min(1),
|
|
@@ -94805,7 +94935,7 @@ var sessionFileAsObserved = external_exports.looseObject({
|
|
|
94805
94935
|
var START_TIME_TOLERANCE_MS = 3e4;
|
|
94806
94936
|
var SESSION_FILE = /^(\d+)\.json$/;
|
|
94807
94937
|
function claudeSessionsDir(homeDir = os21.homedir()) {
|
|
94808
|
-
return
|
|
94938
|
+
return path29.join(homeDir, ".claude", "sessions");
|
|
94809
94939
|
}
|
|
94810
94940
|
async function readLiveTerminalSessions(wanted, deps = {}) {
|
|
94811
94941
|
const found = /* @__PURE__ */ new Map();
|
|
@@ -94830,7 +94960,7 @@ async function readLiveTerminalSessions(wanted, deps = {}) {
|
|
|
94830
94960
|
}
|
|
94831
94961
|
continue;
|
|
94832
94962
|
}
|
|
94833
|
-
const session = await readSessionFile(
|
|
94963
|
+
const session = await readSessionFile(path29.join(sessionsDir, entry), report2);
|
|
94834
94964
|
if (session === null) continue;
|
|
94835
94965
|
if (session.pid !== Number(match[1])) {
|
|
94836
94966
|
report2({
|
|
@@ -94868,7 +94998,7 @@ async function readSessionFile(file2, report2) {
|
|
|
94868
94998
|
report2({
|
|
94869
94999
|
operation: "claude-session-registry-shape",
|
|
94870
95000
|
message: "A Claude Code session file has a shape this CLI can't read",
|
|
94871
|
-
context: { file:
|
|
95001
|
+
context: { file: path29.basename(file2), shape: describeShape(raw) }
|
|
94872
95002
|
});
|
|
94873
95003
|
return null;
|
|
94874
95004
|
}
|
|
@@ -95287,8 +95417,8 @@ function createTerminalOutput(options) {
|
|
|
95287
95417
|
|
|
95288
95418
|
// src/credentialUpgrade.ts
|
|
95289
95419
|
import { spawn as spawn2 } from "node:child_process";
|
|
95290
|
-
import { closeSync as closeSync8, mkdirSync as
|
|
95291
|
-
import
|
|
95420
|
+
import { closeSync as closeSync8, mkdirSync as mkdirSync13, openSync as openSync8 } from "node:fs";
|
|
95421
|
+
import path30 from "node:path";
|
|
95292
95422
|
async function prepareCredentialUpgrade(deps) {
|
|
95293
95423
|
if (!deps.needsMigration() || !deps.serviceExists() || deps.ready()) return "ready";
|
|
95294
95424
|
if (deps.installing()) return "busy";
|
|
@@ -95321,7 +95451,7 @@ async function prepareCredentialUpgrade(deps) {
|
|
|
95321
95451
|
}
|
|
95322
95452
|
}
|
|
95323
95453
|
async function tryCredentialUpgradeLock(file2) {
|
|
95324
|
-
|
|
95454
|
+
mkdirSync13(path30.dirname(file2), { recursive: true, mode: 448 });
|
|
95325
95455
|
closeSync8(openSync8(file2, "a", 384));
|
|
95326
95456
|
const child = spawn2("/usr/bin/lockf", ["-k", "-s", "-t", "0", file2, "/bin/sh", "-c", "printf 'ready\\n'; exec /bin/cat >/dev/null"], {
|
|
95327
95457
|
detached: true,
|
|
@@ -95439,9 +95569,9 @@ async function tryCredentialUpgradeLock(file2) {
|
|
|
95439
95569
|
}
|
|
95440
95570
|
|
|
95441
95571
|
// src/menubarApp.ts
|
|
95442
|
-
import { existsSync as existsSync13, mkdirSync as
|
|
95572
|
+
import { existsSync as existsSync13, mkdirSync as mkdirSync14, renameSync as renameSync6, rmSync as rmSync6 } from "node:fs";
|
|
95443
95573
|
import os22 from "node:os";
|
|
95444
|
-
import
|
|
95574
|
+
import path31 from "node:path";
|
|
95445
95575
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
95446
95576
|
var MENUBAR_APP_ZIP = "dist/menubar/Powerplant.app.zip";
|
|
95447
95577
|
var MENUBAR_APP_NAME = "Powerplant.app";
|
|
@@ -95480,13 +95610,13 @@ async function syncMenubarApp(ops, context2) {
|
|
|
95480
95610
|
}
|
|
95481
95611
|
function realMenubarAppOps(input2) {
|
|
95482
95612
|
const home = input2.homeDir ?? os22.homedir();
|
|
95483
|
-
const userAppPath =
|
|
95484
|
-
const candidates = [userAppPath,
|
|
95613
|
+
const userAppPath = path31.join(home, "Applications", MENUBAR_APP_NAME);
|
|
95614
|
+
const candidates = [userAppPath, path31.join("/Applications", MENUBAR_APP_NAME)];
|
|
95485
95615
|
return {
|
|
95486
95616
|
cliVersion: input2.cliVersion,
|
|
95487
95617
|
packagedZip: () => {
|
|
95488
95618
|
if (input2.packageDir === null) return null;
|
|
95489
|
-
const zip =
|
|
95619
|
+
const zip = path31.join(input2.packageDir, MENUBAR_APP_ZIP);
|
|
95490
95620
|
return existsSync13(zip) ? zip : null;
|
|
95491
95621
|
},
|
|
95492
95622
|
installedApp: () => {
|
|
@@ -95506,10 +95636,10 @@ function realMenubarAppOps(input2) {
|
|
|
95506
95636
|
throw new Error(`the running app at ${appPath} did not quit`);
|
|
95507
95637
|
},
|
|
95508
95638
|
replace: (zip, appPath) => {
|
|
95509
|
-
const parent =
|
|
95510
|
-
|
|
95511
|
-
const staging =
|
|
95512
|
-
const retired =
|
|
95639
|
+
const parent = path31.dirname(appPath);
|
|
95640
|
+
mkdirSync14(parent, { recursive: true });
|
|
95641
|
+
const staging = path31.join(parent, `.${MENUBAR_APP_NAME}.swap-${process.pid}`);
|
|
95642
|
+
const retired = path31.join(parent, `.${MENUBAR_APP_NAME}.old-${process.pid}`);
|
|
95513
95643
|
rmSync6(staging, { recursive: true, force: true });
|
|
95514
95644
|
rmSync6(retired, { recursive: true, force: true });
|
|
95515
95645
|
try {
|
|
@@ -95519,16 +95649,16 @@ function realMenubarAppOps(input2) {
|
|
|
95519
95649
|
`ditto could not extract ${zip} (${extract.stderr?.toString().trim() || `exit ${extract.status}`})`
|
|
95520
95650
|
);
|
|
95521
95651
|
}
|
|
95522
|
-
const extracted =
|
|
95523
|
-
if (!existsSync13(
|
|
95652
|
+
const extracted = path31.join(staging, MENUBAR_APP_NAME);
|
|
95653
|
+
if (!existsSync13(path31.join(extracted, "Contents", "Info.plist"))) {
|
|
95524
95654
|
throw new Error(`${zip} does not contain ${MENUBAR_APP_NAME}`);
|
|
95525
95655
|
}
|
|
95526
95656
|
const hadOld = existsSync13(appPath);
|
|
95527
|
-
if (hadOld)
|
|
95657
|
+
if (hadOld) renameSync6(appPath, retired);
|
|
95528
95658
|
try {
|
|
95529
|
-
|
|
95659
|
+
renameSync6(extracted, appPath);
|
|
95530
95660
|
} catch (error63) {
|
|
95531
|
-
if (hadOld)
|
|
95661
|
+
if (hadOld) renameSync6(retired, appPath);
|
|
95532
95662
|
throw error63;
|
|
95533
95663
|
}
|
|
95534
95664
|
} finally {
|
|
@@ -95548,7 +95678,7 @@ function realMenubarAppOps(input2) {
|
|
|
95548
95678
|
};
|
|
95549
95679
|
}
|
|
95550
95680
|
function appProcessIds(appPath) {
|
|
95551
|
-
const executable =
|
|
95681
|
+
const executable = path31.join(appPath, "Contents", "MacOS", "PowerplantMenubar");
|
|
95552
95682
|
const result = spawnSync4("ps", ["-axo", "pid=,comm="], { encoding: "utf8" });
|
|
95553
95683
|
if (result.status !== 0) {
|
|
95554
95684
|
throw new Error(`ps could not list processes (${result.error?.message ?? `exit ${result.status}`})`);
|
|
@@ -95577,10 +95707,10 @@ var workspaceSchema = external_exports.object({
|
|
|
95577
95707
|
active: external_exports.boolean()
|
|
95578
95708
|
});
|
|
95579
95709
|
var FETCH_TIMEOUT_MS2 = 1e4;
|
|
95580
|
-
async function callApi(credentials,
|
|
95710
|
+
async function callApi(credentials, path33, init3, fetchImpl) {
|
|
95581
95711
|
let response;
|
|
95582
95712
|
try {
|
|
95583
|
-
response = await fetchImpl(`${credentials.apiUrl}${
|
|
95713
|
+
response = await fetchImpl(`${credentials.apiUrl}${path33}`, {
|
|
95584
95714
|
...init3,
|
|
95585
95715
|
headers: {
|
|
95586
95716
|
authorization: `Bearer ${credentials.token}`,
|
|
@@ -95599,7 +95729,7 @@ async function callApi(credentials, path32, init3, fetchImpl) {
|
|
|
95599
95729
|
);
|
|
95600
95730
|
}
|
|
95601
95731
|
if (!response.ok) {
|
|
95602
|
-
throw new ExpectedCliError(`Powerplant answered ${response.status} for ${
|
|
95732
|
+
throw new ExpectedCliError(`Powerplant answered ${response.status} for ${path33}.`);
|
|
95603
95733
|
}
|
|
95604
95734
|
return response.json();
|
|
95605
95735
|
}
|
|
@@ -95816,7 +95946,7 @@ ${USAGE}`);
|
|
|
95816
95946
|
install: () => {
|
|
95817
95947
|
installService(config2, watchCommand(config2));
|
|
95818
95948
|
},
|
|
95819
|
-
tryLock: () => tryCredentialUpgradeLock(
|
|
95949
|
+
tryLock: () => tryCredentialUpgradeLock(path32.join(collectorStateDir(), `credential-upgrade-${config2.appEnv}.lock`)),
|
|
95820
95950
|
now: Date.now,
|
|
95821
95951
|
sleep: () => new Promise((resolve2) => setTimeout(resolve2, 250)),
|
|
95822
95952
|
restartCommand: `powerplant restart${config2.appEnv === "production" ? "" : ` --env ${config2.appEnv}`}`,
|
|
@@ -95863,6 +95993,9 @@ ${USAGE}`);
|
|
|
95863
95993
|
const detected = detectClients({ warn: log3 });
|
|
95864
95994
|
saveDetectedClients(detected, process.env.PATH ?? "");
|
|
95865
95995
|
let clients = clientFilter === void 0 ? detected : detected.filter((client) => clientFilter.has(client.client));
|
|
95996
|
+
if (!pickerOn || clientFilter !== void 0) {
|
|
95997
|
+
recordMcpConnectChoices(config2.appEnv, detected.map((client) => client.client), clientFilter);
|
|
95998
|
+
}
|
|
95866
95999
|
if (clientFilter !== void 0 && clients.length === 0) {
|
|
95867
96000
|
log3(
|
|
95868
96001
|
`No ${[...clientFilter].join(" or ")} installation found on this machine, nothing to connect.`
|
|
@@ -95879,7 +96012,11 @@ ${USAGE}`);
|
|
|
95879
96012
|
}
|
|
95880
96013
|
let skipped = 0;
|
|
95881
96014
|
if (pickerOn && clientFilter === void 0 && clients.length > 0) {
|
|
95882
|
-
clients = await pickAgents(clients, {
|
|
96015
|
+
clients = await pickAgents(clients, {
|
|
96016
|
+
log: log3,
|
|
96017
|
+
promptCheckboxes: realCheckboxPrompt,
|
|
96018
|
+
onChoice: (selected) => recordMcpChoices(config2.appEnv, detected.map((client) => client.client), selected.map((client) => client.client))
|
|
96019
|
+
});
|
|
95883
96020
|
skipped = agentCount(detected) - agentCount(clients);
|
|
95884
96021
|
if (clients.length === 0) {
|
|
95885
96022
|
log3(`Powerplant MCP wasn't added to any agents. Run any time: ${connectCommand}`);
|
|
@@ -95983,6 +96120,7 @@ ${USAGE}`);
|
|
|
95983
96120
|
return;
|
|
95984
96121
|
}
|
|
95985
96122
|
const outcome = runDisconnect(clients, {
|
|
96123
|
+
onDisconnected: (client) => recordMcpChoices(config2.appEnv, [client], []),
|
|
95986
96124
|
log: console.log,
|
|
95987
96125
|
serverName: mcpServerNameFor(config2.appEnv),
|
|
95988
96126
|
disconnectCommand,
|
|
@@ -96069,8 +96207,9 @@ The access you granted these agents stays on your Powerplant account until you r
|
|
|
96069
96207
|
const budget = menuBudget;
|
|
96070
96208
|
const saved = loadDetectedClients(realReadTextFile);
|
|
96071
96209
|
const probePath = mergedPath(process.env.PATH, saved);
|
|
96210
|
+
const detected = detectClients({ whichAll: whichAllWith(probePath), budget, requireCursorApp: process.platform === "darwin" });
|
|
96072
96211
|
const clients = mergeDetectedClients(
|
|
96073
|
-
|
|
96212
|
+
detected,
|
|
96074
96213
|
saved,
|
|
96075
96214
|
existsSync14
|
|
96076
96215
|
);
|
|
@@ -96116,6 +96255,7 @@ The access you granted these agents stays on your Powerplant account until you r
|
|
|
96116
96255
|
control: readCollectorControl(config2.appEnv),
|
|
96117
96256
|
latestVersion,
|
|
96118
96257
|
oldestSupportedVersion,
|
|
96258
|
+
...readMcpPreferencesForMenu(config2.appEnv),
|
|
96119
96259
|
connections: probeConnections(clients, {
|
|
96120
96260
|
mcpUrl: `${config2.apiUrl}/mcp`,
|
|
96121
96261
|
serverName: mcpServerNameFor(config2.appEnv),
|
|
@@ -96135,6 +96275,23 @@ The access you granted these agents stays on your Powerplant account until you r
|
|
|
96135
96275
|
console.log(JSON.stringify(payload));
|
|
96136
96276
|
return;
|
|
96137
96277
|
}
|
|
96278
|
+
case "report-agent-click": {
|
|
96279
|
+
const parsed2 = menubarAgentClickSchema.safeParse({ source: positionals[1], destination: positionals[2] });
|
|
96280
|
+
if (!parsed2.success) throw new ExpectedCliError("Expected an agent source and menu destination.");
|
|
96281
|
+
const stored = loadCredentialsSafely(config2);
|
|
96282
|
+
if (!await reportMenubarEvent({ event: MENUBAR_AGENT_CLICK, ...parsed2.data }, stored.credentials, console.error)) process.exitCode = 1;
|
|
96283
|
+
return;
|
|
96284
|
+
}
|
|
96285
|
+
case "dismiss-mcp-warning": {
|
|
96286
|
+
const parsed2 = mcpWarningDismissalSchema.safeParse({ client: positionals[1], warning: positionals[2] });
|
|
96287
|
+
if (!parsed2.success) throw new ExpectedCliError("Expected a client and MCP warning type to dismiss.");
|
|
96288
|
+
if (dismissMcpWarning(config2.appEnv, parsed2.data)) {
|
|
96289
|
+
const stored = loadCredentialsSafely(config2);
|
|
96290
|
+
if (stored.credentialsError) console.error(JSON.stringify({ level: "warn", runId: randomUUID4(), operation: "menubar-analytics", outcome: "credentials-unavailable" }));
|
|
96291
|
+
await reportMenubarEvent({ event: MENUBAR_MCP_WARNING_REMOVE, ...parsed2.data }, stored.credentials, console.error);
|
|
96292
|
+
}
|
|
96293
|
+
return;
|
|
96294
|
+
}
|
|
96138
96295
|
// Which workspace this account resolves to — the web app and the MCP
|
|
96139
96296
|
// follow it. Needs the machine credential only to name the member.
|
|
96140
96297
|
case "workspace": {
|
|
@@ -96353,7 +96510,7 @@ function startBackgroundUpdate(config2, target) {
|
|
|
96353
96510
|
readProgress: updateProgress.read,
|
|
96354
96511
|
writeProgress: updateProgress.write,
|
|
96355
96512
|
spawnChild: () => {
|
|
96356
|
-
|
|
96513
|
+
mkdirSync15(path32.dirname(updateLogPath()), { recursive: true });
|
|
96357
96514
|
const log3 = openSync9(updateLogPath(), "a");
|
|
96358
96515
|
const child = spawn3(process.execPath, [entryPath(), "update", ...envArgsFor(config2)], {
|
|
96359
96516
|
detached: true,
|
|
@@ -96462,4 +96619,4 @@ undici/lib/web/websocket/frame.js:
|
|
|
96462
96619
|
(*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
|
|
96463
96620
|
*/
|
|
96464
96621
|
|
|
96465
|
-
//# debugId=
|
|
96622
|
+
//# debugId=81d65aee-a279-58bd-9476-cc1269e40adf
|