mcp-scraper 0.27.0 → 0.28.0
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 +1 -1
- package/dist/bin/api-server.cjs +217 -14
- package/dist/bin/api-server.cjs.map +1 -1
- package/dist/bin/api-server.js +1 -1
- package/dist/bin/mcp-scraper-cli.cjs +1 -1
- package/dist/bin/mcp-scraper-cli.cjs.map +1 -1
- package/dist/bin/mcp-scraper-cli.js +1 -1
- package/dist/bin/mcp-scraper-install.cjs +2 -2
- package/dist/bin/mcp-scraper-install.cjs.map +1 -1
- package/dist/bin/mcp-scraper-install.js +2 -2
- package/dist/bin/mcp-stdio-server.cjs +41 -2
- package/dist/bin/mcp-stdio-server.cjs.map +1 -1
- package/dist/bin/mcp-stdio-server.js +3 -3
- package/dist/{chunk-TBRX7VOP.js → chunk-DUS4ENOY.js} +2 -2
- package/dist/{chunk-TBRX7VOP.js.map → chunk-DUS4ENOY.js.map} +1 -1
- package/dist/{chunk-RPR5LDLS.js → chunk-LTT7QX3C.js} +41 -2
- package/dist/{chunk-RPR5LDLS.js.map → chunk-LTT7QX3C.js.map} +1 -1
- package/dist/chunk-QG77M3YJ.js +7 -0
- package/dist/chunk-QG77M3YJ.js.map +1 -0
- package/dist/{server-YXVSZ3T7.js → server-QQB4BNAB.js} +165 -9
- package/dist/server-QQB4BNAB.js.map +1 -0
- package/docs/mcp-tool-manifest.generated.json +93 -3
- package/package.json +2 -2
- package/dist/chunk-O6KFDDRM.js +0 -7
- package/dist/chunk-O6KFDDRM.js.map +0 -1
- package/dist/server-YXVSZ3T7.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["export const PACKAGE_VERSION = '0.28.0'\n"],"mappings":";AAAO,IAAM,kBAAkB;","names":[]}
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
sanitizeAttempts,
|
|
37
37
|
sanitizeHarvestResult,
|
|
38
38
|
transcribeMediaUrl
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-LTT7QX3C.js";
|
|
40
40
|
import {
|
|
41
41
|
auditImages,
|
|
42
42
|
buildLinkReport,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
RawMapsOverviewSchema,
|
|
78
78
|
RawMapsReviewStatsSchema
|
|
79
79
|
} from "./chunk-ZQSHKWV4.js";
|
|
80
|
-
import "./chunk-
|
|
80
|
+
import "./chunk-QG77M3YJ.js";
|
|
81
81
|
import {
|
|
82
82
|
completeExtractJob,
|
|
83
83
|
countSuccessfulPages,
|
|
@@ -5063,7 +5063,7 @@ async function extractSite(opts) {
|
|
|
5063
5063
|
}
|
|
5064
5064
|
|
|
5065
5065
|
// src/api/server.ts
|
|
5066
|
-
import { Hono as
|
|
5066
|
+
import { Hono as Hono25 } from "hono";
|
|
5067
5067
|
import { serve as serveInngest } from "inngest/hono";
|
|
5068
5068
|
|
|
5069
5069
|
// src/inngest/client.ts
|
|
@@ -16989,6 +16989,8 @@ import { setScopeTool } from "mcpscraper-memory-tools/tools/access/set-scope";
|
|
|
16989
16989
|
import { inviteAccountTool } from "mcpscraper-memory-tools/tools/access/invite-account";
|
|
16990
16990
|
import { getChatLinkTool } from "mcpscraper-memory-tools/tools/access/get-chat-link";
|
|
16991
16991
|
import { revokeChatLinkTool } from "mcpscraper-memory-tools/tools/access/revoke-chat-link";
|
|
16992
|
+
import { getVaultAppLinkTool } from "mcpscraper-memory-tools/tools/access/get-vault-app-link";
|
|
16993
|
+
import { revokeVaultAppLinkTool } from "mcpscraper-memory-tools/tools/access/revoke-vault-app-link";
|
|
16992
16994
|
import { provisionDefaultsTool as provisionDefaultsTool2 } from "mcpscraper-memory-tools/tools/vaults/provision-defaults";
|
|
16993
16995
|
import { createSecureVaultTool } from "mcpscraper-memory-tools/tools/vaults/create-secure-vault";
|
|
16994
16996
|
import { createScheduledActionTool } from "mcpscraper-memory-tools/tools/schedule/create-scheduled-action";
|
|
@@ -17030,6 +17032,14 @@ function registerBillingCutovers() {
|
|
|
17030
17032
|
const result = await revokeChatLinkTool.execute({ ...input, apiKey }, {});
|
|
17031
17033
|
return { content: [{ type: "text", text: JSON.stringify(result ?? {}) }], structuredContent: result ?? {}, isError: false };
|
|
17032
17034
|
});
|
|
17035
|
+
registerCutover("getVaultAppLinkTool", async (input, apiKey) => {
|
|
17036
|
+
const result = await getVaultAppLinkTool.execute({ ...input, apiKey }, {});
|
|
17037
|
+
return { content: [{ type: "text", text: JSON.stringify(result ?? {}) }], structuredContent: result ?? {}, isError: false };
|
|
17038
|
+
});
|
|
17039
|
+
registerCutover("revokeVaultAppLinkTool", async (input, apiKey) => {
|
|
17040
|
+
const result = await revokeVaultAppLinkTool.execute({ ...input, apiKey }, {});
|
|
17041
|
+
return { content: [{ type: "text", text: JSON.stringify(result ?? {}) }], structuredContent: result ?? {}, isError: false };
|
|
17042
|
+
});
|
|
17033
17043
|
registerCutover("provisionDefaultsTool", async (input, apiKey) => {
|
|
17034
17044
|
const result = await provisionDefaultsTool2.execute({ ...input, apiKey }, {});
|
|
17035
17045
|
return { content: [{ type: "text", text: JSON.stringify(result ?? {}) }], structuredContent: result ?? {}, isError: false };
|
|
@@ -20686,9 +20696,154 @@ loadChannels();
|
|
|
20686
20696
|
</html>`;
|
|
20687
20697
|
}
|
|
20688
20698
|
|
|
20689
|
-
// src/api/
|
|
20699
|
+
// src/api/vault-routes.ts
|
|
20690
20700
|
import { Hono as Hono22 } from "hono";
|
|
20691
|
-
var
|
|
20701
|
+
var VAULTS = ["People", "Projects", "Tasks", "Communications"];
|
|
20702
|
+
var vaultApp = new Hono22();
|
|
20703
|
+
function validToken(token) {
|
|
20704
|
+
return !!token && token.startsWith("mk_") && token.length > 20 && token.length < 256;
|
|
20705
|
+
}
|
|
20706
|
+
function isVault(value) {
|
|
20707
|
+
return typeof value === "string" && VAULTS.includes(value);
|
|
20708
|
+
}
|
|
20709
|
+
function stringValue(value, max = 1e4) {
|
|
20710
|
+
if (typeof value !== "string") return null;
|
|
20711
|
+
const trimmed = value.trim();
|
|
20712
|
+
return trimmed && trimmed.length <= max ? trimmed : null;
|
|
20713
|
+
}
|
|
20714
|
+
function propsValue(value) {
|
|
20715
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
20716
|
+
const entries = Object.entries(value);
|
|
20717
|
+
if (entries.length > 80) return null;
|
|
20718
|
+
return Object.fromEntries(entries.filter(([key]) => key.length <= 96));
|
|
20719
|
+
}
|
|
20720
|
+
function cors(c) {
|
|
20721
|
+
const origin = c.req.header("origin");
|
|
20722
|
+
const configured = (process.env.VAULT_APP_ALLOWED_ORIGINS ?? "https://vault.mcpscraper.dev").split(",").map((value) => value.trim()).filter(Boolean);
|
|
20723
|
+
const local = !!origin && /^http:\/\/localhost(?::\d+)?$/.test(origin);
|
|
20724
|
+
if (origin && (configured.includes(origin) || local)) c.header("Access-Control-Allow-Origin", origin);
|
|
20725
|
+
c.header("Vary", "Origin");
|
|
20726
|
+
c.header("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
|
|
20727
|
+
c.header("Access-Control-Allow-Headers", "content-type");
|
|
20728
|
+
}
|
|
20729
|
+
vaultApp.use("/api/*", async (c, next) => {
|
|
20730
|
+
cors(c);
|
|
20731
|
+
if (c.req.method === "OPTIONS") return c.body(null, 204);
|
|
20732
|
+
await next();
|
|
20733
|
+
});
|
|
20734
|
+
function workspaceRecord(vault, note) {
|
|
20735
|
+
const props = note.props ?? {};
|
|
20736
|
+
return {
|
|
20737
|
+
id: `${vault}:${note.path}`,
|
|
20738
|
+
vault,
|
|
20739
|
+
path: note.path,
|
|
20740
|
+
title: note.title,
|
|
20741
|
+
content: note.content,
|
|
20742
|
+
type: typeof props.type === "string" ? props.type : defaultType(vault),
|
|
20743
|
+
status: typeof props.status === "string" ? props.status : defaultStatus(vault),
|
|
20744
|
+
props,
|
|
20745
|
+
revision: note.revision,
|
|
20746
|
+
updatedAt: note.updatedAt,
|
|
20747
|
+
capturedAt: note.capturedAt
|
|
20748
|
+
};
|
|
20749
|
+
}
|
|
20750
|
+
function defaultType(vault) {
|
|
20751
|
+
if (vault === "People") return "person";
|
|
20752
|
+
if (vault === "Projects") return "project";
|
|
20753
|
+
if (vault === "Tasks") return "task";
|
|
20754
|
+
return "activity";
|
|
20755
|
+
}
|
|
20756
|
+
function defaultStatus(vault) {
|
|
20757
|
+
if (vault === "People") return "active";
|
|
20758
|
+
if (vault === "Projects") return "active";
|
|
20759
|
+
if (vault === "Tasks") return "to_do";
|
|
20760
|
+
return "triaged";
|
|
20761
|
+
}
|
|
20762
|
+
async function readVault(vault, token) {
|
|
20763
|
+
const list = await memoryCall("listTool", { vault }, token);
|
|
20764
|
+
if (!list.ok) throw new Error(list.error ?? `unable to read ${vault}`);
|
|
20765
|
+
const noteRefs = (list.notes ?? []).slice(0, 200);
|
|
20766
|
+
const notes = await Promise.all(
|
|
20767
|
+
noteRefs.map(async ({ path: path5 }) => memoryCall("getTool", { vault, path: path5 }, token))
|
|
20768
|
+
);
|
|
20769
|
+
return notes.filter((result) => result.ok && !!result.note).map((result) => workspaceRecord(vault, result.note));
|
|
20770
|
+
}
|
|
20771
|
+
vaultApp.get("/api/workspace", async (c) => {
|
|
20772
|
+
const token = c.req.query("token");
|
|
20773
|
+
if (!validToken(token)) return c.json({ ok: false, error: "missing or malformed Vault App link" }, 401);
|
|
20774
|
+
try {
|
|
20775
|
+
const requested = c.req.query("vault");
|
|
20776
|
+
const vaults = isVault(requested) ? [requested] : VAULTS;
|
|
20777
|
+
const results = await Promise.all(vaults.map((vault) => readVault(vault, token)));
|
|
20778
|
+
const records = results.flat().sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
|
|
20779
|
+
return c.json({ ok: true, records, limited: results.some((result) => result.length >= 200) });
|
|
20780
|
+
} catch (error) {
|
|
20781
|
+
return c.json({ ok: false, error: error instanceof Error ? error.message : "unable to load vault workspace" }, 502);
|
|
20782
|
+
}
|
|
20783
|
+
});
|
|
20784
|
+
vaultApp.post("/api/records", async (c) => {
|
|
20785
|
+
const body = await c.req.json().catch(() => ({}));
|
|
20786
|
+
const token = typeof body.token === "string" ? body.token : void 0;
|
|
20787
|
+
if (!validToken(token)) return c.json({ ok: false, error: "missing or malformed Vault App link" }, 401);
|
|
20788
|
+
const vault = body.vault;
|
|
20789
|
+
const path5 = stringValue(body.path, 320);
|
|
20790
|
+
const title = stringValue(body.title, 320);
|
|
20791
|
+
const content = typeof body.content === "string" && body.content.length <= 1e5 ? body.content : "";
|
|
20792
|
+
const props = propsValue(body.props) ?? {};
|
|
20793
|
+
if (!isVault(vault) || !path5 || !title) return c.json({ ok: false, error: "vault, path, and title are required" }, 400);
|
|
20794
|
+
const baseRevision = typeof body.baseRevision === "number" && Number.isInteger(body.baseRevision) ? body.baseRevision : void 0;
|
|
20795
|
+
const result = await memoryCall("putTool", { vault, path: path5, title, content: content || title, props, ...baseRevision === void 0 ? {} : { baseRevision } }, token);
|
|
20796
|
+
return c.json(result, result.ok ? 200 : result.conflict ? 409 : 502);
|
|
20797
|
+
});
|
|
20798
|
+
vaultApp.post("/api/records/transition", async (c) => {
|
|
20799
|
+
const body = await c.req.json().catch(() => ({}));
|
|
20800
|
+
const token = typeof body.token === "string" ? body.token : void 0;
|
|
20801
|
+
if (!validToken(token)) return c.json({ ok: false, error: "missing or malformed Vault App link" }, 401);
|
|
20802
|
+
const vault = typeof body.vault === "string" ? body.vault : "";
|
|
20803
|
+
const path5 = typeof body.path === "string" ? body.path : "";
|
|
20804
|
+
const status = stringValue(body.status, 80);
|
|
20805
|
+
const baseRevision = typeof body.baseRevision === "number" && Number.isInteger(body.baseRevision) ? body.baseRevision : void 0;
|
|
20806
|
+
if (!isVault(vault) || !path5 || !status) return c.json({ ok: false, error: "valid vault, path, and status are required" }, 400);
|
|
20807
|
+
const current = await memoryCall("getTool", { vault, path: path5 }, token);
|
|
20808
|
+
if (!current.ok || !current.note) return c.json(current, current.ok ? 404 : 502);
|
|
20809
|
+
const result = await memoryCall("putTool", {
|
|
20810
|
+
vault,
|
|
20811
|
+
path: path5,
|
|
20812
|
+
title: current.note.title,
|
|
20813
|
+
content: current.note.content,
|
|
20814
|
+
props: { ...current.note.props ?? {}, status },
|
|
20815
|
+
baseRevision: baseRevision ?? current.note.revision
|
|
20816
|
+
}, token);
|
|
20817
|
+
return c.json(result, result.ok ? 200 : result.conflict ? 409 : 502);
|
|
20818
|
+
});
|
|
20819
|
+
vaultApp.post("/api/activity", async (c) => {
|
|
20820
|
+
const body = await c.req.json().catch(() => ({}));
|
|
20821
|
+
const token = typeof body.token === "string" ? body.token : void 0;
|
|
20822
|
+
if (!validToken(token)) return c.json({ ok: false, error: "missing or malformed Vault App link" }, 401);
|
|
20823
|
+
const title = stringValue(body.title, 320);
|
|
20824
|
+
const content = typeof body.content === "string" && body.content.length <= 2e4 ? body.content : "";
|
|
20825
|
+
const props = propsValue(body.props) ?? {};
|
|
20826
|
+
if (!title) return c.json({ ok: false, error: "title is required" }, 400);
|
|
20827
|
+
const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
20828
|
+
const result = await memoryCall("putTool", {
|
|
20829
|
+
vault: "Communications",
|
|
20830
|
+
path: `Inbox/activity-${stamp}`,
|
|
20831
|
+
title,
|
|
20832
|
+
content: content || title,
|
|
20833
|
+
props: { status: "triaged", type: "decision", occurred_at: (/* @__PURE__ */ new Date()).toISOString(), ...props }
|
|
20834
|
+
}, token);
|
|
20835
|
+
return c.json(result, result.ok ? 200 : 502);
|
|
20836
|
+
});
|
|
20837
|
+
vaultApp.get("/:token", (c) => {
|
|
20838
|
+
const token = c.req.param("token");
|
|
20839
|
+
if (!validToken(token)) return c.html('<!doctype html><html><body style="font-family:system-ui;padding:40px"><h2>This Vault App link is not valid.</h2><p>Ask the AI to run get-vault-app-link again, or revoke-vault-app-link and issue a replacement.</p></body></html>', 401);
|
|
20840
|
+
const base = (process.env.VAULT_APP_BASE_URL ?? "https://vault.mcpscraper.dev").replace(/\/$/, "");
|
|
20841
|
+
return c.redirect(`${base}/vault/${encodeURIComponent(token)}`, 302);
|
|
20842
|
+
});
|
|
20843
|
+
|
|
20844
|
+
// src/api/schedule-routes.ts
|
|
20845
|
+
import { Hono as Hono23 } from "hono";
|
|
20846
|
+
var scheduleApp = new Hono23();
|
|
20692
20847
|
function tokenOk2(token) {
|
|
20693
20848
|
return !!token && token.startsWith("mk_") && token.length > 10;
|
|
20694
20849
|
}
|
|
@@ -21019,7 +21174,7 @@ loadActions();
|
|
|
21019
21174
|
}
|
|
21020
21175
|
|
|
21021
21176
|
// src/api/resend-inbound-routes.ts
|
|
21022
|
-
import { Hono as
|
|
21177
|
+
import { Hono as Hono24 } from "hono";
|
|
21023
21178
|
import { Resend } from "resend";
|
|
21024
21179
|
var SUPPORT_ADDRESS = "support@mcpscraper.dev";
|
|
21025
21180
|
var DMARC_ADDRESS = "dmarc@mcpscraper.dev";
|
|
@@ -21195,7 +21350,7 @@ async function forwardReceivedEmail(resend, email, destination, label) {
|
|
|
21195
21350
|
if (sent.error) throw new Error(`forward failed: ${sent.error.message}`);
|
|
21196
21351
|
return sent.data.id;
|
|
21197
21352
|
}
|
|
21198
|
-
var resendInboundApp = new
|
|
21353
|
+
var resendInboundApp = new Hono24();
|
|
21199
21354
|
resendInboundApp.post("/webhooks", async (c) => {
|
|
21200
21355
|
const apiKey = process.env.RESEND_API_KEY?.trim();
|
|
21201
21356
|
const webhookSecret = process.env.RESEND_WEBHOOK_SECRET?.trim();
|
|
@@ -24780,7 +24935,7 @@ var requirePaidSchedulingTier = createMiddleware3(async (c, next) => {
|
|
|
24780
24935
|
if (!hasPaidSchedulingAccess(user)) return c.json(paidPlanRequiredPayload(), 403);
|
|
24781
24936
|
return next();
|
|
24782
24937
|
});
|
|
24783
|
-
var app = new
|
|
24938
|
+
var app = new Hono25();
|
|
24784
24939
|
var STRIPE_API_VERSION2 = "2026-02-25.clover";
|
|
24785
24940
|
function requireStripeSecret() {
|
|
24786
24941
|
const secret2 = process.env.STRIPE_SECRET_KEY?.trim();
|
|
@@ -27075,6 +27230,7 @@ app.route("/serp-intelligence", serpIntelligenceApp);
|
|
|
27075
27230
|
app.route("/mcp", mcpApp);
|
|
27076
27231
|
app.route("/agent", buildBrowserAgentRoutes());
|
|
27077
27232
|
app.route("/chat", chatApp);
|
|
27233
|
+
app.route("/vault", vaultApp);
|
|
27078
27234
|
app.route("/schedule", scheduleApp);
|
|
27079
27235
|
app.route("/resend", resendInboundApp);
|
|
27080
27236
|
app.get("/console", (c) => c.html(renderConsoleHtml()));
|
|
@@ -27206,4 +27362,4 @@ app.get("/blog/:slug/", (c) => {
|
|
|
27206
27362
|
export {
|
|
27207
27363
|
app
|
|
27208
27364
|
};
|
|
27209
|
-
//# sourceMappingURL=server-
|
|
27365
|
+
//# sourceMappingURL=server-QQB4BNAB.js.map
|