perplexity-user-mcp 0.8.37 → 0.8.39

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.
Files changed (63) hide show
  1. package/README.md +203 -9
  2. package/dist/checks/vault.d.ts +41 -0
  3. package/dist/checks/vault.mjs +23 -0
  4. package/dist/{chunk-Q2VY4R5F.mjs → chunk-2FPGJKCA.mjs} +2 -2
  5. package/dist/{chunk-ZQFUZPLO.mjs → chunk-452DK6OS.mjs} +2 -2
  6. package/dist/{chunk-OF4DMAPJ.mjs → chunk-B65IJQZJ.mjs} +1 -1
  7. package/dist/{chunk-H4BUAPPO.mjs → chunk-C3HPFFTD.mjs} +4 -4
  8. package/dist/{chunk-LZPLNZ5U.mjs → chunk-D254EFYB.mjs} +1 -1
  9. package/dist/{chunk-Z7DAACGZ.mjs → chunk-DQQISMYN.mjs} +2 -2
  10. package/dist/{chunk-3B276PGG.mjs → chunk-FKQ3HP4Q.mjs} +1 -1
  11. package/dist/{chunk-7JL36EBH.mjs → chunk-HNSPNCFH.mjs} +1 -1
  12. package/dist/{chunk-6EP2BLTV.mjs → chunk-KJFX2ZXR.mjs} +1 -1
  13. package/dist/{chunk-SVPRB62V.mjs → chunk-NJX4RBO6.mjs} +1 -1
  14. package/dist/{chunk-X45O6YD3.mjs → chunk-RK4EBZJ3.mjs} +28 -9
  15. package/dist/{chunk-TQLCLE4L.mjs → chunk-S677V2JU.mjs} +57 -12
  16. package/dist/{chunk-S5VD7WTU.mjs → chunk-T6ARJK2P.mjs} +6 -6
  17. package/dist/{chunk-HTUAQRKH.mjs → chunk-TDXETAQT.mjs} +1 -1
  18. package/dist/{chunk-LKJMLGFP.mjs → chunk-U7QPUNRH.mjs} +2 -2
  19. package/dist/{chunk-PE23RMXY.mjs → chunk-V4U3JM4R.mjs} +1 -1
  20. package/dist/chunk-WDIW33DA.mjs +77 -0
  21. package/dist/{chunk-KCXM2M4B.mjs → chunk-XTRJSV72.mjs} +1 -1
  22. package/dist/cli.d.ts +348 -2
  23. package/dist/cli.mjs +259 -3
  24. package/dist/client.mjs +6 -6
  25. package/dist/cloud-sync.mjs +8 -8
  26. package/dist/config.mjs +3 -3
  27. package/dist/daemon/attach.mjs +17 -17
  28. package/dist/daemon/audit.mjs +2 -2
  29. package/dist/daemon/client-http.mjs +17 -17
  30. package/dist/daemon/index.mjs +18 -18
  31. package/dist/daemon/install-tunnel.mjs +2 -2
  32. package/dist/daemon/launcher.mjs +16 -16
  33. package/dist/daemon/lockfile.mjs +2 -2
  34. package/dist/daemon/server.mjs +11 -11
  35. package/dist/daemon/token.mjs +2 -2
  36. package/dist/daemon/tunnel-providers/index.mjs +3 -3
  37. package/dist/doctor.mjs +2 -2
  38. package/dist/export.mjs +4 -4
  39. package/dist/health-check.d.ts +1 -1
  40. package/dist/health-check.mjs +3 -3
  41. package/dist/history-store.mjs +2 -2
  42. package/dist/impit-login-runner.d.ts +1 -1
  43. package/dist/impit-login-runner.mjs +4 -4
  44. package/dist/index.d.ts +5 -1
  45. package/dist/index.mjs +96 -24
  46. package/dist/login-runner.d.ts +1 -1
  47. package/dist/login-runner.mjs +3 -3
  48. package/dist/logout.d.ts +1 -1
  49. package/dist/logout.mjs +2 -2
  50. package/dist/manual-login-runner.d.ts +1 -1
  51. package/dist/manual-login-runner.mjs +3 -3
  52. package/dist/{native-deps-YNKXITRY.mjs → native-deps-IE4B55EL.mjs} +4 -4
  53. package/dist/profiles.mjs +1 -1
  54. package/dist/refresh.mjs +4 -4
  55. package/dist/reinit-watcher.d.ts +12 -1
  56. package/dist/reinit-watcher.mjs +4 -2
  57. package/dist/vault.d-BSJWDLhp.d.ts +37 -0
  58. package/dist/vault.mjs +4 -2
  59. package/dist/viewers.mjs +1 -1
  60. package/package.json +1 -1
  61. package/dist/chunk-U3DGFLXZ.mjs +0 -43
  62. package/dist/vault.d-BtRSLZiM.d.ts +0 -8
  63. /package/dist/{chunk-XKSWCEGI.mjs → chunk-HJIXH6CL.mjs} +0 -0
@@ -4,9 +4,9 @@ import {
4
4
  getTokenPath,
5
5
  readToken,
6
6
  rotateToken
7
- } from "../chunk-HTUAQRKH.mjs";
7
+ } from "../chunk-TDXETAQT.mjs";
8
8
  import "../chunk-MTDFKNXX.mjs";
9
- import "../chunk-XKSWCEGI.mjs";
9
+ import "../chunk-HJIXH6CL.mjs";
10
10
  import "../chunk-4UEJOM6W.mjs";
11
11
  export {
12
12
  ensureToken,
@@ -23,11 +23,11 @@ import {
23
23
  writeNgrokSettings,
24
24
  writeTunnelConfig,
25
25
  writeTunnelSettings
26
- } from "../../chunk-KCXM2M4B.mjs";
26
+ } from "../../chunk-XTRJSV72.mjs";
27
27
  import "../../chunk-6YMQVLFX.mjs";
28
- import "../../chunk-3B276PGG.mjs";
28
+ import "../../chunk-FKQ3HP4Q.mjs";
29
29
  import "../../chunk-MTDFKNXX.mjs";
30
- import "../../chunk-XKSWCEGI.mjs";
30
+ import "../../chunk-HJIXH6CL.mjs";
31
31
  import "../../chunk-4UEJOM6W.mjs";
32
32
  export {
33
33
  DeleteNamedTunnelError,
package/dist/doctor.mjs CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  formatReportMarkdown,
5
5
  rollupStatus,
6
6
  runAll
7
- } from "./chunk-7JL36EBH.mjs";
8
- import "./chunk-XKSWCEGI.mjs";
7
+ } from "./chunk-HNSPNCFH.mjs";
8
+ import "./chunk-HJIXH6CL.mjs";
9
9
  import "./chunk-4UEJOM6W.mjs";
10
10
  export {
11
11
  CATEGORIES,
package/dist/export.mjs CHANGED
@@ -2,11 +2,11 @@ import {
2
2
  FORMAT_TO_CONTENT_TYPE,
3
3
  exportThread,
4
4
  resolveExportApiFormat
5
- } from "./chunk-LZPLNZ5U.mjs";
6
- import "./chunk-LKJMLGFP.mjs";
7
- import "./chunk-TQLCLE4L.mjs";
5
+ } from "./chunk-D254EFYB.mjs";
6
+ import "./chunk-U7QPUNRH.mjs";
7
+ import "./chunk-S677V2JU.mjs";
8
8
  import "./chunk-MTDFKNXX.mjs";
9
- import "./chunk-XKSWCEGI.mjs";
9
+ import "./chunk-HJIXH6CL.mjs";
10
10
  import "./chunk-4UEJOM6W.mjs";
11
11
  export {
12
12
  FORMAT_TO_CONTENT_TYPE,
@@ -1,6 +1,6 @@
1
1
  import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
2
2
  import { chromium } from 'patchright';
3
- import { Vault } from './vault.d-BtRSLZiM.js';
3
+ import { Vault } from './vault.d-BSJWDLhp.js';
4
4
  import { getProfilePaths, getActiveName } from './profiles.d-DqS1oZWr.js';
5
5
  import { getOrCreateContext, findBrowser } from './config.js';
6
6
  import { redact } from './redact.js';
@@ -7,15 +7,15 @@ import {
7
7
  import {
8
8
  findBrowser,
9
9
  getOrCreateContext
10
- } from "./chunk-LKJMLGFP.mjs";
10
+ } from "./chunk-U7QPUNRH.mjs";
11
11
  import {
12
12
  Vault
13
- } from "./chunk-TQLCLE4L.mjs";
13
+ } from "./chunk-S677V2JU.mjs";
14
14
  import "./chunk-MTDFKNXX.mjs";
15
15
  import {
16
16
  getActiveName,
17
17
  getProfilePaths
18
- } from "./chunk-XKSWCEGI.mjs";
18
+ } from "./chunk-HJIXH6CL.mjs";
19
19
  import "./chunk-4UEJOM6W.mjs";
20
20
 
21
21
  // src/health-check.js
@@ -20,8 +20,8 @@ import {
20
20
  tag,
21
21
  update,
22
22
  upsertFromCloud
23
- } from "./chunk-OF4DMAPJ.mjs";
24
- import "./chunk-XKSWCEGI.mjs";
23
+ } from "./chunk-B65IJQZJ.mjs";
24
+ import "./chunk-HJIXH6CL.mjs";
25
25
  import "./chunk-4UEJOM6W.mjs";
26
26
  export {
27
27
  HISTORY_LIMIT,
@@ -1,5 +1,5 @@
1
1
  import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
2
- import { Vault } from './vault.d-BtRSLZiM.js';
2
+ import { Vault } from './vault.d-BSJWDLhp.js';
3
3
  import { recordLoginSuccess, getActiveName, getProfilePaths } from './profiles.d-DqS1oZWr.js';
4
4
  import { redact } from './redact.js';
5
5
  import { b as buildRuntimeEndpoints } from './session-metadata-B9aV_n5g.js';
@@ -7,22 +7,22 @@ import {
7
7
  import {
8
8
  isImpitAvailable,
9
9
  loadImpit
10
- } from "./chunk-Z7DAACGZ.mjs";
10
+ } from "./chunk-DQQISMYN.mjs";
11
11
  import {
12
12
  PERPLEXITY_URL,
13
13
  findBrowser,
14
14
  getOrCreateContext,
15
15
  resolveBrowserExecutable
16
- } from "./chunk-LKJMLGFP.mjs";
16
+ } from "./chunk-U7QPUNRH.mjs";
17
17
  import {
18
18
  Vault
19
- } from "./chunk-TQLCLE4L.mjs";
19
+ } from "./chunk-S677V2JU.mjs";
20
20
  import "./chunk-MTDFKNXX.mjs";
21
21
  import {
22
22
  getActiveName,
23
23
  getProfilePaths,
24
24
  recordLoginSuccess
25
- } from "./chunk-XKSWCEGI.mjs";
25
+ } from "./chunk-HJIXH6CL.mjs";
26
26
  import "./chunk-4UEJOM6W.mjs";
27
27
 
28
28
  // src/impit-login-runner.js
package/dist/index.d.ts CHANGED
@@ -154,6 +154,10 @@ declare function __resetVaultPreflightForTests(): void;
154
154
  * don't need cookies (perplexity_doctor, anonymous perplexity_search).
155
155
  */
156
156
  declare function runVaultPreflight(stderr?: NodeJS.WritableStream): Promise<void>;
157
+ declare function waitForStdioInputClose(stdin?: NodeJS.ReadableStream): Promise<void>;
158
+ declare function shutdownClientWithTimeout(c: {
159
+ shutdown: () => Promise<void>;
160
+ } | undefined, timeoutMs?: number): Promise<void>;
157
161
  declare function main(): Promise<void>;
158
162
 
159
- export { type HistoryEntry, PerplexityClient, type ToolProfile, __resetVaultPreflightForTests, buildAnswerPreview, buildHistoryBody, buildHistoryEntry, buildIssueBody, buildIssueUrl, buildStoredHistoryEntry, decideTransport, exportThread, formatResponse, getEnabledTools, loadToolConfig, main, redactIssueBody, registerPrompts, registerResources, registerTools, runVaultPreflight, saveToolConfig, watchToolConfig };
163
+ export { type HistoryEntry, PerplexityClient, type ToolProfile, __resetVaultPreflightForTests, buildAnswerPreview, buildHistoryBody, buildHistoryEntry, buildIssueBody, buildIssueUrl, buildStoredHistoryEntry, decideTransport, exportThread, formatResponse, getEnabledTools, loadToolConfig, main, redactIssueBody, registerPrompts, registerResources, registerTools, runVaultPreflight, saveToolConfig, shutdownClientWithTimeout, waitForStdioInputClose, watchToolConfig };
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  CATEGORIES,
4
4
  formatReportMarkdown,
5
5
  runAll
6
- } from "./chunk-7JL36EBH.mjs";
6
+ } from "./chunk-HNSPNCFH.mjs";
7
7
  import {
8
8
  buildIssueBody,
9
9
  buildIssueUrl,
@@ -12,15 +12,15 @@ import {
12
12
  } from "./chunk-DPGMKSSA.mjs";
13
13
  import {
14
14
  attachToDaemon
15
- } from "./chunk-SVPRB62V.mjs";
15
+ } from "./chunk-NJX4RBO6.mjs";
16
16
  import {
17
17
  ensureDaemon,
18
18
  startDaemon
19
- } from "./chunk-X45O6YD3.mjs";
20
- import "./chunk-KCXM2M4B.mjs";
19
+ } from "./chunk-RK4EBZJ3.mjs";
20
+ import "./chunk-XTRJSV72.mjs";
21
21
  import "./chunk-6YMQVLFX.mjs";
22
- import "./chunk-3B276PGG.mjs";
23
- import "./chunk-6EP2BLTV.mjs";
22
+ import "./chunk-FKQ3HP4Q.mjs";
23
+ import "./chunk-KJFX2ZXR.mjs";
24
24
  import {
25
25
  buildAnswerPreview,
26
26
  buildHistoryBody,
@@ -35,26 +35,27 @@ import {
35
35
  registerTools,
36
36
  saveToolConfig,
37
37
  watchToolConfig
38
- } from "./chunk-S5VD7WTU.mjs";
39
- import "./chunk-PE23RMXY.mjs";
40
- import "./chunk-HTUAQRKH.mjs";
38
+ } from "./chunk-T6ARJK2P.mjs";
39
+ import "./chunk-V4U3JM4R.mjs";
40
+ import "./chunk-TDXETAQT.mjs";
41
41
  import {
42
+ watchActiveProfile,
42
43
  watchReinit
43
- } from "./chunk-U3DGFLXZ.mjs";
44
+ } from "./chunk-WDIW33DA.mjs";
44
45
  import "./chunk-HMKLWVXB.mjs";
45
46
  import {
46
47
  hydrateCloudHistoryEntry,
47
48
  syncCloudHistory
48
- } from "./chunk-Q2VY4R5F.mjs";
49
+ } from "./chunk-2FPGJKCA.mjs";
49
50
  import {
50
51
  PerplexityClient
51
- } from "./chunk-H4BUAPPO.mjs";
52
+ } from "./chunk-C3HPFFTD.mjs";
52
53
  import {
53
54
  getImpitRuntimeDir,
54
55
  getModelsCacheInfo,
55
56
  isImpitAvailable,
56
57
  refreshAccountInfo
57
- } from "./chunk-Z7DAACGZ.mjs";
58
+ } from "./chunk-DQQISMYN.mjs";
58
59
  import {
59
60
  append,
60
61
  countAll,
@@ -74,20 +75,20 @@ import {
74
75
  tag,
75
76
  update,
76
77
  upsertFromCloud
77
- } from "./chunk-OF4DMAPJ.mjs";
78
+ } from "./chunk-B65IJQZJ.mjs";
78
79
  import {
79
80
  exportThread
80
- } from "./chunk-LZPLNZ5U.mjs";
81
+ } from "./chunk-D254EFYB.mjs";
81
82
  import {
82
83
  findBrowser
83
- } from "./chunk-LKJMLGFP.mjs";
84
+ } from "./chunk-U7QPUNRH.mjs";
84
85
  import {
85
86
  getUnsealMaterial
86
- } from "./chunk-TQLCLE4L.mjs";
87
+ } from "./chunk-S677V2JU.mjs";
87
88
  import "./chunk-MTDFKNXX.mjs";
88
89
  import {
89
90
  getActiveName
90
- } from "./chunk-XKSWCEGI.mjs";
91
+ } from "./chunk-HJIXH6CL.mjs";
91
92
  import "./chunk-4UEJOM6W.mjs";
92
93
 
93
94
  // src/index.ts
@@ -122,6 +123,35 @@ async function runVaultPreflight(stderr = process.stderr) {
122
123
  `);
123
124
  }
124
125
  }
126
+ async function waitForStdioInputClose(stdin = process.stdin) {
127
+ stdin.resume();
128
+ await new Promise((resolve) => {
129
+ const done = () => {
130
+ stdin.off("end", done);
131
+ stdin.off("close", done);
132
+ resolve();
133
+ };
134
+ stdin.once("end", done);
135
+ stdin.once("close", done);
136
+ });
137
+ }
138
+ var SHUTDOWN_TIMEOUT_MS = 5e3;
139
+ async function shutdownClientWithTimeout(c, timeoutMs = SHUTDOWN_TIMEOUT_MS) {
140
+ if (!c) return;
141
+ let timer;
142
+ const timeout = new Promise((resolve) => {
143
+ timer = setTimeout(() => {
144
+ console.error(`[perplexity-mcp] WARN shutdown timeout after ${timeoutMs}ms \u2014 exiting.`);
145
+ resolve();
146
+ }, timeoutMs);
147
+ timer.unref?.();
148
+ });
149
+ try {
150
+ await Promise.race([c.shutdown().catch(() => void 0), timeout]);
151
+ } finally {
152
+ if (timer) clearTimeout(timer);
153
+ }
154
+ }
125
155
  async function main() {
126
156
  client = new PerplexityClient();
127
157
  const server = new McpServer({
@@ -136,7 +166,8 @@ async function main() {
136
166
  const profile = process.env.PERPLEXITY_PROFILE || getActiveName() || "default";
137
167
  console.error(`[perplexity-mcp] Starting with profile: ${profile}`);
138
168
  await runVaultPreflight();
139
- const watcher = watchReinit(profile, async () => {
169
+ let currentWatchedProfile = profile;
170
+ let watcher = watchReinit(currentWatchedProfile, async () => {
140
171
  console.error("[perplexity-mcp] .reinit sentinel fired \u2014 reloading client.");
141
172
  try {
142
173
  clientInitPromise = client.reinit();
@@ -145,23 +176,62 @@ async function main() {
145
176
  console.error("[perplexity-mcp] reinit failed:", err);
146
177
  }
147
178
  });
179
+ const activeWatcher = watchActiveProfile(void 0, async () => {
180
+ try {
181
+ const nextProfile = process.env.PERPLEXITY_PROFILE || getActiveName() || "default";
182
+ if (nextProfile !== currentWatchedProfile) {
183
+ console.error(`[perplexity-mcp] active profile changed: ${currentWatchedProfile} \u2192 ${nextProfile}; reloading client.`);
184
+ currentWatchedProfile = nextProfile;
185
+ watcher.dispose();
186
+ watcher = watchReinit(nextProfile, async () => {
187
+ console.error("[perplexity-mcp] .reinit sentinel fired \u2014 reloading client.");
188
+ try {
189
+ clientInitPromise = client.reinit();
190
+ await clientInitPromise;
191
+ } catch (err) {
192
+ console.error("[perplexity-mcp] reinit failed:", err);
193
+ }
194
+ });
195
+ }
196
+ clientInitPromise = client.reinit();
197
+ await clientInitPromise;
198
+ } catch (err) {
199
+ console.error("[perplexity-mcp] active-profile reload failed:", err);
200
+ }
201
+ });
202
+ const disposeWatchers = () => {
203
+ try {
204
+ watcher.dispose();
205
+ } catch {
206
+ }
207
+ try {
208
+ activeWatcher.dispose();
209
+ } catch {
210
+ }
211
+ };
148
212
  process.on("SIGINT", async () => {
149
- watcher.dispose();
150
- await client.shutdown();
213
+ disposeWatchers();
214
+ await shutdownClientWithTimeout(client);
151
215
  process.exit(0);
152
216
  });
153
217
  process.on("SIGTERM", async () => {
154
- watcher.dispose();
155
- await client.shutdown();
218
+ disposeWatchers();
219
+ await shutdownClientWithTimeout(client);
156
220
  process.exit(0);
157
221
  });
158
222
  const transport = new StdioServerTransport();
159
223
  await server.connect(transport);
224
+ try {
225
+ await waitForStdioInputClose();
226
+ } finally {
227
+ disposeWatchers();
228
+ await shutdownClientWithTimeout(client);
229
+ }
160
230
  }
161
231
  if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
162
232
  runEntrypoint().catch(async (error) => {
163
233
  console.error("[perplexity-mcp] Fatal error:", error);
164
- await client?.shutdown?.().catch(() => void 0);
234
+ await shutdownClientWithTimeout(client);
165
235
  process.exit(1);
166
236
  });
167
237
  }
@@ -227,10 +297,12 @@ export {
227
297
  runAll as runDoctor,
228
298
  runVaultPreflight,
229
299
  saveToolConfig,
300
+ shutdownClientWithTimeout,
230
301
  startDaemon,
231
302
  syncCloudHistory,
232
303
  tag,
233
304
  update,
234
305
  upsertFromCloud,
306
+ waitForStdioInputClose,
235
307
  watchToolConfig
236
308
  };
@@ -1,6 +1,6 @@
1
1
  import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
2
2
  import { chromium } from 'patchright';
3
- import { Vault } from './vault.d-BtRSLZiM.js';
3
+ import { Vault } from './vault.d-BSJWDLhp.js';
4
4
  import { resolveBrowserExecutable } from './config.js';
5
5
  import { recordLoginSuccess, getActiveName, getProfilePaths } from './profiles.d-DqS1oZWr.js';
6
6
  import { redact } from './redact.js';
@@ -8,16 +8,16 @@ import {
8
8
  } from "./chunk-HMKLWVXB.mjs";
9
9
  import {
10
10
  resolveBrowserExecutable
11
- } from "./chunk-LKJMLGFP.mjs";
11
+ } from "./chunk-U7QPUNRH.mjs";
12
12
  import {
13
13
  Vault
14
- } from "./chunk-TQLCLE4L.mjs";
14
+ } from "./chunk-S677V2JU.mjs";
15
15
  import "./chunk-MTDFKNXX.mjs";
16
16
  import {
17
17
  getActiveName,
18
18
  getProfilePaths,
19
19
  recordLoginSuccess
20
- } from "./chunk-XKSWCEGI.mjs";
20
+ } from "./chunk-HJIXH6CL.mjs";
21
21
  import "./chunk-4UEJOM6W.mjs";
22
22
 
23
23
  // src/login-runner.js
package/dist/logout.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { existsSync, rmSync, writeFileSync } from 'node:fs';
2
- import { Vault } from './vault.d-BtRSLZiM.js';
2
+ import { Vault } from './vault.d-BSJWDLhp.js';
3
3
  import { getActiveName, setActive, getProfilePaths, listProfiles, getProfile } from './profiles.d-DqS1oZWr.js';
4
4
 
5
5
  async function softLogout(name) {
package/dist/logout.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Vault
3
- } from "./chunk-TQLCLE4L.mjs";
3
+ } from "./chunk-S677V2JU.mjs";
4
4
  import "./chunk-MTDFKNXX.mjs";
5
5
  import {
6
6
  createProfile,
@@ -9,7 +9,7 @@ import {
9
9
  getProfilePaths,
10
10
  listProfiles,
11
11
  setActive
12
- } from "./chunk-XKSWCEGI.mjs";
12
+ } from "./chunk-HJIXH6CL.mjs";
13
13
  import "./chunk-4UEJOM6W.mjs";
14
14
 
15
15
  // src/logout.js
@@ -1,6 +1,6 @@
1
1
  import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
2
2
  import { chromium } from 'patchright';
3
- import { Vault } from './vault.d-BtRSLZiM.js';
3
+ import { Vault } from './vault.d-BSJWDLhp.js';
4
4
  import { resolveBrowserExecutable } from './config.js';
5
5
  import { recordLoginSuccess, getActiveName, getProfilePaths } from './profiles.d-DqS1oZWr.js';
6
6
  import { redact } from './redact.js';
@@ -6,16 +6,16 @@ import {
6
6
  } from "./chunk-HMKLWVXB.mjs";
7
7
  import {
8
8
  resolveBrowserExecutable
9
- } from "./chunk-LKJMLGFP.mjs";
9
+ } from "./chunk-U7QPUNRH.mjs";
10
10
  import {
11
11
  Vault
12
- } from "./chunk-TQLCLE4L.mjs";
12
+ } from "./chunk-S677V2JU.mjs";
13
13
  import "./chunk-MTDFKNXX.mjs";
14
14
  import {
15
15
  getActiveName,
16
16
  getProfilePaths,
17
17
  recordLoginSuccess
18
- } from "./chunk-XKSWCEGI.mjs";
18
+ } from "./chunk-HJIXH6CL.mjs";
19
19
  import "./chunk-4UEJOM6W.mjs";
20
20
 
21
21
  // src/manual-login-runner.js
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getImpitRuntimeDir
3
- } from "./chunk-Z7DAACGZ.mjs";
4
- import "./chunk-LKJMLGFP.mjs";
5
- import "./chunk-TQLCLE4L.mjs";
3
+ } from "./chunk-DQQISMYN.mjs";
4
+ import "./chunk-U7QPUNRH.mjs";
5
+ import "./chunk-S677V2JU.mjs";
6
6
  import "./chunk-MTDFKNXX.mjs";
7
- import "./chunk-XKSWCEGI.mjs";
7
+ import "./chunk-HJIXH6CL.mjs";
8
8
  import "./chunk-4UEJOM6W.mjs";
9
9
 
10
10
  // src/native-deps.js
package/dist/profiles.mjs CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  setActive,
14
14
  suggestNextDefaultName,
15
15
  validateName
16
- } from "./chunk-XKSWCEGI.mjs";
16
+ } from "./chunk-HJIXH6CL.mjs";
17
17
  import "./chunk-4UEJOM6W.mjs";
18
18
  export {
19
19
  createProfile,
package/dist/refresh.mjs CHANGED
@@ -5,11 +5,11 @@ import {
5
5
  isImpitAvailable,
6
6
  loadImpit,
7
7
  refreshAccountInfo
8
- } from "./chunk-Z7DAACGZ.mjs";
9
- import "./chunk-LKJMLGFP.mjs";
10
- import "./chunk-TQLCLE4L.mjs";
8
+ } from "./chunk-DQQISMYN.mjs";
9
+ import "./chunk-U7QPUNRH.mjs";
10
+ import "./chunk-S677V2JU.mjs";
11
11
  import "./chunk-MTDFKNXX.mjs";
12
- import "./chunk-XKSWCEGI.mjs";
12
+ import "./chunk-HJIXH6CL.mjs";
13
13
  import "./chunk-4UEJOM6W.mjs";
14
14
  export {
15
15
  getImpitRuntimeDir,
@@ -12,4 +12,15 @@ declare function watchReinit(
12
12
  opts?: WatchReinitOptions
13
13
  ): ReinitWatcher;
14
14
 
15
- export { type ReinitWatcher, type WatchReinitOptions, watchReinit };
15
+ /**
16
+ * Watch the `<configDir>/active` pointer file for profile switches and call
17
+ * `callback` whenever it changes. Pass `configDir = undefined` to use the
18
+ * resolved default config dir (PERPLEXITY_CONFIG_DIR or ~/.perplexity-mcp).
19
+ */
20
+ declare function watchActiveProfile(
21
+ configDir: string | undefined,
22
+ callback: () => void | Promise<void>,
23
+ opts?: WatchReinitOptions
24
+ ): ReinitWatcher;
25
+
26
+ export { type ReinitWatcher, type WatchReinitOptions, watchActiveProfile, watchReinit };
@@ -1,8 +1,10 @@
1
1
  import {
2
+ watchActiveProfile,
2
3
  watchReinit
3
- } from "./chunk-U3DGFLXZ.mjs";
4
- import "./chunk-XKSWCEGI.mjs";
4
+ } from "./chunk-WDIW33DA.mjs";
5
+ import "./chunk-HJIXH6CL.mjs";
5
6
  import "./chunk-4UEJOM6W.mjs";
6
7
  export {
8
+ watchActiveProfile,
7
9
  watchReinit
8
10
  };
@@ -0,0 +1,37 @@
1
+ declare function encryptBlob(plaintext: Buffer, key: Buffer): Buffer;
2
+ declare function decryptBlob(blob: Buffer, key: Buffer): Buffer;
3
+ declare function __resetKeyCache(): void;
4
+ declare function getMasterKey(): Promise<Buffer>;
5
+
6
+ /**
7
+ * TEST SEAM — drop scrypt cost during tests by overriding the (logN, r, p)
8
+ * parameters used at write time. Reads always use the params embedded in the
9
+ * blob, regardless of any override.
10
+ *
11
+ * Cleared by `__resetKeyCache()` so tests do not leak state across files.
12
+ * MUST NOT be called from production code paths. The decrypt-time floor
13
+ * check (logN >= SCRYPT_LOGN_FLOOR) remains enforced unconditionally.
14
+ */
15
+ declare function __setKdfParamsForTest(params: { logN: number; r: number; p: number }): void;
16
+
17
+ /**
18
+ * Sibling of `getMasterKey()` introduced with the v2 vault format. Returns
19
+ * the unseal context WITHOUT prematurely deriving the HKDF key — for v2
20
+ * blobs, key derivation needs the salt embedded in each blob, so it can no
21
+ * longer happen up front. Cached just like `_keyCache`; cleared by
22
+ * `__resetKeyCache()`.
23
+ */
24
+ type UnsealMaterial =
25
+ | { kind: "key"; key: Buffer }
26
+ | { kind: "passphrase"; passphrase: string };
27
+
28
+ declare function getUnsealMaterial(): Promise<UnsealMaterial>;
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>;
35
+ }
36
+
37
+ export { type UnsealMaterial, Vault, __resetKeyCache, __setKdfParamsForTest, decryptBlob, encryptBlob, getMasterKey, getUnsealMaterial };
package/dist/vault.mjs CHANGED
@@ -4,11 +4,12 @@ import {
4
4
  __setKdfParamsForTest,
5
5
  decryptBlob,
6
6
  encryptBlob,
7
+ getAllUnsealMaterials,
7
8
  getMasterKey,
8
9
  getUnsealMaterial
9
- } from "./chunk-TQLCLE4L.mjs";
10
+ } from "./chunk-S677V2JU.mjs";
10
11
  import "./chunk-MTDFKNXX.mjs";
11
- import "./chunk-XKSWCEGI.mjs";
12
+ import "./chunk-HJIXH6CL.mjs";
12
13
  import "./chunk-4UEJOM6W.mjs";
13
14
  export {
14
15
  Vault,
@@ -16,6 +17,7 @@ export {
16
17
  __setKdfParamsForTest,
17
18
  decryptBlob,
18
19
  encryptBlob,
20
+ getAllUnsealMaterials,
19
21
  getMasterKey,
20
22
  getUnsealMaterial
21
23
  };
package/dist/viewers.mjs CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  getActiveName,
3
3
  getConfigDir,
4
4
  getProfilePaths
5
- } from "./chunk-XKSWCEGI.mjs";
5
+ } from "./chunk-HJIXH6CL.mjs";
6
6
  import "./chunk-4UEJOM6W.mjs";
7
7
 
8
8
  // src/viewers.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "perplexity-user-mcp",
3
- "version": "0.8.37",
3
+ "version": "0.8.39",
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.",
@@ -1,43 +0,0 @@
1
- import {
2
- getProfilePaths
3
- } from "./chunk-XKSWCEGI.mjs";
4
-
5
- // src/reinit-watcher.js
6
- import { existsSync, mkdirSync, watch } from "fs";
7
- import { dirname } from "path";
8
- function watchReinit(profileName, callback, opts = {}) {
9
- const { debounceMs = 200 } = opts;
10
- const target = getProfilePaths(profileName).reinit;
11
- const parent = dirname(target);
12
- if (!existsSync(parent)) mkdirSync(parent, { recursive: true });
13
- let timer = null;
14
- const w = watch(parent, { persistent: false }, (event, filename) => {
15
- if (!filename) return;
16
- if (!String(filename).endsWith(".reinit")) return;
17
- if (!existsSync(target)) return;
18
- if (timer) clearTimeout(timer);
19
- timer = setTimeout(() => {
20
- timer = null;
21
- try {
22
- callback();
23
- } catch {
24
- }
25
- }, debounceMs);
26
- });
27
- return {
28
- dispose() {
29
- if (timer) {
30
- clearTimeout(timer);
31
- timer = null;
32
- }
33
- try {
34
- w.close();
35
- } catch {
36
- }
37
- }
38
- };
39
- }
40
-
41
- export {
42
- watchReinit
43
- };
@@ -1,8 +0,0 @@
1
- declare class Vault {
2
- get(profile: string, key: string): Promise<string | null>;
3
- set(profile: string, key: string, value: string): Promise<void>;
4
- delete(profile: string, key: string): Promise<void>;
5
- deleteAll(profile: string): Promise<void>;
6
- }
7
-
8
- export { Vault };
File without changes