perplexity-user-mcp 0.8.39 → 0.8.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/attachments.d.ts +10 -20
- package/dist/browser-window.d.ts +1 -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 +20 -92
- 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-T6ARJK2P.mjs → chunk-2B5OQUXR.mjs} +6 -6
- package/dist/{chunk-2FPGJKCA.mjs → chunk-2EE7MNP2.mjs} +2 -2
- package/dist/{chunk-NJX4RBO6.mjs → chunk-2OVLCZHU.mjs} +28 -3
- package/dist/{chunk-WDIW33DA.mjs → chunk-3LUO5ATM.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-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-RK4EBZJ3.mjs → chunk-E75J42W5.mjs} +11 -8
- package/dist/{chunk-452DK6OS.mjs → chunk-FNHYUE22.mjs} +2 -2
- package/dist/{chunk-D254EFYB.mjs → chunk-GBI2U336.mjs} +1 -1
- package/dist/chunk-GPUGKWXH.mjs +17 -0
- package/dist/{chunk-HNSPNCFH.mjs → chunk-KSNV3ZVY.mjs} +1 -1
- package/dist/{chunk-XTRJSV72.mjs → chunk-LGH5BSUY.mjs} +1 -1
- package/dist/{chunk-KJFX2ZXR.mjs → chunk-NMKNEEZB.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-C3HPFFTD.mjs → chunk-WHVJ724K.mjs} +84 -44
- package/dist/cli.d.ts +14 -1298
- package/dist/cli.mjs +35 -27
- package/dist/client.d.ts +27 -24
- package/dist/client.mjs +6 -6
- package/dist/cloud-sync.d.ts +65 -42
- package/dist/cloud-sync.mjs +8 -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 +10 -11
- package/dist/daemon/attach.mjs +19 -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 +17 -17
- package/dist/daemon/index.d.ts +17 -14
- package/dist/daemon/index.mjs +18 -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 +16 -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 +11 -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 +8 -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 +22 -20
- package/dist/is-main-module.d.ts +9 -0
- package/dist/login-runner.d.ts +1 -333
- package/dist/login-runner.mjs +13 -13
- 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 +3 -3
- 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/export.d.ts
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export function resolveExportApiFormat(format: any): any;
|
|
2
|
+
export function exportThread(options: any): Promise<{
|
|
3
|
+
buffer: Buffer<ArrayBuffer>;
|
|
4
|
+
filename: string;
|
|
5
|
+
contentType: any;
|
|
6
|
+
}>;
|
|
7
|
+
export namespace FORMAT_TO_CONTENT_TYPE {
|
|
8
|
+
let pdf: string;
|
|
9
|
+
let markdown: string;
|
|
10
|
+
let docx: string;
|
|
7
11
|
}
|
|
8
|
-
|
|
9
|
-
declare const FORMAT_TO_CONTENT_TYPE: Record<ExportFormat, string>;
|
|
10
|
-
declare function resolveExportApiFormat(format: ExportFormat): "pdf" | "md" | "docx";
|
|
11
|
-
declare function exportThread(options: {
|
|
12
|
-
entryUuid: string;
|
|
13
|
-
format: ExportFormat;
|
|
14
|
-
fetchImpl?: (input: string, init?: RequestInit) => Promise<Response>;
|
|
15
|
-
baseUrl?: string;
|
|
16
|
-
headers?: HeadersInit;
|
|
17
|
-
}): Promise<ExportResult>;
|
|
18
|
-
|
|
19
|
-
export { type ExportFormat, type ExportResult, FORMAT_TO_CONTENT_TYPE, exportThread, resolveExportApiFormat };
|
|
12
|
+
import { Buffer } from "node:buffer";
|
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-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-GBI2U336.mjs";
|
|
6
|
+
import "./chunk-DXR6EEZH.mjs";
|
|
7
|
+
import "./chunk-C5I7KXHK.mjs";
|
|
8
8
|
import "./chunk-MTDFKNXX.mjs";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-E3GRJXXJ.mjs";
|
|
10
10
|
import "./chunk-4UEJOM6W.mjs";
|
|
11
11
|
export {
|
|
12
12
|
FORMAT_TO_CONTENT_TYPE,
|
package/dist/format.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { SearchResult } from "./config.js";
|
|
2
|
+
export interface HistoryEntry {
|
|
3
|
+
tool: string;
|
|
4
|
+
query: string;
|
|
5
|
+
model: string | null;
|
|
6
|
+
mode: string | null;
|
|
7
|
+
language: string | null;
|
|
8
|
+
answerPreview: string;
|
|
9
|
+
sourceCount: number;
|
|
10
|
+
threadUrl?: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function formatResponse(result: SearchResult): string;
|
|
14
|
+
export declare function buildAnswerPreview(result: SearchResult | null, error?: string): string;
|
|
15
|
+
export declare function buildHistoryEntry(options: {
|
|
16
|
+
tool: string;
|
|
17
|
+
query: string;
|
|
18
|
+
model: string | null;
|
|
19
|
+
mode: string | null;
|
|
20
|
+
language: string | null;
|
|
21
|
+
result?: SearchResult;
|
|
22
|
+
error?: string;
|
|
23
|
+
}): HistoryEntry;
|
|
24
|
+
export declare function buildHistoryBody(result: SearchResult | undefined, error?: string): string;
|
|
25
|
+
export declare function buildStoredHistoryEntry(options: {
|
|
26
|
+
tool: string;
|
|
27
|
+
query: string;
|
|
28
|
+
model: string | null;
|
|
29
|
+
mode: string | null;
|
|
30
|
+
language: string | null;
|
|
31
|
+
tier?: "Max" | "Pro" | "Enterprise" | "Authenticated" | "Anonymous";
|
|
32
|
+
status?: "completed" | "pending" | "failed";
|
|
33
|
+
createdAt?: string;
|
|
34
|
+
completedAt?: string;
|
|
35
|
+
result?: SearchResult;
|
|
36
|
+
error?: string;
|
|
37
|
+
}): HistoryEntry & {
|
|
38
|
+
createdAt: string;
|
|
39
|
+
body: string;
|
|
40
|
+
status?: "completed" | "pending" | "failed";
|
|
41
|
+
completedAt?: string;
|
|
42
|
+
tier?: "Max" | "Pro" | "Enterprise" | "Authenticated" | "Anonymous";
|
|
43
|
+
threadSlug?: string | null;
|
|
44
|
+
backendUuid?: string | null;
|
|
45
|
+
readWriteToken?: string | null;
|
|
46
|
+
sources?: Array<{
|
|
47
|
+
n: number;
|
|
48
|
+
title: string;
|
|
49
|
+
url: string;
|
|
50
|
+
snippet?: string;
|
|
51
|
+
}>;
|
|
52
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove stale Chromium SingletonLock/Cookie/Socket files from a persistent
|
|
3
|
+
* user-data-dir. Chromium silently exits with code 0 when these files claim
|
|
4
|
+
* an active instance, so a stale lock from an unclean previous exit will
|
|
5
|
+
* break `launchPersistentContext`. The files are recreated on every launch
|
|
6
|
+
* and only carry exclusivity (not state), so deleting them pre-launch is safe.
|
|
7
|
+
*/
|
|
8
|
+
export function clearStaleSingletonLocks(dir: any): void;
|
package/dist/health-check.d.ts
CHANGED
|
@@ -1,108 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { chromium } from 'patchright';
|
|
3
|
-
import { Vault } from './vault.d-BSJWDLhp.js';
|
|
4
|
-
import { getProfilePaths, getActiveName } from './profiles.d-DqS1oZWr.js';
|
|
5
|
-
import { getOrCreateContext, findBrowser } from './config.js';
|
|
6
|
-
import { redact } from './redact.js';
|
|
7
|
-
import { c as collectSessionMetadata } from './session-metadata-B9aV_n5g.js';
|
|
8
|
-
|
|
9
|
-
// Spawnable health-check runner. Reads the active profile's vault cookies,
|
|
10
|
-
// launches a NON-persistent Chromium, injects cookies, probes auth + rest
|
|
11
|
-
// endpoints, writes models-cache.json on success, emits one JSON line,
|
|
12
|
-
// and exits. Never touches the long-lived MCP server's browser profile dir.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const ORIGIN = process.env.PERPLEXITY_ORIGIN || "https://www.perplexity.ai";
|
|
16
|
-
const LOGIN_PATH = process.env.PERPLEXITY_LOGIN_PATH || "/account";
|
|
17
|
-
|
|
18
|
-
function resolveProfile() {
|
|
19
|
-
return process.env.PERPLEXITY_PROFILE || getActiveName() || "default";
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Launch a browser suitable for the health check. Respects
|
|
24
|
-
* PERPLEXITY_BROWSER_CHANNEL / PERPLEXITY_BROWSER_PATH overrides from the
|
|
25
|
-
* extension's AuthManager.
|
|
26
|
-
*/
|
|
27
|
-
async function launchHealthBrowser() {
|
|
28
|
-
const probe = findBrowser();
|
|
29
|
-
return chromium.launch({
|
|
30
|
-
headless: true,
|
|
31
|
-
...(probe ? { executablePath: probe.path } : {}),
|
|
32
|
-
...(probe && ["chrome", "msedge", "chromium"].includes(probe.channel)
|
|
33
|
-
? { channel: probe.channel }
|
|
34
|
-
: {}),
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
async function main() {
|
|
39
|
-
const PROFILE = resolveProfile();
|
|
40
|
-
const vault = new Vault();
|
|
41
|
-
const cookiesRaw = await vault.get(PROFILE, "cookies").catch(() => null);
|
|
42
|
-
if (!cookiesRaw) {
|
|
43
|
-
emit({ valid: false, reason: "no_cookies" });
|
|
44
|
-
process.exit(2);
|
|
45
|
-
}
|
|
46
|
-
const cookies = JSON.parse(cookiesRaw);
|
|
47
|
-
if (!Array.isArray(cookies) || cookies.length === 0) {
|
|
48
|
-
emit({ valid: false, reason: "no_cookies" });
|
|
49
|
-
process.exit(2);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const browser = await launchHealthBrowser();
|
|
53
|
-
let result;
|
|
54
|
-
try {
|
|
55
|
-
const ctx = await getOrCreateContext(browser);
|
|
56
|
-
// Patchright's addCookies wants EITHER url OR (domain+path), not both.
|
|
57
|
-
// Pass cookies with domain/url already set through untouched; only
|
|
58
|
-
// synthesize a url from ORIGIN when neither is present. Additionally,
|
|
59
|
-
// Chromium rejects `__Secure-`-prefixed cookies with `secure:false` —
|
|
60
|
-
// force the flag so imports from other tools stay usable (Chromium
|
|
61
|
-
// treats localhost/127.0.0.1 as secure origins, so the cookie will
|
|
62
|
-
// still be delivered over plain HTTP in tests).
|
|
63
|
-
const normalized = cookies.map((c) => {
|
|
64
|
-
const withSecure = c.name?.startsWith("__Secure-") ? { ...c, secure: true } : c;
|
|
65
|
-
return (withSecure.url || withSecure.domain) ? withSecure : { ...withSecure, url: `${ORIGIN}${withSecure.path ?? "/"}` };
|
|
66
|
-
});
|
|
67
|
-
await ctx.addCookies(normalized);
|
|
68
|
-
const page = await ctx.newPage();
|
|
69
|
-
// Navigate to an origin URL so page-context fetches are same-origin
|
|
70
|
-
// (required for `credentials: "include"` to attach the cookies we just
|
|
71
|
-
// injected). The default path `/account` exists on production; mock
|
|
72
|
-
// integration tests override via PERPLEXITY_LOGIN_PATH to point at the
|
|
73
|
-
// mock's `/login` route.
|
|
74
|
-
await page.goto(`${ORIGIN}${LOGIN_PATH}`, { waitUntil: "domcontentloaded" }).catch(() => {});
|
|
75
|
-
|
|
76
|
-
const metadata = await collectSessionMetadata(page, ORIGIN, { sessionTimeoutMs: 4_000 });
|
|
77
|
-
|
|
78
|
-
if (!metadata.sessionData?.user?.id) {
|
|
79
|
-
result = { valid: false, reason: "expired" };
|
|
80
|
-
} else {
|
|
81
|
-
result = {
|
|
82
|
-
valid: true,
|
|
83
|
-
tier: metadata.tier,
|
|
84
|
-
modelCount: Object.keys(metadata.models?.models ?? {}).length,
|
|
85
|
-
rateLimits: metadata.rateLimits ?? null,
|
|
86
|
-
};
|
|
87
|
-
try {
|
|
88
|
-
const paths = getProfilePaths(PROFILE);
|
|
89
|
-
if (!existsSync(paths.dir)) mkdirSync(paths.dir, { recursive: true });
|
|
90
|
-
writeFileSync(paths.modelsCache, JSON.stringify(metadata.cache, null, 2));
|
|
91
|
-
} catch {}
|
|
92
|
-
}
|
|
93
|
-
} finally {
|
|
94
|
-
await browser.close().catch(() => {});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
emit(result);
|
|
98
|
-
process.exit(result.valid ? 0 : 2);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function emit(obj) {
|
|
102
|
-
process.stdout.write(JSON.stringify(obj) + "\n");
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
main().catch((err) => {
|
|
106
|
-
emit({ valid: false, reason: "crash", error: redact(String(err?.message ?? err)) });
|
|
107
|
-
process.exit(5);
|
|
108
|
-
});
|
|
1
|
+
export {};
|
package/dist/health-check.mjs
CHANGED
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
findBrowser,
|
|
9
9
|
getOrCreateContext
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DXR6EEZH.mjs";
|
|
11
11
|
import {
|
|
12
12
|
Vault
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-C5I7KXHK.mjs";
|
|
14
14
|
import "./chunk-MTDFKNXX.mjs";
|
|
15
15
|
import {
|
|
16
16
|
getActiveName,
|
|
17
17
|
getProfilePaths
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-E3GRJXXJ.mjs";
|
|
19
19
|
import "./chunk-4UEJOM6W.mjs";
|
|
20
20
|
|
|
21
21
|
// src/health-check.js
|
package/dist/history-store.d.ts
CHANGED
|
@@ -1,65 +1,29 @@
|
|
|
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
|
-
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 };
|
|
1
|
+
export function getHistoryDir(): string;
|
|
2
|
+
export function getAttachmentsRoot(): string;
|
|
3
|
+
export function getIndexPath(): string;
|
|
4
|
+
export function append(entry: any): any;
|
|
5
|
+
export function update(id: any, patch?: {}): any;
|
|
6
|
+
export function list(options?: {}): any[];
|
|
7
|
+
export function get(id: any): any;
|
|
8
|
+
export function deleteEntry(id: any): boolean;
|
|
9
|
+
export function pin(id: any, pinned: any): any;
|
|
10
|
+
export function tag(id: any, tags: any): any;
|
|
11
|
+
export function rebuildIndex(): {
|
|
12
|
+
scanned: number;
|
|
13
|
+
recovered: number;
|
|
14
|
+
skipped: number;
|
|
15
|
+
items: any[];
|
|
16
|
+
};
|
|
17
|
+
export function getMdPath(id: any): any;
|
|
18
|
+
export function getAttachmentsDir(id: any): string | null;
|
|
19
|
+
export function findPendingByThread(threadSlug: any): any;
|
|
20
|
+
export function countAll(): any;
|
|
21
|
+
export function appendHistory(entry: any): any;
|
|
22
|
+
export function readHistory(limit?: number): any[];
|
|
23
|
+
export function findByBackendUuid(backendUuid: any): any;
|
|
24
|
+
export function upsertFromCloud(meta: any): {
|
|
25
|
+
action: string;
|
|
26
|
+
id: any;
|
|
27
|
+
};
|
|
28
|
+
export function hydrateCloudEntry(id: any, payload: any): any;
|
|
29
|
+
export const HISTORY_LIMIT: 50;
|
package/dist/history-store.mjs
CHANGED