perplexity-user-mcp 0.8.42 → 0.8.47
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/attachments.d.ts +10 -20
- package/dist/browser-window.d.ts +11 -0
- package/dist/cf-warmup.d.ts +32 -0
- package/dist/checks/browser.d.ts +12 -100
- package/dist/checks/config.d.ts +25 -91
- package/dist/checks/ide.d.ts +31 -89
- package/dist/checks/mcp.d.ts +12 -61
- package/dist/checks/native-deps.d.ts +46 -131
- package/dist/checks/network.d.ts +13 -71
- package/dist/checks/probe.d.ts +37 -92
- package/dist/checks/probe.mjs +29 -0
- package/dist/checks/profiles.d.ts +13 -99
- package/dist/checks/profiles.mjs +35 -0
- package/dist/checks/runtime.d.ts +24 -89
- package/dist/checks/vault.d.ts +13 -142
- package/dist/checks/vault.mjs +6 -11
- package/dist/{chunk-WDIW33DA.mjs → chunk-3LUO5ATM.mjs} +1 -1
- package/dist/{chunk-HNSPNCFH.mjs → chunk-6CAXNBDD.mjs} +1 -1
- package/dist/{chunk-B65IJQZJ.mjs → chunk-6E6XTHTG.mjs} +1 -1
- package/dist/{chunk-S677V2JU.mjs → chunk-C5I7KXHK.mjs} +32 -2
- package/dist/{chunk-RK4EBZJ3.mjs → chunk-D2ZQGKHM.mjs} +11 -8
- package/dist/{chunk-TDXETAQT.mjs → chunk-DKEJZ4FI.mjs} +1 -1
- package/dist/{chunk-U7QPUNRH.mjs → chunk-DXR6EEZH.mjs} +26 -7
- package/dist/{chunk-HJIXH6CL.mjs → chunk-E3GRJXXJ.mjs} +2 -0
- package/dist/{chunk-C3HPFFTD.mjs → chunk-GBHPJ7I7.mjs} +136 -48
- package/dist/{chunk-D254EFYB.mjs → chunk-GBI2U336.mjs} +1 -1
- package/dist/chunk-GPUGKWXH.mjs +17 -0
- package/dist/chunk-KVV3JBSN.mjs +32 -0
- package/dist/{chunk-XTRJSV72.mjs → chunk-LGH5BSUY.mjs} +1 -1
- package/dist/{chunk-KJFX2ZXR.mjs → chunk-NMKNEEZB.mjs} +1 -1
- package/dist/{chunk-T6ARJK2P.mjs → chunk-P6YOLJ5T.mjs} +6 -6
- package/dist/{chunk-452DK6OS.mjs → chunk-QXYMYCHC.mjs} +2 -2
- package/dist/{chunk-Z4OLYVB2.mjs → chunk-SCZQCV7M.mjs} +1 -1
- package/dist/{chunk-FKQ3HP4Q.mjs → chunk-TIWHN4IW.mjs} +1 -1
- package/dist/{chunk-V4U3JM4R.mjs → chunk-TSLRTZYR.mjs} +1 -1
- package/dist/{chunk-DQQISMYN.mjs → chunk-V4LHDNWJ.mjs} +2 -2
- package/dist/{chunk-2FPGJKCA.mjs → chunk-YD25G5AD.mjs} +2 -2
- package/dist/cli.d.ts +14 -1317
- package/dist/cli.mjs +14 -21
- package/dist/client.d.ts +39 -24
- package/dist/client.mjs +9 -6
- package/dist/cloud-sync.d.ts +65 -42
- package/dist/cloud-sync.mjs +9 -8
- package/dist/config.d.ts +35 -39
- package/dist/config.mjs +3 -3
- package/dist/cookie-jar.d.ts +77 -0
- package/dist/daemon/attach.d.ts +5 -12
- package/dist/daemon/attach.mjs +18 -17
- package/dist/daemon/audit.d.ts +5 -7
- package/dist/daemon/audit.mjs +2 -2
- package/dist/daemon/client-http.d.ts +10 -16
- package/dist/daemon/client-http.mjs +18 -17
- package/dist/daemon/index.d.ts +17 -14
- package/dist/daemon/index.mjs +19 -18
- package/dist/daemon/install-tunnel.d.ts +8 -34
- package/dist/daemon/install-tunnel.mjs +2 -2
- package/dist/daemon/launcher.d.ts +24 -29
- package/dist/daemon/launcher.mjs +17 -16
- package/dist/daemon/local-tokens.d.ts +23 -0
- package/dist/daemon/lockfile.d.ts +10 -12
- package/dist/daemon/lockfile.mjs +2 -2
- package/dist/daemon/oauth-consent-cache.d.ts +86 -0
- package/dist/daemon/oauth-provider.d.ts +132 -0
- package/dist/daemon/public-pages.d.ts +9 -0
- package/dist/daemon/security.d.ts +52 -0
- package/dist/daemon/server.d.ts +12 -83
- package/dist/daemon/server.mjs +12 -11
- package/dist/daemon/token.d.ts +7 -9
- package/dist/daemon/token.mjs +2 -2
- package/dist/daemon/tunnel-providers/cloudflared-named-setup.d.ts +140 -0
- package/dist/daemon/tunnel-providers/cloudflared-named.d.ts +45 -0
- package/dist/daemon/tunnel-providers/cloudflared-quick.d.ts +8 -0
- package/dist/daemon/tunnel-providers/index.d.ts +16 -327
- package/dist/daemon/tunnel-providers/index.mjs +3 -3
- package/dist/daemon/tunnel-providers/ngrok-config.d.ts +18 -0
- package/dist/daemon/tunnel-providers/ngrok.d.ts +68 -0
- package/dist/daemon/tunnel-providers/types.d.ts +56 -0
- package/dist/daemon/tunnel.d.ts +5 -7
- package/dist/debug-tracer.d.ts +2 -0
- package/dist/doctor-report.d.ts +17 -22
- package/dist/doctor.d.ts +12 -44
- package/dist/doctor.mjs +2 -2
- package/dist/export.d.ts +11 -18
- package/dist/export.mjs +4 -4
- package/dist/format.d.ts +52 -0
- package/dist/fs-utils.d.ts +44 -0
- package/dist/health-check.d.ts +1 -108
- package/dist/health-check.mjs +3 -3
- package/dist/history-store.d.ts +29 -65
- package/dist/history-store.mjs +2 -2
- package/dist/impit-login-runner.d.ts +1 -469
- package/dist/impit-login-runner.mjs +4 -4
- package/dist/index.d.ts +25 -149
- package/dist/index.mjs +23 -20
- package/dist/is-main-module.d.ts +9 -0
- package/dist/login-runner.d.ts +1 -333
- package/dist/login-runner.mjs +18 -38
- package/dist/login.d.ts +5 -0
- package/dist/logout.d.ts +2 -28
- package/dist/logout.mjs +3 -2
- package/dist/manual-login-runner.d.ts +1 -150
- package/dist/manual-login-runner.mjs +11 -11
- package/dist/{native-deps-IE4B55EL.mjs → native-deps-FCSYDL4W.mjs} +4 -4
- package/dist/native-deps.d.ts +36 -0
- package/dist/package-version.d.ts +1 -0
- package/dist/profiles.d.ts +41 -41
- package/dist/profiles.mjs +1 -1
- package/dist/prompts.d.ts +2 -0
- package/dist/redact.d.ts +14 -142
- package/dist/refresh.d.ts +11 -16
- package/dist/refresh.mjs +4 -4
- package/dist/reinit-watcher.d.ts +15 -24
- package/dist/reinit-watcher.mjs +2 -2
- package/dist/resources.d.ts +5 -0
- package/dist/safe-write.d.ts +16 -0
- package/dist/session-metadata.d.ts +45 -0
- package/dist/tool-config.d.ts +10 -0
- package/dist/tools.d.ts +23 -0
- package/dist/tty-prompt.d.ts +18 -34
- package/dist/vault.d.ts +114 -34
- package/dist/vault.mjs +6 -4
- package/dist/viewer-detect.d.ts +2 -4
- package/dist/viewers.d.ts +13 -18
- package/dist/viewers.mjs +1 -1
- package/package.json +2 -2
- package/dist/cloud-sync.d-Cqt6y18U.d.ts +0 -42
- package/dist/doctor.d-CXmUqOXX.d.ts +0 -43
- package/dist/history-store.d-BzjBF2m3.d.ts +0 -65
- package/dist/native-deps-BNThFHxa.d.ts +0 -175
- package/dist/profiles.d-DqS1oZWr.d.ts +0 -41
- package/dist/session-metadata-B9aV_n5g.d.ts +0 -148
- package/dist/vault.d-BSJWDLhp.d.ts +0 -37
- package/dist/viewer-detect.d-HWGnyFAA.d.ts +0 -4
- package/dist/viewers.d-BGCK6sw6.d.ts +0 -10
package/dist/attachments.d.ts
CHANGED
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare function inferAttachmentKind(mimeType?: string): "image" | "file";
|
|
12
|
-
declare function downloadAttachment(options: {
|
|
13
|
-
download: (url: string, targetPath: string) => Promise<unknown>;
|
|
14
|
-
url: string;
|
|
15
|
-
attachmentsDir: string;
|
|
16
|
-
filename?: string;
|
|
17
|
-
mimeType?: string;
|
|
18
|
-
}): Promise<DownloadedAttachment>;
|
|
19
|
-
|
|
20
|
-
export { type DownloadedAttachment, MAX_ATTACHMENT_BYTES, downloadAttachment, inferAttachmentKind, sanitizeAttachmentFilename };
|
|
1
|
+
export function sanitizeAttachmentFilename(name: any): string;
|
|
2
|
+
export function inferAttachmentKind(mimeType: any): "image" | "file";
|
|
3
|
+
export function downloadAttachment(options: any): Promise<{
|
|
4
|
+
filename: string;
|
|
5
|
+
path: string;
|
|
6
|
+
sizeBytes: number;
|
|
7
|
+
mimeType: any;
|
|
8
|
+
kind: string;
|
|
9
|
+
}>;
|
|
10
|
+
export const MAX_ATTACHMENT_BYTES: number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chromium launch args for the headed login / cookie-grab window.
|
|
3
|
+
*
|
|
4
|
+
* @param {boolean} localOrigin — true when the login target is a local mock
|
|
5
|
+
* origin (127.0.0.1 / localhost). Those runs are already headless with no
|
|
6
|
+
* window, so no positioning is needed.
|
|
7
|
+
* @returns {string[]}
|
|
8
|
+
*/
|
|
9
|
+
export function loginLaunchArgs(localOrigin: boolean): string[];
|
|
10
|
+
export function minimizePageWindow(page: any): Promise<boolean>;
|
|
11
|
+
export const OFFSCREEN_POSITION_ARG: "--window-position=-32000,-32000";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type PlaywrightCookie } from "./config.js";
|
|
2
|
+
export interface WarmCloudflareOptions {
|
|
3
|
+
/** Hard cap on the initial page.goto. Default 15_000ms. */
|
|
4
|
+
navigationTimeoutMs?: number;
|
|
5
|
+
/** How often to recheck context cookies for `cf_clearance`. Default 250ms. */
|
|
6
|
+
pollIntervalMs?: number;
|
|
7
|
+
/** Total wall-clock budget for the cookie poll loop after navigation. Default 10_000ms. */
|
|
8
|
+
cookieWaitMs?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface WarmCloudflareResult {
|
|
11
|
+
/**
|
|
12
|
+
* True iff the browser launched and navigation succeeded. May be true even
|
|
13
|
+
* when `hasCfClearance` is false — distinguishes "browser unusable" from
|
|
14
|
+
* "browser fine, CF just didn't issue clearance this time".
|
|
15
|
+
*/
|
|
16
|
+
ok: boolean;
|
|
17
|
+
/** All cookies present in the ephemeral context at teardown. Empty on launch failure. */
|
|
18
|
+
cookies: PlaywrightCookie[];
|
|
19
|
+
/** Whether `cf_clearance` was observed in `cookies`. */
|
|
20
|
+
hasCfClearance: boolean;
|
|
21
|
+
/** Wall-clock duration of the warmup attempt, in milliseconds. */
|
|
22
|
+
elapsedMs: number;
|
|
23
|
+
/** Populated when `ok=false`. Single-line, human-readable. */
|
|
24
|
+
error?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Brief headless launch to capture cf_clearance for the impit-login flow.
|
|
28
|
+
*
|
|
29
|
+
* Always returns a result object — never throws. Caller falls back to the
|
|
30
|
+
* full browser-based login when ok=false or hasCfClearance=false.
|
|
31
|
+
*/
|
|
32
|
+
export declare function warmCloudflare(opts?: WarmCloudflareOptions): Promise<WarmCloudflareResult>;
|
package/dist/checks/browser.d.ts
CHANGED
|
@@ -1,100 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* alive as visible Chrome windows. Every `runDoctor()` call (Run, Deep check,
|
|
14
|
-
* Capture diagnostics, Export) was therefore spawning a permanent visible
|
|
15
|
-
* window.
|
|
16
|
-
*
|
|
17
|
-
* Fix: on Windows, query the PE header's ProductVersion via PowerShell's
|
|
18
|
-
* `Get-Item ... .VersionInfo.ProductVersion` — no browser launch, returns
|
|
19
|
-
* the same string the user sees in File Properties → Details. On macOS /
|
|
20
|
-
* Linux, `--version` is a true CLI app contract and remains safe.
|
|
21
|
-
*/
|
|
22
|
-
function probeVersion(path) {
|
|
23
|
-
if (process.platform === "win32") {
|
|
24
|
-
return new Promise((resolve, reject) => {
|
|
25
|
-
// Single-quote escape: PowerShell single-quoted strings need '' to
|
|
26
|
-
// represent a literal '. -LiteralPath bypasses wildcard expansion so
|
|
27
|
-
// bracketed install paths (e.g. Program Files (x86)) are safe.
|
|
28
|
-
const escaped = path.replace(/'/g, "''");
|
|
29
|
-
const child = spawn(
|
|
30
|
-
"powershell.exe",
|
|
31
|
-
[
|
|
32
|
-
"-NoProfile",
|
|
33
|
-
"-NonInteractive",
|
|
34
|
-
"-Command",
|
|
35
|
-
`(Get-Item -LiteralPath '${escaped}').VersionInfo.ProductVersion`,
|
|
36
|
-
],
|
|
37
|
-
{ timeout: 3000, windowsHide: true },
|
|
38
|
-
);
|
|
39
|
-
let out = "";
|
|
40
|
-
let err = "";
|
|
41
|
-
child.stdout?.on("data", (d) => { out += d.toString(); });
|
|
42
|
-
child.stderr?.on("data", (d) => { err += d.toString(); });
|
|
43
|
-
child.on("close", (code) => {
|
|
44
|
-
const trimmed = out.trim();
|
|
45
|
-
if (code === 0 && trimmed) resolve(trimmed);
|
|
46
|
-
else reject(new Error(err.trim() || `version probe exited ${code}`));
|
|
47
|
-
});
|
|
48
|
-
child.on("error", reject);
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return new Promise((resolve, reject) => {
|
|
52
|
-
const child = spawn(path, ["--version"], { timeout: 2000 });
|
|
53
|
-
let out = "";
|
|
54
|
-
let err = "";
|
|
55
|
-
child.stdout?.on("data", (d) => { out += d.toString(); });
|
|
56
|
-
child.stderr?.on("data", (d) => { err += d.toString(); });
|
|
57
|
-
child.on("close", (code) => {
|
|
58
|
-
if (code === 0) resolve(out.trim() || err.trim());
|
|
59
|
-
else reject(new Error(err.trim() || `version probe exited ${code}`));
|
|
60
|
-
});
|
|
61
|
-
child.on("error", reject);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
async function run(opts = {}) {
|
|
66
|
-
const results = [];
|
|
67
|
-
const findChrome = opts.findChromeOverride ?? (await import('../config.d.ts')).findChromeExecutable;
|
|
68
|
-
const versionProbe = opts.versionProbeOverride ?? probeVersion;
|
|
69
|
-
|
|
70
|
-
let chromePath = null;
|
|
71
|
-
try { chromePath = findChrome(); } catch { chromePath = null; }
|
|
72
|
-
|
|
73
|
-
if (!chromePath) {
|
|
74
|
-
results.push({
|
|
75
|
-
category: CATEGORY,
|
|
76
|
-
name: "chrome-family",
|
|
77
|
-
status: "fail",
|
|
78
|
-
message: "No Chrome / Edge / Chromium binary found on PATH or in standard locations.",
|
|
79
|
-
hint: "Run `npx perplexity-user-mcp install-browser` (Phase 4) or install Chrome/Edge manually.",
|
|
80
|
-
});
|
|
81
|
-
return results;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
try {
|
|
85
|
-
const v = await versionProbe(chromePath);
|
|
86
|
-
results.push({ category: CATEGORY, name: "chrome-family", status: "pass", message: v });
|
|
87
|
-
} catch (err) {
|
|
88
|
-
results.push({ category: CATEGORY, name: "chrome-family", status: "pass", message: chromePath });
|
|
89
|
-
results.push({
|
|
90
|
-
category: CATEGORY,
|
|
91
|
-
name: "chrome-version",
|
|
92
|
-
status: "warn",
|
|
93
|
-
message: `version probe failed: ${err.message}`,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return results;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export { run };
|
|
1
|
+
export function run(opts?: {}): Promise<{
|
|
2
|
+
category: string;
|
|
3
|
+
name: string;
|
|
4
|
+
status: string;
|
|
5
|
+
message: string;
|
|
6
|
+
hint: string;
|
|
7
|
+
}[] | {
|
|
8
|
+
category: string;
|
|
9
|
+
name: string;
|
|
10
|
+
status: string;
|
|
11
|
+
message: any;
|
|
12
|
+
}[]>;
|
package/dist/checks/config.d.ts
CHANGED
|
@@ -1,91 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (process.platform !== "win32") {
|
|
28
|
-
const mode = statSync(dir).mode & 0o777;
|
|
29
|
-
if (mode & 0o077) {
|
|
30
|
-
results.push({
|
|
31
|
-
category: CATEGORY,
|
|
32
|
-
name: "config-perms",
|
|
33
|
-
status: "warn",
|
|
34
|
-
message: `Config dir is world/group readable (mode 0${mode.toString(8)})`,
|
|
35
|
-
hint: "Run `chmod 700 ~/.perplexity-mcp`.",
|
|
36
|
-
});
|
|
37
|
-
} else {
|
|
38
|
-
results.push({ category: CATEGORY, name: "config-perms", status: "pass", message: "0700" });
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
results.push({ category: CATEGORY, name: "config-perms", status: "skip", message: "NTFS ACL (see icacls)" });
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const activePath = join(dir, "active");
|
|
45
|
-
if (!existsSync(activePath)) {
|
|
46
|
-
results.push({
|
|
47
|
-
category: CATEGORY,
|
|
48
|
-
name: "active-pointer",
|
|
49
|
-
status: "warn",
|
|
50
|
-
message: "No active profile set.",
|
|
51
|
-
hint: "Add an account to create and activate your first profile.",
|
|
52
|
-
action: { label: "Add account", commandId: "Perplexity.addAccount" },
|
|
53
|
-
});
|
|
54
|
-
} else {
|
|
55
|
-
const name = readFileSync(activePath, "utf8").trim();
|
|
56
|
-
const metaPath = join(dir, "profiles", name, "meta.json");
|
|
57
|
-
if (!existsSync(metaPath)) {
|
|
58
|
-
results.push({
|
|
59
|
-
category: CATEGORY,
|
|
60
|
-
name: "active-pointer",
|
|
61
|
-
status: "fail",
|
|
62
|
-
message: `active -> '${name}' but profile does not exist`,
|
|
63
|
-
hint: "Run `npx perplexity-user-mcp list-accounts` and pick a real profile.",
|
|
64
|
-
});
|
|
65
|
-
} else {
|
|
66
|
-
results.push({ category: CATEGORY, name: "active-pointer", status: "pass", message: name });
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const cfgJson = join(dir, "config.json");
|
|
71
|
-
if (!existsSync(cfgJson)) {
|
|
72
|
-
results.push({ category: CATEGORY, name: "config-json", status: "skip", message: "optional file absent" });
|
|
73
|
-
} else {
|
|
74
|
-
try {
|
|
75
|
-
JSON.parse(readFileSync(cfgJson, "utf8"));
|
|
76
|
-
results.push({ category: CATEGORY, name: "config-json", status: "pass", message: "valid" });
|
|
77
|
-
} catch (err) {
|
|
78
|
-
results.push({
|
|
79
|
-
category: CATEGORY,
|
|
80
|
-
name: "config-json",
|
|
81
|
-
status: "warn",
|
|
82
|
-
message: `config.json malformed: ${err.message}`,
|
|
83
|
-
hint: "Delete or fix the file — doctor reads it for reporting.githubIssueButton etc.",
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return results;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export { run };
|
|
1
|
+
export function run(opts?: {}): Promise<({
|
|
2
|
+
category: string;
|
|
3
|
+
name: string;
|
|
4
|
+
status: string;
|
|
5
|
+
message: string;
|
|
6
|
+
hint?: undefined;
|
|
7
|
+
action?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
category: string;
|
|
10
|
+
name: string;
|
|
11
|
+
status: string;
|
|
12
|
+
message: string;
|
|
13
|
+
hint: string;
|
|
14
|
+
action?: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
category: string;
|
|
17
|
+
name: string;
|
|
18
|
+
status: string;
|
|
19
|
+
message: string;
|
|
20
|
+
hint: string;
|
|
21
|
+
action: {
|
|
22
|
+
label: string;
|
|
23
|
+
commandId: string;
|
|
24
|
+
};
|
|
25
|
+
})[]>;
|
package/dist/checks/ide.d.ts
CHANGED
|
@@ -1,89 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
// Order of evaluation: stale-args (the launcher path no longer exists)
|
|
34
|
-
// wins over a bad-command warning. A stale launcher is the higher-impact
|
|
35
|
-
// breakage — the IDE will fail to spawn anything at all — so the doctor
|
|
36
|
-
// surfaces that first and elides the command-health note for the same row.
|
|
37
|
-
if (s.health === "stale") {
|
|
38
|
-
results.push({
|
|
39
|
-
category: CATEGORY,
|
|
40
|
-
name: id,
|
|
41
|
-
status: "warn",
|
|
42
|
-
message: `${s.displayName} config is stale.`,
|
|
43
|
-
hint: "Click Configure to refresh.",
|
|
44
|
-
action: { label: "Refresh config", commandId: "Perplexity.generateConfigs", args: [id] },
|
|
45
|
-
});
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
if (s.commandHealth && s.commandHealth !== "ok") {
|
|
49
|
-
results.push({
|
|
50
|
-
category: CATEGORY,
|
|
51
|
-
name: id,
|
|
52
|
-
status: "warn",
|
|
53
|
-
message: `${s.displayName} configured but command path is ${s.commandHealth} — re-run 'Configure for All' to refresh.`,
|
|
54
|
-
hint: "The MCP config's `command` field doesn't look like a Node.js binary. Re-running Configure rewrites it with a resolved Node path.",
|
|
55
|
-
action: { label: "Refresh config", commandId: "Perplexity.generateConfigs", args: [id] },
|
|
56
|
-
});
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
results.push({ category: CATEGORY, name: id, status: "pass", message: `${s.displayName} configured` });
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
try {
|
|
63
|
-
const { detectAllViewers } = await import('../viewer-detect.d-HWGnyFAA.d.ts');
|
|
64
|
-
const viewers = await detectAllViewers();
|
|
65
|
-
const detected = Object.entries(viewers)
|
|
66
|
-
.filter(([, present]) => present)
|
|
67
|
-
.map(([id]) => id);
|
|
68
|
-
results.push({
|
|
69
|
-
category: CATEGORY,
|
|
70
|
-
name: "mdViewers",
|
|
71
|
-
status: "pass",
|
|
72
|
-
message: detected.length > 0
|
|
73
|
-
? `Detected MD viewers: ${detected.join(", ")}`
|
|
74
|
-
: "No external MD viewers detected (VS Code preview and Rich View remain available).",
|
|
75
|
-
detail: { viewers },
|
|
76
|
-
});
|
|
77
|
-
} catch (err) {
|
|
78
|
-
results.push({
|
|
79
|
-
category: CATEGORY,
|
|
80
|
-
name: "mdViewers",
|
|
81
|
-
status: "warn",
|
|
82
|
-
message: `Viewer detection failed: ${(err instanceof Error ? err.message : String(err))}`,
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return results;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export { run };
|
|
1
|
+
export function run(opts?: {}): Promise<({
|
|
2
|
+
category: string;
|
|
3
|
+
name: string;
|
|
4
|
+
status: string;
|
|
5
|
+
message: string;
|
|
6
|
+
hint?: undefined;
|
|
7
|
+
action?: undefined;
|
|
8
|
+
detail?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
category: string;
|
|
11
|
+
name: string;
|
|
12
|
+
status: string;
|
|
13
|
+
message: string;
|
|
14
|
+
hint: string;
|
|
15
|
+
action: {
|
|
16
|
+
label: string;
|
|
17
|
+
commandId: string;
|
|
18
|
+
args: string[];
|
|
19
|
+
};
|
|
20
|
+
detail?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
category: string;
|
|
23
|
+
name: string;
|
|
24
|
+
status: string;
|
|
25
|
+
message: string;
|
|
26
|
+
detail: {
|
|
27
|
+
viewers: Record<string, boolean>;
|
|
28
|
+
};
|
|
29
|
+
hint?: undefined;
|
|
30
|
+
action?: undefined;
|
|
31
|
+
})[]>;
|
package/dist/checks/mcp.d.ts
CHANGED
|
@@ -1,61 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
results.push({
|
|
14
|
-
category: CATEGORY,
|
|
15
|
-
name: "tool-config",
|
|
16
|
-
status: "skip",
|
|
17
|
-
message: "no tools-config.json (default: full)",
|
|
18
|
-
});
|
|
19
|
-
results.push({
|
|
20
|
-
category: CATEGORY,
|
|
21
|
-
name: "enabled-tools",
|
|
22
|
-
status: "pass",
|
|
23
|
-
message: "default profile 'full'",
|
|
24
|
-
});
|
|
25
|
-
return results;
|
|
26
|
-
}
|
|
27
|
-
let cfg;
|
|
28
|
-
try {
|
|
29
|
-
cfg = JSON.parse(readFileSync(toolCfgPath, "utf8"));
|
|
30
|
-
} catch (err) {
|
|
31
|
-
results.push({
|
|
32
|
-
category: CATEGORY,
|
|
33
|
-
name: "tool-config",
|
|
34
|
-
status: "fail",
|
|
35
|
-
message: `tools-config.json malformed: ${err.message}`,
|
|
36
|
-
hint: "Delete the file to restore defaults.",
|
|
37
|
-
});
|
|
38
|
-
return results;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (!KNOWN_PROFILES.has(cfg.profile)) {
|
|
42
|
-
results.push({
|
|
43
|
-
category: CATEGORY,
|
|
44
|
-
name: "tool-config",
|
|
45
|
-
status: "warn",
|
|
46
|
-
message: `unknown profile '${cfg.profile}' — falling back to 'full'`,
|
|
47
|
-
});
|
|
48
|
-
} else {
|
|
49
|
-
results.push({ category: CATEGORY, name: "tool-config", status: "pass", message: `profile=${cfg.profile}` });
|
|
50
|
-
}
|
|
51
|
-
const count = cfg.profile === "custom"
|
|
52
|
-
? (cfg.customEnabled?.length ?? 0)
|
|
53
|
-
: cfg.profile === "read-only"
|
|
54
|
-
? 9
|
|
55
|
-
: 11;
|
|
56
|
-
results.push({ category: CATEGORY, name: "enabled-tools", status: "pass", message: `${count} tools enabled` });
|
|
57
|
-
|
|
58
|
-
return results;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export { run };
|
|
1
|
+
export function run(opts?: {}): Promise<{
|
|
2
|
+
category: string;
|
|
3
|
+
name: string;
|
|
4
|
+
status: string;
|
|
5
|
+
message: string;
|
|
6
|
+
}[] | {
|
|
7
|
+
category: string;
|
|
8
|
+
name: string;
|
|
9
|
+
status: string;
|
|
10
|
+
message: string;
|
|
11
|
+
hint: string;
|
|
12
|
+
}[]>;
|