mcp-scraper 0.29.1 → 0.30.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.
@@ -0,0 +1,7 @@
1
+ // src/version.ts
2
+ var PACKAGE_VERSION = "0.30.0";
3
+
4
+ export {
5
+ PACKAGE_VERSION
6
+ };
7
+ //# sourceMappingURL=chunk-WQUF7AH7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/version.ts"],"sourcesContent":["export const PACKAGE_VERSION = '0.30.0'\n"],"mappings":";AAAO,IAAM,kBAAkB;","names":[]}
@@ -36,7 +36,7 @@ import {
36
36
  sanitizeAttempts,
37
37
  sanitizeHarvestResult,
38
38
  transcribeMediaUrl
39
- } from "./chunk-HVQR7VAE.js";
39
+ } from "./chunk-T2CIPAOK.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-63PP32WV.js";
80
+ import "./chunk-WQUF7AH7.js";
81
81
  import {
82
82
  completeExtractJob,
83
83
  countSuccessfulPages,
@@ -20699,6 +20699,20 @@ loadChannels();
20699
20699
  // src/api/vault-routes.ts
20700
20700
  import { Hono as Hono22 } from "hono";
20701
20701
  var VAULTS = ["People", "Deals", "Projects", "Tasks", "Communications", "Calendar"];
20702
+ var PROJECT_TYPES = ["codebase", "personal", "work", "client"];
20703
+ var PROJECT_KIND_BY_TYPE = {
20704
+ codebase: "codebase",
20705
+ personal: "personal",
20706
+ work: "workstream",
20707
+ client: "client"
20708
+ };
20709
+ var PROJECT_TYPE_BY_KIND = {
20710
+ codebase: "codebase",
20711
+ personal: "personal",
20712
+ work: "work",
20713
+ workstream: "work",
20714
+ client: "client"
20715
+ };
20702
20716
  var MAX_VAULT_RECORDS = 200;
20703
20717
  var MAX_MEMORY_READ_CONCURRENCY = 4;
20704
20718
  var MAX_MEMORY_READ_ATTEMPTS = 3;
@@ -20735,7 +20749,7 @@ vaultApp.use("/api/*", async (c, next) => {
20735
20749
  await next();
20736
20750
  });
20737
20751
  function workspaceRecord(vault, note) {
20738
- const props = note.props ?? {};
20752
+ const props = normalizeRelationshipProps(vault, note.props ?? {});
20739
20753
  return {
20740
20754
  id: `${vault}:${note.path}`,
20741
20755
  vault,
@@ -20750,6 +20764,22 @@ function workspaceRecord(vault, note) {
20750
20764
  capturedAt: note.capturedAt
20751
20765
  };
20752
20766
  }
20767
+ function projectTypeFor(props) {
20768
+ const projectType = typeof props.project_type === "string" ? props.project_type : "";
20769
+ if (PROJECT_TYPES.includes(projectType)) return projectType;
20770
+ const projectKind = typeof props.project_kind === "string" ? props.project_kind : "";
20771
+ return PROJECT_TYPE_BY_KIND[projectKind] ?? null;
20772
+ }
20773
+ function normalizeRelationshipProps(vault, props) {
20774
+ if (vault !== "Projects" || props.type === "vault_settings") return props;
20775
+ const projectType = projectTypeFor(props);
20776
+ if (!projectType) return props;
20777
+ return {
20778
+ ...props,
20779
+ project_type: projectType,
20780
+ project_kind: PROJECT_KIND_BY_TYPE[projectType]
20781
+ };
20782
+ }
20753
20783
  function defaultType(vault) {
20754
20784
  if (vault === "People" || vault === "Communications") return "unclassified";
20755
20785
  if (vault === "Deals") return "deal";
@@ -20780,8 +20810,8 @@ function validateNewRecord(vault, props) {
20780
20810
  }
20781
20811
  if (vault === "Projects") {
20782
20812
  if (!["project", "vault_settings"].includes(type)) return "Projects records must have type project";
20783
- if (type === "project" && !["codebase", "client", "personal", "workstream"].includes(String(props.project_kind ?? ""))) {
20784
- return "Projects require project_kind: codebase, client, personal, or workstream";
20813
+ if (type === "project" && !projectTypeFor(props)) {
20814
+ return "Projects require project_type: codebase, personal, work, or client";
20785
20815
  }
20786
20816
  }
20787
20817
  if (vault === "Tasks") {
@@ -20865,10 +20895,11 @@ vaultApp.post("/api/records", async (c) => {
20865
20895
  const content = typeof body.content === "string" && body.content.length <= 1e5 ? body.content : "";
20866
20896
  const props = propsValue(body.props) ?? {};
20867
20897
  if (!isVault(vault) || !path5 || !title) return c.json({ ok: false, error: "vault, path, and title are required" }, 400);
20868
- const validationError = validateNewRecord(vault, props);
20898
+ const normalizedProps = normalizeRelationshipProps(vault, props);
20899
+ const validationError = validateNewRecord(vault, normalizedProps);
20869
20900
  if (validationError) return c.json({ ok: false, error: validationError }, 400);
20870
20901
  const baseRevision = typeof body.baseRevision === "number" && Number.isInteger(body.baseRevision) ? body.baseRevision : void 0;
20871
- const result = await memoryCall("putTool", { vault, path: path5, title, content: content || title, props, ...baseRevision === void 0 ? {} : { baseRevision } }, token);
20902
+ const result = await memoryCall("putTool", { vault, path: path5, title, content: content || title, props: normalizedProps, ...baseRevision === void 0 ? {} : { baseRevision } }, token);
20872
20903
  return c.json(result, result.ok ? 200 : result.conflict ? 409 : 502);
20873
20904
  });
20874
20905
  vaultApp.post("/api/records/transition", async (c) => {
@@ -20907,7 +20938,7 @@ vaultApp.post("/api/records/update", async (c) => {
20907
20938
  }
20908
20939
  const current = await readMemory("getTool", { vault, path: path5 }, token);
20909
20940
  if (!current.ok || !current.note) return c.json(current, current.ok ? 404 : 502);
20910
- const nextProps = { ...current.note.props ?? {}, ...props ?? {} };
20941
+ const nextProps = normalizeRelationshipProps(vault, { ...current.note.props ?? {}, ...props ?? {} });
20911
20942
  const validationError = validateNewRecord(vault, nextProps);
20912
20943
  if (validationError) return c.json({ ok: false, error: validationError }, 400);
20913
20944
  const result = await memoryCall("putTool", {
@@ -20989,13 +21020,39 @@ vaultApp.post("/api/activity", async (c) => {
20989
21020
  const content = typeof body.content === "string" && body.content.length <= 2e4 ? body.content : "";
20990
21021
  const props = propsValue(body.props) ?? {};
20991
21022
  if (!title) return c.json({ ok: false, error: "title is required" }, 400);
21023
+ const personRefs = nonEmptyStrings(props.person_refs);
21024
+ if (personRefs.length === 0 || personRefs.some((ref) => !/^People::.+/.test(ref))) {
21025
+ return c.json({ ok: false, error: "Activities require at least one canonical People reference in person_refs" }, 400);
21026
+ }
21027
+ for (const ref of personRefs) {
21028
+ const person = await readMemory("getTool", { vault: "People", path: ref.replace(/^People::/, "") }, token);
21029
+ if (!person.ok || !person.note || !["person", "organization"].includes(String(person.note.props?.type ?? ""))) {
21030
+ return c.json({ ok: false, error: `Activity person reference is not a known People record: ${ref}` }, 400);
21031
+ }
21032
+ }
20992
21033
  const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
20993
21034
  const result = await memoryCall("putTool", {
20994
21035
  vault: "Communications",
20995
21036
  path: `Inbox/activity-${stamp}`,
20996
21037
  title,
20997
21038
  content: content || title,
20998
- props: { status: "triaged", type: "decision", attention_state: "none", occurred_at: (/* @__PURE__ */ new Date()).toISOString(), ...props }
21039
+ props: {
21040
+ status: "triaged",
21041
+ type: "decision",
21042
+ attention_state: "none",
21043
+ occurred_at: (/* @__PURE__ */ new Date()).toISOString(),
21044
+ source_type: "manual",
21045
+ source_ref: "vault-app:activity",
21046
+ summary: title,
21047
+ embedding_summary: title,
21048
+ related: [],
21049
+ related_vault_notes: personRefs,
21050
+ embed: true,
21051
+ embed_priority: "normal",
21052
+ activity_kind: "note",
21053
+ ...props,
21054
+ person_refs: personRefs
21055
+ }
20999
21056
  }, token);
21000
21057
  return c.json(result, result.ok ? 200 : 502);
21001
21058
  });
@@ -27521,4 +27578,4 @@ app.get("/blog/:slug/", (c) => {
27521
27578
  export {
27522
27579
  app
27523
27580
  };
27524
- //# sourceMappingURL=server-F3I77L26.js.map
27581
+ //# sourceMappingURL=server-PBPXND5G.js.map