mcp-scraper 0.29.0 → 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-66SYKL2G.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-7TNTBRQW.js";
80
+ import "./chunk-WQUF7AH7.js";
81
81
  import {
82
82
  completeExtractJob,
83
83
  countSuccessfulPages,
@@ -20698,7 +20698,21 @@ loadChannels();
20698
20698
 
20699
20699
  // src/api/vault-routes.ts
20700
20700
  import { Hono as Hono22 } from "hono";
20701
- var VAULTS = ["People", "Deals", "Projects", "Tasks", "Communications"];
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,11 +20764,28 @@ 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";
20756
20786
  if (vault === "Projects") return "project";
20757
20787
  if (vault === "Tasks") return "task";
20788
+ if (vault === "Calendar") return "event";
20758
20789
  return "unclassified";
20759
20790
  }
20760
20791
  function defaultStatus(vault) {
@@ -20762,6 +20793,7 @@ function defaultStatus(vault) {
20762
20793
  if (vault === "Deals") return "lead";
20763
20794
  if (vault === "Projects") return "active";
20764
20795
  if (vault === "Tasks") return "to_do";
20796
+ if (vault === "Calendar") return "scheduled";
20765
20797
  return "inbox";
20766
20798
  }
20767
20799
  function nonEmptyStrings(value) {
@@ -20778,15 +20810,15 @@ function validateNewRecord(vault, props) {
20778
20810
  }
20779
20811
  if (vault === "Projects") {
20780
20812
  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";
20813
+ if (type === "project" && !projectTypeFor(props)) {
20814
+ return "Projects require project_type: codebase, personal, work, or client";
20783
20815
  }
20784
20816
  }
20785
20817
  if (vault === "Tasks") {
20786
20818
  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
- }
20819
+ const hasProjectRef = typeof props.project_ref === "string" && props.project_ref.trim().length > 0;
20820
+ const hasProjectTitle = typeof props.project === "string" && props.project.trim().length > 0;
20821
+ if (hasProjectRef !== hasProjectTitle) return "Tasks project_ref and project must be supplied together when a task is linked to a project";
20790
20822
  }
20791
20823
  if (vault === "Communications") {
20792
20824
  if (!["email", "slack", "message", "call", "meeting", "social_media", "thread", "decision"].includes(type)) return "Communications records need a valid communication type";
@@ -20863,10 +20895,11 @@ vaultApp.post("/api/records", async (c) => {
20863
20895
  const content = typeof body.content === "string" && body.content.length <= 1e5 ? body.content : "";
20864
20896
  const props = propsValue(body.props) ?? {};
20865
20897
  if (!isVault(vault) || !path5 || !title) return c.json({ ok: false, error: "vault, path, and title are required" }, 400);
20866
- const validationError = validateNewRecord(vault, props);
20898
+ const normalizedProps = normalizeRelationshipProps(vault, props);
20899
+ const validationError = validateNewRecord(vault, normalizedProps);
20867
20900
  if (validationError) return c.json({ ok: false, error: validationError }, 400);
20868
20901
  const baseRevision = typeof body.baseRevision === "number" && Number.isInteger(body.baseRevision) ? body.baseRevision : void 0;
20869
- 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);
20870
20903
  return c.json(result, result.ok ? 200 : result.conflict ? 409 : 502);
20871
20904
  });
20872
20905
  vaultApp.post("/api/records/transition", async (c) => {
@@ -20905,12 +20938,15 @@ vaultApp.post("/api/records/update", async (c) => {
20905
20938
  }
20906
20939
  const current = await readMemory("getTool", { vault, path: path5 }, token);
20907
20940
  if (!current.ok || !current.note) return c.json(current, current.ok ? 404 : 502);
20941
+ const nextProps = normalizeRelationshipProps(vault, { ...current.note.props ?? {}, ...props ?? {} });
20942
+ const validationError = validateNewRecord(vault, nextProps);
20943
+ if (validationError) return c.json({ ok: false, error: validationError }, 400);
20908
20944
  const result = await memoryCall("putTool", {
20909
20945
  vault,
20910
20946
  path: path5,
20911
20947
  title: title ?? current.note.title,
20912
20948
  content: content ?? current.note.content,
20913
- props: { ...current.note.props ?? {}, ...props ?? {} },
20949
+ props: nextProps,
20914
20950
  baseRevision: baseRevision ?? current.note.revision
20915
20951
  }, token);
20916
20952
  return c.json(result, result.ok ? 200 : result.conflict ? 409 : 502);
@@ -20984,13 +21020,39 @@ vaultApp.post("/api/activity", async (c) => {
20984
21020
  const content = typeof body.content === "string" && body.content.length <= 2e4 ? body.content : "";
20985
21021
  const props = propsValue(body.props) ?? {};
20986
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
+ }
20987
21033
  const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
20988
21034
  const result = await memoryCall("putTool", {
20989
21035
  vault: "Communications",
20990
21036
  path: `Inbox/activity-${stamp}`,
20991
21037
  title,
20992
21038
  content: content || title,
20993
- 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
+ }
20994
21056
  }, token);
20995
21057
  return c.json(result, result.ok ? 200 : 502);
20996
21058
  });
@@ -27516,4 +27578,4 @@ app.get("/blog/:slug/", (c) => {
27516
27578
  export {
27517
27579
  app
27518
27580
  };
27519
- //# sourceMappingURL=server-N4QMTJPS.js.map
27581
+ //# sourceMappingURL=server-PBPXND5G.js.map