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/reinit-watcher.d.ts
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
interface WatchReinitOptions {
|
|
6
|
-
debounceMs?: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare function watchReinit(
|
|
10
|
-
profileName: string,
|
|
11
|
-
callback: () => void | Promise<void>,
|
|
12
|
-
opts?: WatchReinitOptions
|
|
13
|
-
): ReinitWatcher;
|
|
14
|
-
|
|
1
|
+
export function watchReinit(profileName: any, callback: any, opts?: {}): {
|
|
2
|
+
dispose(): void;
|
|
3
|
+
};
|
|
15
4
|
/**
|
|
16
|
-
* Watch the `<configDir>/active` pointer file for profile switches
|
|
17
|
-
*
|
|
18
|
-
*
|
|
5
|
+
* Watch the `<configDir>/active` pointer file for profile switches.
|
|
6
|
+
*
|
|
7
|
+
* The per-profile `watchReinit` is bound to a single profile's `.reinit` file
|
|
8
|
+
* captured at daemon startup; if the user switches the active profile, that
|
|
9
|
+
* watcher will never see anything (the new profile's `.reinit` is in a
|
|
10
|
+
* different directory). This second watcher fires whenever `setActive()`
|
|
11
|
+
* rewrites the active-pointer atomically, letting the daemon call
|
|
12
|
+
* `client.reinit()` on profile switches AND rebind its per-profile watcher
|
|
13
|
+
* to the newly-active profile so subsequent login events propagate.
|
|
19
14
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
opts?: WatchReinitOptions
|
|
24
|
-
): ReinitWatcher;
|
|
25
|
-
|
|
26
|
-
export { type ReinitWatcher, type WatchReinitOptions, watchActiveProfile, watchReinit };
|
|
15
|
+
export function watchActiveProfile(configDirOverride: any, callback: any, opts?: {}): {
|
|
16
|
+
dispose(): void;
|
|
17
|
+
};
|
package/dist/reinit-watcher.mjs
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atomically write `data` to `path` via a `${path}.tmp` staging file and
|
|
3
|
+
* `renameSync`. On Windows, Node's renameSync uses MoveFileExW with
|
|
4
|
+
* MOVEFILE_REPLACE_EXISTING, so the destination is replaced atomically with
|
|
5
|
+
* no rmSync window. On any failure, best-effort delete the `.tmp` file and
|
|
6
|
+
* re-throw the original error.
|
|
7
|
+
*
|
|
8
|
+
* The caller is responsible for `mkdirSync` of the parent directory and for
|
|
9
|
+
* any post-write `chmod` / permissions hardening; this helper only owns the
|
|
10
|
+
* write+rename pair.
|
|
11
|
+
*
|
|
12
|
+
* @param {string} path Final destination path.
|
|
13
|
+
* @param {string|Buffer|Uint8Array} data Bytes to write.
|
|
14
|
+
* @param {string|object} [opts] Encoding string or fs.writeFileSync options.
|
|
15
|
+
*/
|
|
16
|
+
export function safeAtomicWriteFileSync(path: string, data: string | Buffer | Uint8Array, opts?: string | object): void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export function buildRuntimeEndpoints(origin: any): {
|
|
2
|
+
session: string;
|
|
3
|
+
csrf: string;
|
|
4
|
+
signInEmail: string;
|
|
5
|
+
otpRedirectLink: string;
|
|
6
|
+
ssoDetails: string;
|
|
7
|
+
models: string;
|
|
8
|
+
asi: string;
|
|
9
|
+
rateLimits: string;
|
|
10
|
+
experiments: string;
|
|
11
|
+
userInfo: string;
|
|
12
|
+
};
|
|
13
|
+
export function pageRequest(page: any, url: any, init?: {}): Promise<any>;
|
|
14
|
+
export function pollSession(page: any, sessionUrl: any, { timeoutMs, intervalMs }?: {
|
|
15
|
+
timeoutMs?: number | undefined;
|
|
16
|
+
intervalMs?: number | undefined;
|
|
17
|
+
}): Promise<any>;
|
|
18
|
+
export function deriveAccountFlags({ experiments, userInfo, asi }: {
|
|
19
|
+
experiments: any;
|
|
20
|
+
userInfo: any;
|
|
21
|
+
asi: any;
|
|
22
|
+
}): {
|
|
23
|
+
isPro: any;
|
|
24
|
+
isMax: boolean;
|
|
25
|
+
isEnterprise: boolean;
|
|
26
|
+
canUseComputer: any;
|
|
27
|
+
};
|
|
28
|
+
export function deriveTier(payload: any): "Max" | "Pro" | "Enterprise" | "Authenticated";
|
|
29
|
+
export function collectSessionMetadata(page: any, origin: any, opts?: {}): Promise<{
|
|
30
|
+
sessionData: any;
|
|
31
|
+
models: any;
|
|
32
|
+
asi: any;
|
|
33
|
+
rateLimits: any;
|
|
34
|
+
experiments: any;
|
|
35
|
+
userInfo: any;
|
|
36
|
+
tier: string;
|
|
37
|
+
cache: {
|
|
38
|
+
modelsConfig: any;
|
|
39
|
+
rateLimits: any;
|
|
40
|
+
isPro: any;
|
|
41
|
+
isMax: boolean;
|
|
42
|
+
isEnterprise: boolean;
|
|
43
|
+
canUseComputer: any;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ToolProfile = "read-only" | "full" | "custom";
|
|
2
|
+
interface ToolConfig {
|
|
3
|
+
profile: ToolProfile;
|
|
4
|
+
customEnabled?: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare function loadToolConfig(): ToolConfig;
|
|
7
|
+
export declare function getEnabledTools(config: ToolConfig): Set<string>;
|
|
8
|
+
export declare function saveToolConfig(config: ToolConfig): void;
|
|
9
|
+
export declare function watchToolConfig(onChange: (config: ToolConfig) => void): void;
|
|
10
|
+
export {};
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import type { PerplexityClient } from "./client.js";
|
|
3
|
+
type GetClient = () => Promise<PerplexityClient>;
|
|
4
|
+
export interface ToolAuditEvent {
|
|
5
|
+
tool: string;
|
|
6
|
+
clientId: string;
|
|
7
|
+
source: "loopback" | "tunnel";
|
|
8
|
+
durationMs: number;
|
|
9
|
+
ok: boolean;
|
|
10
|
+
error?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ToolProgressEvent {
|
|
13
|
+
tool: string;
|
|
14
|
+
clientId: string;
|
|
15
|
+
source: "loopback" | "tunnel";
|
|
16
|
+
progress: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface ToolHooks {
|
|
19
|
+
onToolSettled?: (event: ToolAuditEvent) => void;
|
|
20
|
+
onToolProgress?: (event: ToolProgressEvent) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function registerTools(server: McpServer, getClient: GetClient, enabledTools?: Set<string>, hooks?: ToolHooks): void;
|
|
23
|
+
export {};
|
package/dist/tty-prompt.d.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
stderr.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
1
|
+
export function promptSecret({ stdin, stderr, prompt }?: {
|
|
2
|
+
stdin?: (NodeJS.ReadStream & {
|
|
3
|
+
fd: 0;
|
|
4
|
+
}) | undefined;
|
|
5
|
+
stderr?: (NodeJS.WriteStream & {
|
|
6
|
+
fd: 2;
|
|
7
|
+
}) | undefined;
|
|
8
|
+
prompt?: string | undefined;
|
|
9
|
+
}): Promise<any>;
|
|
14
10
|
/**
|
|
15
11
|
* Minimal y/N confirmation prompt for destructive-ish CLI subcommands.
|
|
16
12
|
*
|
|
@@ -21,24 +17,12 @@ function promptSecret({ stdin = process.stdin, stderr = process.stderr, prompt =
|
|
|
21
17
|
* decline. Returns `true` on confirm, `false` on decline.
|
|
22
18
|
* - Does NOT exit the process; the caller decides whether to exit 130.
|
|
23
19
|
*/
|
|
24
|
-
function promptYesNo({ stdin
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
resolve(value);
|
|
34
|
-
};
|
|
35
|
-
rl.once("line", (line) => {
|
|
36
|
-
const answer = String(line).trim().toLowerCase();
|
|
37
|
-
finish(answer === "y" || answer === "yes");
|
|
38
|
-
});
|
|
39
|
-
// EOF / stream close before a line arrives → decline.
|
|
40
|
-
rl.once("close", () => finish(false));
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { promptSecret, promptYesNo };
|
|
20
|
+
export function promptYesNo({ stdin, stderr, prompt }?: {
|
|
21
|
+
stdin?: (NodeJS.ReadStream & {
|
|
22
|
+
fd: 0;
|
|
23
|
+
}) | undefined;
|
|
24
|
+
stderr?: (NodeJS.WriteStream & {
|
|
25
|
+
fd: 2;
|
|
26
|
+
}) | undefined;
|
|
27
|
+
prompt?: string | undefined;
|
|
28
|
+
}): Promise<any>;
|
package/dist/vault.d.ts
CHANGED
|
@@ -1,37 +1,117 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
1
|
+
/**
|
|
2
|
+
* TEST SEAM — drop scrypt cost during tests by setting (logN, r, p).
|
|
3
|
+
* MUST NOT be called in production code paths. Cleared by `__resetKeyCache()`.
|
|
4
|
+
*
|
|
5
|
+
* Encrypt path uses the override when set (so tests can write blobs with
|
|
6
|
+
* logN=12 in ~5ms instead of logN=17 in ~300ms). Decrypt path always uses the
|
|
7
|
+
* params embedded in the blob, regardless of any override. The decrypt-time
|
|
8
|
+
* floor check (logN >= SCRYPT_LOGN_FLOOR) is enforced unconditionally.
|
|
9
|
+
*
|
|
10
|
+
* @param {{logN:number, r:number, p:number}} params
|
|
11
|
+
*/
|
|
12
|
+
export function __setKdfParamsForTest(params: {
|
|
13
|
+
logN: number;
|
|
14
|
+
r: number;
|
|
15
|
+
p: number;
|
|
16
|
+
}): void;
|
|
17
|
+
/**
|
|
18
|
+
* Encrypt `plaintext` with the supplied 32-byte `key` and emit a v3 blob.
|
|
19
|
+
* The embedded salt is fresh per call and the active KDF params are encoded
|
|
20
|
+
* into the header — but the KDF itself is NOT invoked here (caller passes a
|
|
21
|
+
* pre-derived 32-byte key). Public signature is stable; internal format
|
|
22
|
+
* always emits the latest version.
|
|
23
|
+
*
|
|
24
|
+
* @param {Buffer} plaintext
|
|
25
|
+
* @param {Buffer} key 32-byte AES-256-GCM key.
|
|
26
|
+
* @returns {Buffer}
|
|
27
|
+
*/
|
|
28
|
+
export function encryptBlob(plaintext: Buffer, key: Buffer): Buffer;
|
|
29
|
+
/**
|
|
30
|
+
* Decrypt a vault blob using the supplied 32-byte key. Accepts v1, v2, and v3
|
|
31
|
+
* formats. The embedded salt + KDF params on v2/v3 are *unused* on this code
|
|
32
|
+
* path — the caller is presumed to already have a directly-usable key (e.g.
|
|
33
|
+
* from the OS keychain). For passphrase-derived keys, the higher-level read
|
|
34
|
+
* path derives the key from the embedded salt+params before calling here.
|
|
35
|
+
*
|
|
36
|
+
* @param {Buffer} blob
|
|
37
|
+
* @param {Buffer} key 32-byte AES-256-GCM key.
|
|
38
|
+
* @returns {Buffer}
|
|
39
|
+
*/
|
|
40
|
+
export function decryptBlob(blob: Buffer, key: Buffer): Buffer;
|
|
41
|
+
/**
|
|
42
|
+
* Reset the in-memory caches (key, unseal material, and the test-seam KDF
|
|
43
|
+
* params override). Called on profile-state changes (account switch, login,
|
|
44
|
+
* logout) and from tests to ensure isolation.
|
|
45
|
+
*/
|
|
46
|
+
export function __resetKeyCache(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Probe the OS keychain for vault unseal capability. Returns whether keytar is
|
|
49
|
+
* available and whether a master key already exists. Caches the keytar
|
|
50
|
+
* availability check per-process so repeated probes do not trigger multiple
|
|
51
|
+
* macOS Keychain permission prompts (issue #6 bug 3). Respects
|
|
52
|
+
* PERPLEXITY_DISABLE_KEYCHAIN=1.
|
|
53
|
+
*
|
|
54
|
+
* @returns {Promise<{available: boolean, hasKey: boolean}>}
|
|
55
|
+
*/
|
|
56
|
+
export function probeKeychainState(): Promise<{
|
|
57
|
+
available: boolean;
|
|
58
|
+
hasKey: boolean;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* Resolve the unseal context for the vault: either a 32-byte key from the OS
|
|
62
|
+
* keychain, or a passphrase string (env var / TTY / SecretStorage-injected).
|
|
63
|
+
* Cached in `_unsealMaterialCache` to mirror `_keyCache`'s UX trade-off — we
|
|
64
|
+
* do not re-prompt or re-hit the keychain on every vault op. Cleared by
|
|
22
65
|
* `__resetKeyCache()`.
|
|
66
|
+
*
|
|
67
|
+
* Sibling of `getMasterKey()`. Key derivation is per-blob (the salt is read
|
|
68
|
+
* off each blob and, for v3, fed into scrypt with the embedded params), so
|
|
69
|
+
* unseal material can no longer be pre-derived to a single Buffer at unseal
|
|
70
|
+
* time for passphrase users.
|
|
71
|
+
*
|
|
72
|
+
* @returns {Promise<{kind:"key", key:Buffer}|{kind:"passphrase", passphrase:string}>}
|
|
73
|
+
*/
|
|
74
|
+
export function getUnsealMaterial(): Promise<{
|
|
75
|
+
kind: "key";
|
|
76
|
+
key: Buffer;
|
|
77
|
+
} | {
|
|
78
|
+
kind: "passphrase";
|
|
79
|
+
passphrase: string;
|
|
80
|
+
}>;
|
|
81
|
+
/**
|
|
82
|
+
* Resolve EVERY available unseal material in preference order. Used by the
|
|
83
|
+
* vault read path so that when a vault.enc was written with one path
|
|
84
|
+
* (e.g. passphrase, when keychain wasn't yet wired) and the user later gains
|
|
85
|
+
* access to a different path (e.g. keytar starts working after a libsecret
|
|
86
|
+
* install or extension upgrade), reads transparently fall back instead of
|
|
87
|
+
* crashing with "Vault decrypt failed: wrong passphrase or corrupted
|
|
88
|
+
* ciphertext".
|
|
89
|
+
*
|
|
90
|
+
* Skips the TTY prompt — that's interactive and only meaningful as a primary
|
|
91
|
+
* unseal path, never as a silent fallback.
|
|
92
|
+
*
|
|
93
|
+
* @returns {Promise<Array<{kind:"key", key:Buffer}|{kind:"passphrase", passphrase:string}>>}
|
|
94
|
+
*/
|
|
95
|
+
export function getAllUnsealMaterials(): Promise<Array<{
|
|
96
|
+
kind: "key";
|
|
97
|
+
key: Buffer;
|
|
98
|
+
} | {
|
|
99
|
+
kind: "passphrase";
|
|
100
|
+
passphrase: string;
|
|
101
|
+
}>>;
|
|
102
|
+
/**
|
|
103
|
+
* Return a 32-byte master key. SIGNATURE PRESERVED for back-compat; internal
|
|
104
|
+
* implementation now defers to `getUnsealMaterial()`. For passphrase users,
|
|
105
|
+
* this derives via HKDF + the legacy static salt — which is suitable as a
|
|
106
|
+
* default-derivation entry point but is NOT what the v2/v3 read/write paths
|
|
107
|
+
* use (they derive against the per-blob random salt, with v3 also stretching
|
|
108
|
+
* via scrypt). Prefer `getUnsealMaterial()` in new code that touches
|
|
109
|
+
* encrypted blobs.
|
|
23
110
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
declare class Vault {
|
|
31
|
-
get(profile: string, key: string): Promise<string | null>;
|
|
32
|
-
set(profile: string, key: string, value: string): Promise<void>;
|
|
33
|
-
delete(profile: string, key: string): Promise<void>;
|
|
34
|
-
deleteAll(profile: string): Promise<void>;
|
|
111
|
+
export function getMasterKey(): Promise<any>;
|
|
112
|
+
export class Vault {
|
|
113
|
+
get(profile: any, key: any): Promise<any>;
|
|
114
|
+
set(profile: any, key: any, value: any): Promise<void>;
|
|
115
|
+
delete(profile: any, key: any): Promise<void>;
|
|
116
|
+
deleteAll(profile: any): Promise<void>;
|
|
35
117
|
}
|
|
36
|
-
|
|
37
|
-
export { type UnsealMaterial, Vault, __resetKeyCache, __setKdfParamsForTest, decryptBlob, encryptBlob, getMasterKey, getUnsealMaterial };
|
package/dist/vault.mjs
CHANGED
|
@@ -6,10 +6,11 @@ import {
|
|
|
6
6
|
encryptBlob,
|
|
7
7
|
getAllUnsealMaterials,
|
|
8
8
|
getMasterKey,
|
|
9
|
-
getUnsealMaterial
|
|
10
|
-
|
|
9
|
+
getUnsealMaterial,
|
|
10
|
+
probeKeychainState
|
|
11
|
+
} from "./chunk-C5I7KXHK.mjs";
|
|
11
12
|
import "./chunk-MTDFKNXX.mjs";
|
|
12
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-E3GRJXXJ.mjs";
|
|
13
14
|
import "./chunk-4UEJOM6W.mjs";
|
|
14
15
|
export {
|
|
15
16
|
Vault,
|
|
@@ -19,5 +20,6 @@ export {
|
|
|
19
20
|
encryptBlob,
|
|
20
21
|
getAllUnsealMaterials,
|
|
21
22
|
getMasterKey,
|
|
22
|
-
getUnsealMaterial
|
|
23
|
+
getUnsealMaterial,
|
|
24
|
+
probeKeychainState
|
|
23
25
|
};
|
package/dist/viewer-detect.d.ts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { detectAllViewers, detectViewer };
|
|
1
|
+
export function detectViewer(id: any): Promise<boolean>;
|
|
2
|
+
export function detectAllViewers(): Promise<any>;
|
package/dist/viewers.d.ts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
mdPath: string;
|
|
15
|
-
profile?: string;
|
|
16
|
-
}): string;
|
|
17
|
-
|
|
18
|
-
export { buildViewerUrl, ensureObsidianBridge, listViewers, loadViewerConfig, saveViewerConfig, substituteViewerTemplate };
|
|
1
|
+
export function listViewers(overrides?: any[]): {
|
|
2
|
+
detected: boolean;
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
urlTemplate: string;
|
|
7
|
+
needsVaultBridge: boolean;
|
|
8
|
+
}[];
|
|
9
|
+
export function loadViewerConfig(): any;
|
|
10
|
+
export function saveViewerConfig(viewer: any): any;
|
|
11
|
+
export function substituteViewerTemplate(viewer: any, values: any): any;
|
|
12
|
+
export function ensureObsidianBridge(options: any): string;
|
|
13
|
+
export function buildViewerUrl(options: any): any;
|
package/dist/viewers.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "perplexity-user-mcp",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.47",
|
|
4
4
|
"mcpName": "io.github.Automations-Project/perplexity-user-mcp",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Perplexity AI MCP server — browser automation for search, reasoning, research, and compute. Not affiliated with Perplexity AI, Inc.",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"CHANGELOG.md"
|
|
127
127
|
],
|
|
128
128
|
"scripts": {
|
|
129
|
-
"build": "tsup",
|
|
129
|
+
"build": "tsup --no-dts && tsc --allowJs --emitDeclarationOnly && node scripts/post-build-shebang.mjs",
|
|
130
130
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
131
131
|
"test": "cd ../.. && npx vitest run packages/mcp-server/test",
|
|
132
132
|
"test:coverage": "cd ../.. && npx vitest run --coverage packages/mcp-server/test"
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { PerplexityClient } from './client.js';
|
|
2
|
-
import './config.js';
|
|
3
|
-
import 'patchright';
|
|
4
|
-
|
|
5
|
-
interface CloudSyncProgressEvent {
|
|
6
|
-
phase: "starting" | "syncing" | "done" | "cancelled" | "error";
|
|
7
|
-
fetched?: number;
|
|
8
|
-
total?: number;
|
|
9
|
-
inserted?: number;
|
|
10
|
-
updated?: number;
|
|
11
|
-
skipped?: number;
|
|
12
|
-
error?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface CloudSyncOptions {
|
|
16
|
-
client?: PerplexityClient;
|
|
17
|
-
getClient?: () => Promise<PerplexityClient>;
|
|
18
|
-
onProgress?: (evt: CloudSyncProgressEvent) => void;
|
|
19
|
-
pageSize?: number;
|
|
20
|
-
signal?: AbortSignal;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface CloudSyncResult {
|
|
24
|
-
fetched: number;
|
|
25
|
-
total: number;
|
|
26
|
-
inserted: number;
|
|
27
|
-
updated: number;
|
|
28
|
-
skipped: number;
|
|
29
|
-
cancelled: boolean;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
declare function syncCloudHistory(opts?: CloudSyncOptions): Promise<CloudSyncResult>;
|
|
33
|
-
|
|
34
|
-
declare function hydrateCloudHistoryEntry(
|
|
35
|
-
historyId: string,
|
|
36
|
-
opts?: {
|
|
37
|
-
client?: PerplexityClient;
|
|
38
|
-
getClient?: () => Promise<PerplexityClient>;
|
|
39
|
-
},
|
|
40
|
-
): Promise<{ action: "skipped-local" | "skipped-hydrated" | "hydrated"; id?: string }>;
|
|
41
|
-
|
|
42
|
-
export { type CloudSyncOptions, type CloudSyncProgressEvent, type CloudSyncResult, hydrateCloudHistoryEntry, syncCloudHistory };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
type DoctorStatus = "pass" | "warn" | "fail" | "skip";
|
|
2
|
-
|
|
3
|
-
type DoctorCategory =
|
|
4
|
-
| "runtime" | "config" | "profiles" | "vault" | "browser"
|
|
5
|
-
| "native-deps" | "network" | "ide" | "mcp" | "probe";
|
|
6
|
-
|
|
7
|
-
interface DoctorCheck {
|
|
8
|
-
category: DoctorCategory;
|
|
9
|
-
name: string;
|
|
10
|
-
status: DoctorStatus;
|
|
11
|
-
message: string;
|
|
12
|
-
detail?: Record<string, unknown>;
|
|
13
|
-
hint?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface DoctorReport {
|
|
17
|
-
overall: DoctorStatus;
|
|
18
|
-
generatedAt: string;
|
|
19
|
-
durationMs: number;
|
|
20
|
-
activeProfile: string | null;
|
|
21
|
-
probeRan: boolean;
|
|
22
|
-
byCategory: Record<DoctorCategory, {
|
|
23
|
-
status: DoctorStatus;
|
|
24
|
-
checks: DoctorCheck[];
|
|
25
|
-
}>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
interface RunAllOpts {
|
|
29
|
-
configDir?: string;
|
|
30
|
-
profile?: string;
|
|
31
|
-
probe?: boolean;
|
|
32
|
-
allProfiles?: boolean;
|
|
33
|
-
ideStatuses?: Record<string, unknown>;
|
|
34
|
-
baseDir?: string;
|
|
35
|
-
injected?: Partial<Record<DoctorCategory, DoctorCheck[]>>;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
declare const CATEGORIES: ReadonlyArray<DoctorCategory>;
|
|
39
|
-
declare function exitCodeFor(report: { overall: DoctorStatus }): number;
|
|
40
|
-
declare function runAll(opts?: RunAllOpts): Promise<DoctorReport>;
|
|
41
|
-
declare function formatReportMarkdown(report: DoctorReport): string;
|
|
42
|
-
|
|
43
|
-
export { CATEGORIES, type DoctorCategory, type DoctorCheck, type DoctorReport, type DoctorStatus, type RunAllOpts, exitCodeFor, formatReportMarkdown, runAll };
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { HistoryItem, HistoryEntryDetail } from '@perplexity-user-mcp/shared';
|
|
2
|
-
|
|
3
|
-
interface HistoryStoreEntryInput extends Partial<HistoryItem> {
|
|
4
|
-
tool: string;
|
|
5
|
-
query: string;
|
|
6
|
-
body?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface RebuildIndexResult {
|
|
10
|
-
scanned: number;
|
|
11
|
-
recovered: number;
|
|
12
|
-
skipped: number;
|
|
13
|
-
items: Array<HistoryItem & { filename: string }>;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare const HISTORY_LIMIT: number;
|
|
17
|
-
declare function getHistoryDir(): string;
|
|
18
|
-
declare function getAttachmentsRoot(): string;
|
|
19
|
-
declare function getIndexPath(): string;
|
|
20
|
-
declare function append(entry: HistoryStoreEntryInput): HistoryItem;
|
|
21
|
-
declare function update(id: string, patch?: Partial<HistoryStoreEntryInput> & { body?: string }): HistoryItem | null;
|
|
22
|
-
declare function list(options?: {
|
|
23
|
-
limit?: number;
|
|
24
|
-
status?: "completed" | "pending" | "failed";
|
|
25
|
-
tool?: string;
|
|
26
|
-
tools?: string[];
|
|
27
|
-
filter?: string;
|
|
28
|
-
}): HistoryItem[];
|
|
29
|
-
declare function get(id: string): HistoryEntryDetail | null;
|
|
30
|
-
declare function deleteEntry(id: string): boolean;
|
|
31
|
-
declare function pin(id: string, pinned: boolean): HistoryItem | null;
|
|
32
|
-
declare function tag(id: string, tags: string[]): HistoryItem | null;
|
|
33
|
-
declare function rebuildIndex(): RebuildIndexResult;
|
|
34
|
-
declare function getMdPath(id: string): string | null;
|
|
35
|
-
declare function getAttachmentsDir(id: string): string | null;
|
|
36
|
-
declare function findPendingByThread(threadSlug: string): HistoryItem | null;
|
|
37
|
-
declare function countAll(): number;
|
|
38
|
-
declare function appendHistory(entry: HistoryStoreEntryInput): HistoryItem;
|
|
39
|
-
declare function readHistory(limit?: number): HistoryItem[];
|
|
40
|
-
|
|
41
|
-
interface CloudUpsertMeta {
|
|
42
|
-
backendUuid: string;
|
|
43
|
-
query?: string;
|
|
44
|
-
answerPreview?: string;
|
|
45
|
-
createdAt?: string;
|
|
46
|
-
threadUrl?: string;
|
|
47
|
-
threadSlug?: string | null;
|
|
48
|
-
readWriteToken?: string | null;
|
|
49
|
-
mode?: string | null;
|
|
50
|
-
model?: string | null;
|
|
51
|
-
sourceCount?: number;
|
|
52
|
-
status?: "completed" | "pending" | "failed";
|
|
53
|
-
tool?: string;
|
|
54
|
-
tier?: HistoryItem["tier"];
|
|
55
|
-
language?: string | null;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
declare function findByBackendUuid(backendUuid: string | null | undefined): (HistoryItem & { filename: string }) | null;
|
|
59
|
-
declare function upsertFromCloud(meta: CloudUpsertMeta): { action: "inserted" | "updated" | "skipped-local"; id: string };
|
|
60
|
-
declare function hydrateCloudEntry(
|
|
61
|
-
id: string,
|
|
62
|
-
payload: { body?: string; sources?: HistoryItem["sources"]; attachments?: HistoryItem["attachments"]; answerPreview?: string; sourceCount?: number },
|
|
63
|
-
): HistoryItem | null;
|
|
64
|
-
|
|
65
|
-
export { type CloudUpsertMeta, HISTORY_LIMIT, type HistoryStoreEntryInput, type RebuildIndexResult, append, appendHistory, countAll, deleteEntry, findByBackendUuid, findPendingByThread, get, getAttachmentsDir, getAttachmentsRoot, getHistoryDir, getIndexPath, getMdPath, hydrateCloudEntry, list, pin, readHistory, rebuildIndex, tag, update, upsertFromCloud };
|