mcp-scraper 0.28.3 → 0.29.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 +75 -21
- 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 +1 -1
- package/dist/bin/mcp-scraper-install.cjs.map +1 -1
- package/dist/bin/mcp-scraper-install.js +1 -1
- package/dist/bin/mcp-stdio-server.cjs +25 -15
- package/dist/bin/mcp-stdio-server.cjs.map +1 -1
- package/dist/bin/mcp-stdio-server.js +2 -2
- package/dist/{chunk-2W4RWWXL.js → chunk-66SYKL2G.js} +26 -16
- package/dist/chunk-66SYKL2G.js.map +1 -0
- package/dist/chunk-7TNTBRQW.js +7 -0
- package/dist/chunk-7TNTBRQW.js.map +1 -0
- package/dist/{server-53OTA5HA.js → server-N4QMTJPS.js} +53 -9
- package/dist/{server-53OTA5HA.js.map → server-N4QMTJPS.js.map} +1 -1
- package/docs/mcp-tool-manifest.generated.json +13 -13
- package/package.json +2 -2
- package/dist/chunk-2W4RWWXL.js.map +0 -1
- package/dist/chunk-EMF4W6QM.js +0 -7
- package/dist/chunk-EMF4W6QM.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["export const PACKAGE_VERSION = '0.29.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-66SYKL2G.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-7TNTBRQW.js";
|
|
81
81
|
import {
|
|
82
82
|
completeExtractJob,
|
|
83
83
|
countSuccessfulPages,
|
|
@@ -20698,7 +20698,7 @@ loadChannels();
|
|
|
20698
20698
|
|
|
20699
20699
|
// src/api/vault-routes.ts
|
|
20700
20700
|
import { Hono as Hono22 } from "hono";
|
|
20701
|
-
var VAULTS = ["People", "Projects", "Tasks", "Communications"];
|
|
20701
|
+
var VAULTS = ["People", "Deals", "Projects", "Tasks", "Communications"];
|
|
20702
20702
|
var MAX_VAULT_RECORDS = 200;
|
|
20703
20703
|
var MAX_MEMORY_READ_CONCURRENCY = 4;
|
|
20704
20704
|
var MAX_MEMORY_READ_ATTEMPTS = 3;
|
|
@@ -20752,16 +20752,53 @@ function workspaceRecord(vault, note) {
|
|
|
20752
20752
|
}
|
|
20753
20753
|
function defaultType(vault) {
|
|
20754
20754
|
if (vault === "People" || vault === "Communications") return "unclassified";
|
|
20755
|
+
if (vault === "Deals") return "deal";
|
|
20755
20756
|
if (vault === "Projects") return "project";
|
|
20756
20757
|
if (vault === "Tasks") return "task";
|
|
20757
20758
|
return "unclassified";
|
|
20758
20759
|
}
|
|
20759
20760
|
function defaultStatus(vault) {
|
|
20760
20761
|
if (vault === "People") return "active";
|
|
20762
|
+
if (vault === "Deals") return "lead";
|
|
20761
20763
|
if (vault === "Projects") return "active";
|
|
20762
20764
|
if (vault === "Tasks") return "to_do";
|
|
20763
20765
|
return "inbox";
|
|
20764
20766
|
}
|
|
20767
|
+
function nonEmptyStrings(value) {
|
|
20768
|
+
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string" && entry.trim().length > 0) : [];
|
|
20769
|
+
}
|
|
20770
|
+
function validateNewRecord(vault, props) {
|
|
20771
|
+
const type = typeof props.type === "string" ? props.type : "";
|
|
20772
|
+
if (vault === "People" && !["person", "organization"].includes(type)) return "People records must be a person or organization";
|
|
20773
|
+
if (vault === "Deals") {
|
|
20774
|
+
if (type !== "deal") return "Deals records must have type deal";
|
|
20775
|
+
if (typeof props.organization_ref !== "string" && nonEmptyStrings(props.person_refs).length === 0) {
|
|
20776
|
+
return "Deals require a known organization or person";
|
|
20777
|
+
}
|
|
20778
|
+
}
|
|
20779
|
+
if (vault === "Projects") {
|
|
20780
|
+
if (!["project", "vault_settings"].includes(type)) return "Projects records must have type project";
|
|
20781
|
+
if (type === "project" && !["codebase", "client", "personal", "workstream"].includes(String(props.project_kind ?? ""))) {
|
|
20782
|
+
return "Projects require project_kind: codebase, client, personal, or workstream";
|
|
20783
|
+
}
|
|
20784
|
+
}
|
|
20785
|
+
if (vault === "Tasks") {
|
|
20786
|
+
if (!["task", "milestone"].includes(type)) return "Tasks records must have type task or milestone";
|
|
20787
|
+
if (typeof props.project_ref !== "string" || !props.project_ref.trim() || typeof props.project !== "string" || !props.project.trim()) {
|
|
20788
|
+
return "Tasks must be linked to an existing project";
|
|
20789
|
+
}
|
|
20790
|
+
}
|
|
20791
|
+
if (vault === "Communications") {
|
|
20792
|
+
if (!["email", "slack", "message", "call", "meeting", "social_media", "thread", "decision"].includes(type)) return "Communications records need a valid communication type";
|
|
20793
|
+
if (!["none", "needs_reply", "needs_review", "waiting"].includes(String(props.attention_state ?? ""))) {
|
|
20794
|
+
return "Communications require attention_state: none, needs_reply, needs_review, or waiting";
|
|
20795
|
+
}
|
|
20796
|
+
if (type === "email" && props.direction === "draft" && props.approval_state !== "pending") {
|
|
20797
|
+
return "Email drafts awaiting review must have approval_state pending";
|
|
20798
|
+
}
|
|
20799
|
+
}
|
|
20800
|
+
return null;
|
|
20801
|
+
}
|
|
20765
20802
|
function shouldRetryMemoryRead(error) {
|
|
20766
20803
|
return /deadlock|timeout|timed out|temporar|econnreset|fetch failed/i.test(error ?? "");
|
|
20767
20804
|
}
|
|
@@ -20826,6 +20863,8 @@ vaultApp.post("/api/records", async (c) => {
|
|
|
20826
20863
|
const content = typeof body.content === "string" && body.content.length <= 1e5 ? body.content : "";
|
|
20827
20864
|
const props = propsValue(body.props) ?? {};
|
|
20828
20865
|
if (!isVault(vault) || !path5 || !title) return c.json({ ok: false, error: "vault, path, and title are required" }, 400);
|
|
20866
|
+
const validationError = validateNewRecord(vault, props);
|
|
20867
|
+
if (validationError) return c.json({ ok: false, error: validationError }, 400);
|
|
20829
20868
|
const baseRevision = typeof body.baseRevision === "number" && Number.isInteger(body.baseRevision) ? body.baseRevision : void 0;
|
|
20830
20869
|
const result = await memoryCall("putTool", { vault, path: path5, title, content: content || title, props, ...baseRevision === void 0 ? {} : { baseRevision } }, token);
|
|
20831
20870
|
return c.json(result, result.ok ? 200 : result.conflict ? 409 : 502);
|
|
@@ -20906,20 +20945,25 @@ vaultApp.post("/api/communications/review", async (c) => {
|
|
|
20906
20945
|
const content = typeof body.content === "string" && body.content.length <= 1e5 ? body.content : void 0;
|
|
20907
20946
|
const feedback = typeof body.feedback === "string" ? body.feedback.trim().slice(0, 1e4) : void 0;
|
|
20908
20947
|
const baseRevision = typeof body.baseRevision === "number" && Number.isInteger(body.baseRevision) ? body.baseRevision : void 0;
|
|
20909
|
-
|
|
20948
|
+
const normalizedAction = action === "accept" ? "approve" : action;
|
|
20949
|
+
if (!path5 || !normalizedAction || !["approve", "deny", "edit"].includes(normalizedAction) || body.title !== void 0 && !title) {
|
|
20910
20950
|
return c.json({ ok: false, error: "valid path, action, and optional draft fields are required" }, 400);
|
|
20911
20951
|
}
|
|
20912
20952
|
const current = await readMemory("getTool", { vault: "Communications", path: path5 }, token);
|
|
20913
20953
|
if (!current.ok || !current.note) return c.json(current, current.ok ? 404 : 502);
|
|
20914
20954
|
if (current.note.props?.type !== "email") return c.json({ ok: false, error: "only email communications can be reviewed" }, 400);
|
|
20915
|
-
const reviewed =
|
|
20916
|
-
const reviewState =
|
|
20917
|
-
const
|
|
20955
|
+
const reviewed = normalizedAction === "approve" || normalizedAction === "deny";
|
|
20956
|
+
const reviewState = normalizedAction === "approve" ? "accepted" : normalizedAction === "deny" ? "denied" : "pending";
|
|
20957
|
+
const approvalState = normalizedAction === "approve" ? "approved" : normalizedAction === "deny" ? "denied" : "pending";
|
|
20958
|
+
const status = normalizedAction === "approve" ? "triaged" : normalizedAction === "deny" ? "archived" : "inbox";
|
|
20918
20959
|
const props = {
|
|
20919
20960
|
...current.note.props ?? {},
|
|
20920
20961
|
status,
|
|
20921
20962
|
review_state: reviewState,
|
|
20963
|
+
approval_state: approvalState,
|
|
20964
|
+
attention_state: normalizedAction === "edit" ? "needs_review" : "none",
|
|
20922
20965
|
...reviewed ? { reviewed_at: (/* @__PURE__ */ new Date()).toISOString() } : {},
|
|
20966
|
+
...normalizedAction === "approve" ? { approved_at: (/* @__PURE__ */ new Date()).toISOString() } : {},
|
|
20923
20967
|
...feedback ? { review_feedback: feedback } : {}
|
|
20924
20968
|
};
|
|
20925
20969
|
const result = await memoryCall("putTool", {
|
|
@@ -20946,7 +20990,7 @@ vaultApp.post("/api/activity", async (c) => {
|
|
|
20946
20990
|
path: `Inbox/activity-${stamp}`,
|
|
20947
20991
|
title,
|
|
20948
20992
|
content: content || title,
|
|
20949
|
-
props: { status: "triaged", type: "decision", occurred_at: (/* @__PURE__ */ new Date()).toISOString(), ...props }
|
|
20993
|
+
props: { status: "triaged", type: "decision", attention_state: "none", occurred_at: (/* @__PURE__ */ new Date()).toISOString(), ...props }
|
|
20950
20994
|
}, token);
|
|
20951
20995
|
return c.json(result, result.ok ? 200 : 502);
|
|
20952
20996
|
});
|
|
@@ -27472,4 +27516,4 @@ app.get("/blog/:slug/", (c) => {
|
|
|
27472
27516
|
export {
|
|
27473
27517
|
app
|
|
27474
27518
|
};
|
|
27475
|
-
//# sourceMappingURL=server-
|
|
27519
|
+
//# sourceMappingURL=server-N4QMTJPS.js.map
|