@mulmoclaude/core 1.13.0 → 1.14.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.
Files changed (106) hide show
  1. package/assets/helps/error-recovery.md +12 -1
  2. package/dist/{calendarGrid-CaS9er8i.cjs → calendarGrid-BQYqOCnF.cjs} +8 -9
  3. package/dist/{calendarGrid-CaS9er8i.cjs.map → calendarGrid-BQYqOCnF.cjs.map} +1 -1
  4. package/dist/{calendarGrid-CrGxeCOG.js → calendarGrid-DivcNKkX.js} +8 -9
  5. package/dist/{calendarGrid-CrGxeCOG.js.map → calendarGrid-DivcNKkX.js.map} +1 -1
  6. package/dist/collection/core/schemaZ.d.ts +4 -4
  7. package/dist/collection/index.cjs +4 -4
  8. package/dist/collection/index.js +4 -4
  9. package/dist/collection/registry/server/index.cjs +3 -3
  10. package/dist/collection/registry/server/index.cjs.map +1 -1
  11. package/dist/collection/registry/server/index.js +3 -3
  12. package/dist/collection/registry/server/index.js.map +1 -1
  13. package/dist/collection/server/csvQuery.d.ts +7 -2
  14. package/dist/collection/server/csvStore.d.ts +2 -1
  15. package/dist/collection/server/index.cjs +3 -3
  16. package/dist/collection/server/index.js +3 -3
  17. package/dist/collection-watchers/index.cjs +10 -25
  18. package/dist/collection-watchers/index.cjs.map +1 -1
  19. package/dist/collection-watchers/index.js +10 -25
  20. package/dist/collection-watchers/index.js.map +1 -1
  21. package/dist/{discovery-DAoMnBYM.cjs → discovery-CRDx6TS4.cjs} +52 -32
  22. package/dist/discovery-CRDx6TS4.cjs.map +1 -0
  23. package/dist/{discovery-D-ZJ6a6z.js → discovery-D6p4ITNR.js} +52 -32
  24. package/dist/discovery-D6p4ITNR.js.map +1 -0
  25. package/dist/{dist-21pMsI1a.cjs → dist-CsgSfWwR.cjs} +22 -1
  26. package/dist/{dist-21pMsI1a.cjs.map → dist-CsgSfWwR.cjs.map} +1 -1
  27. package/dist/{dist-DP1FTGnO.js → dist-D8zokgGo.js} +11 -2
  28. package/dist/{dist-DP1FTGnO.js.map → dist-D8zokgGo.js.map} +1 -1
  29. package/dist/feeds/index.cjs +2 -2
  30. package/dist/feeds/index.js +2 -2
  31. package/dist/feeds/server/index.cjs +29 -23
  32. package/dist/feeds/server/index.cjs.map +1 -1
  33. package/dist/feeds/server/index.js +29 -23
  34. package/dist/feeds/server/index.js.map +1 -1
  35. package/dist/google/calendar.d.ts +23 -9
  36. package/dist/google/collectionPush.d.ts +13 -8
  37. package/dist/google/index.cjs +62 -37
  38. package/dist/google/index.cjs.map +1 -1
  39. package/dist/google/index.d.ts +2 -2
  40. package/dist/google/index.js +60 -37
  41. package/dist/google/index.js.map +1 -1
  42. package/dist/{ingestTypes-D1GQdG8e.cjs → ingestTypes-C7IJSqv4.cjs} +2 -2
  43. package/dist/{ingestTypes-D1GQdG8e.cjs.map → ingestTypes-C7IJSqv4.cjs.map} +1 -1
  44. package/dist/{ingestTypes-XReG-li7.js → ingestTypes-DmtDLRmt.js} +2 -2
  45. package/dist/{ingestTypes-XReG-li7.js.map → ingestTypes-DmtDLRmt.js.map} +1 -1
  46. package/dist/notifier/index.cjs +1 -1
  47. package/dist/notifier/index.js +1 -1
  48. package/dist/{notifier-CMFlw74b.js → notifier-Dxh8mEFh.js} +2 -2
  49. package/dist/{notifier-CMFlw74b.js.map → notifier-Dxh8mEFh.js.map} +1 -1
  50. package/dist/{notifier-C3IhYxqh.cjs → notifier-Wc4M24Bi.cjs} +2 -2
  51. package/dist/{notifier-C3IhYxqh.cjs.map → notifier-Wc4M24Bi.cjs.map} +1 -1
  52. package/dist/plugin-vue/index.cjs +4 -2
  53. package/dist/plugin-vue/index.cjs.map +1 -1
  54. package/dist/plugin-vue/index.js +4 -2
  55. package/dist/plugin-vue/index.js.map +1 -1
  56. package/dist/{project-B9NSyr6L.js → project-B0j_Vf_Q.js} +7 -2
  57. package/dist/project-B0j_Vf_Q.js.map +1 -0
  58. package/dist/{project-CCtT_fQr.cjs → project-C1ep9pvo.cjs} +7 -2
  59. package/dist/project-C1ep9pvo.cjs.map +1 -0
  60. package/dist/{promptSafety-FD8cQn3e.cjs → promptSafety-B52GvaJc.cjs} +99 -85
  61. package/dist/promptSafety-B52GvaJc.cjs.map +1 -0
  62. package/dist/{promptSafety-C--op_6a.js → promptSafety-DJgaDjM4.js} +99 -85
  63. package/dist/promptSafety-DJgaDjM4.js.map +1 -0
  64. package/dist/remote-host/index.cjs +2 -1
  65. package/dist/remote-host/index.d.ts +10 -0
  66. package/dist/remote-host/index.js +2 -2
  67. package/dist/remote-host/server/index.cjs +2 -2
  68. package/dist/remote-host/server/index.cjs.map +1 -1
  69. package/dist/remote-host/server/index.js +2 -2
  70. package/dist/remote-host/server/index.js.map +1 -1
  71. package/dist/{remote-host-DkDVxNim.cjs → remote-host-CtQjagPt.cjs} +53 -1
  72. package/dist/remote-host-CtQjagPt.cjs.map +1 -0
  73. package/dist/remote-host-Dba4lF3Z.js +82 -0
  74. package/dist/remote-host-Dba4lF3Z.js.map +1 -0
  75. package/dist/remote-view/index.cjs +6 -4
  76. package/dist/remote-view/index.cjs.map +1 -1
  77. package/dist/remote-view/index.js +6 -4
  78. package/dist/remote-view/index.js.map +1 -1
  79. package/dist/scheduler/index.cjs +1 -1
  80. package/dist/scheduler/index.js +1 -1
  81. package/dist/{server-Ci_A3chZ.js → server-D6EUf3BF.js} +46 -27
  82. package/dist/server-D6EUf3BF.js.map +1 -0
  83. package/dist/{server-B_b0bLSW.cjs → server-D7_oRbTJ.cjs} +46 -27
  84. package/dist/server-D7_oRbTJ.cjs.map +1 -0
  85. package/dist/utils/index.cjs +1 -1
  86. package/dist/utils/index.js +1 -1
  87. package/dist/whisper/index.cjs +2 -6
  88. package/dist/whisper/index.cjs.map +1 -1
  89. package/dist/whisper/index.js +2 -6
  90. package/dist/whisper/index.js.map +1 -1
  91. package/dist/wiki/index.cjs +2 -2
  92. package/dist/wiki/index.cjs.map +1 -1
  93. package/dist/wiki/index.js +2 -2
  94. package/dist/wiki/index.js.map +1 -1
  95. package/package.json +2 -2
  96. package/dist/discovery-D-ZJ6a6z.js.map +0 -1
  97. package/dist/discovery-DAoMnBYM.cjs.map +0 -1
  98. package/dist/project-B9NSyr6L.js.map +0 -1
  99. package/dist/project-CCtT_fQr.cjs.map +0 -1
  100. package/dist/promptSafety-C--op_6a.js.map +0 -1
  101. package/dist/promptSafety-FD8cQn3e.cjs.map +0 -1
  102. package/dist/remote-host-D_BRFHcI.js +0 -36
  103. package/dist/remote-host-D_BRFHcI.js.map +0 -1
  104. package/dist/remote-host-DkDVxNim.cjs.map +0 -1
  105. package/dist/server-B_b0bLSW.cjs.map +0 -1
  106. package/dist/server-Ci_A3chZ.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("../rolldown-runtime-D6vf50IK.cjs");
3
- const require_dist = require("../dist-21pMsI1a.cjs");
3
+ const require_dist = require("../dist-CsgSfWwR.cjs");
4
4
  const require_text = require("../text-CaAh9ZSO.cjs");
5
5
  const require_atomic = require("../atomic-C_7YpMiM.cjs");
6
6
  const require_utils_fetch = require("../utils/fetch.cjs");
7
- const require_calendarGrid = require("../calendarGrid-CaS9er8i.cjs");
8
- const require_project = require("../project-CCtT_fQr.cjs");
9
- const require_discovery = require("../discovery-DAoMnBYM.cjs");
7
+ const require_calendarGrid = require("../calendarGrid-BQYqOCnF.cjs");
8
+ const require_project = require("../project-C1ep9pvo.cjs");
9
+ const require_discovery = require("../discovery-CRDx6TS4.cjs");
10
10
  let node_fs = require("node:fs");
11
11
  let node_path = require("node:path");
12
12
  node_path = require_rolldown_runtime.__toESM(node_path, 1);
@@ -593,6 +593,7 @@ var CALENDAR_LIST_PAGE_SIZE = 250;
593
593
  var MAX_CALENDAR_LIST_PAGES = 40;
594
594
  var EVENT_SYNC_PAGE_SIZE = 2500;
595
595
  var MAX_EVENT_SYNC_PAGES = 200;
596
+ var CALENDAR_META_PAGE_SIZE = 1;
596
597
  var HTTP_GONE = 410;
597
598
  var EVENT_ABSENT_STATUSES = [404, HTTP_GONE];
598
599
  /** An `If-Match` write whose etag no longer matches — someone else changed the
@@ -804,20 +805,34 @@ async function collectCalendarPages(fetchPage, maxPages = MAX_CALENDAR_LIST_PAGE
804
805
  }
805
806
  return calendars;
806
807
  }
807
- /** The calendars the user has added/subscribed to (primary + secondary +
808
- * shared), each with its id, name and colour, following pagination. Needs the
809
- * calendar-list read scope (GOOGLE_CALENDARLIST_SCOPE). */
810
- /** One calendar's own resource, addressed by id rather than looked up in the
811
- * user's list.
808
+ var toCalendarMeta = (value) => {
809
+ const record = asRecord(value);
810
+ return {
811
+ timeZone: stringField(record, "timeZone"),
812
+ accessRole: stringField(record, "accessRole")
813
+ };
814
+ };
815
+ /** One calendar's zone and the caller's role on it, read by id rather than
816
+ * looked up in the user's list.
812
817
  *
813
818
  * `calendarList` only holds calendars the user has ADDED; a calendar shared
814
- * with them can be readable and writable by id without appearing there. This is
815
- * how a push learns such a calendar's `timeZone`. Note the resource carries no
816
- * `accessRole` — that is a calendarList property — so reachability here says
817
- * nothing about writability. */
818
- async function getCalendar(accessToken, calendarId) {
819
- return toCalendarSummary(await googleRequest(CALENDAR_API_LABEL, accessToken, `${CALENDAR_BASE_URL}/calendars/${encodeURIComponent(canonicalCalendarId(calendarId))}`));
819
+ * with them can be readable and writable by id without appearing there, and a
820
+ * push still needs its zone to send an offset-less `dateTime`.
821
+ *
822
+ * Deliberately `events.list` and NOT `calendars.get`: the latter takes only
823
+ * full-calendar scopes (`calendar`, `calendar.readonly`, `calendar.calendars*`)
824
+ * and this app asks for none of them, so it answers 403 for every account it
825
+ * links (#2735). The events list carries the same `timeZone` — plus the
826
+ * `accessRole` the calendar resource does not have — under `calendar.events`,
827
+ * which the push already holds because it writes with it. Only the envelope is
828
+ * read; the one event asked for is the smallest page Google will serve. */
829
+ async function getCalendarMeta(accessToken, calendarId) {
830
+ const params = new URLSearchParams({ maxResults: String(CALENDAR_META_PAGE_SIZE) });
831
+ return toCalendarMeta(await googleRequest(CALENDAR_API_LABEL, accessToken, `${eventsUrl(calendarId)}?${params.toString()}`));
820
832
  }
833
+ /** The calendars the user has added/subscribed to (primary + secondary +
834
+ * shared), each with its id, name and colour, following pagination. Needs the
835
+ * calendar-list read scope (GOOGLE_CALENDARLIST_SCOPE). */
821
836
  async function listCalendars(accessToken) {
822
837
  return collectCalendarPages(async (pageToken) => {
823
838
  const params = new URLSearchParams({ maxResults: String(CALENDAR_LIST_PAGE_SIZE) });
@@ -868,9 +883,7 @@ async function readLockRaw(lockPath) {
868
883
  function parseLock(raw) {
869
884
  try {
870
885
  const parsed = JSON.parse(raw);
871
- if (typeof parsed !== "object" || parsed === null) return null;
872
- const { holder } = parsed;
873
- return typeof holder === "string" ? { holder } : null;
886
+ return require_dist.hasStringProp(parsed, "holder") ? { holder: parsed.holder } : null;
874
887
  } catch {
875
888
  return null;
876
889
  }
@@ -1369,7 +1382,7 @@ var PUSHABLE_SOURCE_FIELDS = [
1369
1382
  "description",
1370
1383
  "location"
1371
1384
  ];
1372
- var isPushableSource = (source) => PUSHABLE_SOURCE_FIELDS.includes(source);
1385
+ var isPushableSource = (source) => PUSHABLE_SOURCE_FIELDS.some((field) => field === source);
1373
1386
  /** The subset of a schema's `map` a push can act on: collection field → event field. */
1374
1387
  function pushableMap(map) {
1375
1388
  return Object.fromEntries(Object.entries(map).filter((entry) => isPushableSource(entry[1])));
@@ -1491,21 +1504,28 @@ function locallyDeletedIds(shadow, presentIds) {
1491
1504
  var WRITABLE_ACCESS_ROLES = ["owner", "writer"];
1492
1505
  /** Whether to refuse the whole push before touching a single event.
1493
1506
  *
1494
- * Only on POSITIVE evidence of a non-writable role. An unlisted calendar is
1495
- * unknown and must fall through: hard-denying it would block the feature
1496
- * outright for a calendar the user can in fact write to. Those attempts surface
1497
- * Google's own 403 per record if the write really is not allowed. */
1507
+ * Only on POSITIVE evidence of a non-writable role. A calendar whose role
1508
+ * neither source reported is unknown and must fall through: hard-denying it
1509
+ * would block the feature outright for a calendar the user can in fact write
1510
+ * to. Those attempts surface Google's own 403 per record if the write really is
1511
+ * not allowed. */
1498
1512
  var isDeniedAccessRole = (accessRole) => accessRole !== null && !WRITABLE_ACCESS_ROLES.includes(accessRole);
1513
+ /** A role Google left blank is UNKNOWN, not a denial. `isDeniedAccessRole`
1514
+ * refuses every role it does not recognise — `""` included — so passing an
1515
+ * unreported one straight through would refuse a calendar Google simply said
1516
+ * nothing about. */
1517
+ var reportedAccessRole = (accessRole) => accessRole || null;
1499
1518
  /** Resolve the calendar a schema names, for its writability and its timezone.
1500
1519
  *
1501
- * The list is consulted first because only it reports `accessRole`, which is
1502
- * what lets a read-only calendar be refused with the real reason instead of an
1503
- * opaque per-event 403. `"primary"` is matched on the `primary` flag, not the
1504
- * id — the primary calendar's own id is the account's email address, which never
1505
- * equals the literal the schema declares.
1520
+ * The list is consulted first because it answers for every added calendar in
1521
+ * one call the push already makes. `"primary"` is matched on the `primary`
1522
+ * flag, not the id — the primary calendar's own id is the account's email
1523
+ * address, which never equals the literal the schema declares.
1506
1524
  *
1507
- * A calendar absent from the list is NOT denied: it is fetched by id for its
1508
- * timezone and its role left unknown. A 404 there means the calendar really is
1525
+ * A calendar absent from the list is NOT denied: `calendarList` holds only the
1526
+ * calendars the user has added, so one shared with write access can be missing
1527
+ * from it (Codex review). It is asked about itself instead, which reports the
1528
+ * same zone AND the real role. A 404 there means the calendar is genuinely
1509
1529
  * unreachable, and propagates as a `failed` outcome. */
1510
1530
  async function liveCalendarMeta(accessToken, calendarId) {
1511
1531
  const key = canonicalCalendarId(calendarId);
@@ -1515,10 +1535,13 @@ async function liveCalendarMeta(accessToken, calendarId) {
1515
1535
  accessRole: listed.accessRole,
1516
1536
  timeZone: listed.timeZone
1517
1537
  };
1518
- const direct = await getCalendar(accessToken, calendarId);
1519
- log.info("google", "calendar is not in the user's list — pushing without an up-front role check", { calendarId: key });
1538
+ const direct = await getCalendarMeta(accessToken, calendarId);
1539
+ log.info("google", "calendar is not in the user's list — role read from the calendar itself", {
1540
+ calendarId: key,
1541
+ accessRole: direct.accessRole
1542
+ });
1520
1543
  return {
1521
- accessRole: null,
1544
+ accessRole: reportedAccessRole(direct.accessRole),
1522
1545
  timeZone: direct.timeZone
1523
1546
  };
1524
1547
  }
@@ -1703,9 +1726,9 @@ async function createOrAdopt(ctx, eventId, record) {
1703
1726
  }
1704
1727
  /** A 403 on a write is a permissions answer, but `googleApiError` appends the
1705
1728
  * "is the API enabled for the Cloud project?" hint to every 403 — true for a
1706
- * disabled API, misleading here. Reached when the up-front role check could not
1707
- * run because the calendar is not in the user's list, which is exactly when the
1708
- * user needs the real reason. */
1729
+ * disabled API, misleading here. Reached when the up-front gate let the push
1730
+ * through on an unknown role, which is exactly when the user needs the real
1731
+ * reason. */
1709
1732
  function writeFailure(eventId, error) {
1710
1733
  if (isGoogleApiError(error) && error.status === 403) return {
1711
1734
  kind: "skipped",
@@ -2734,9 +2757,9 @@ exports.deleteGoogleTokens = deleteGoogleTokens;
2734
2757
  exports.deleteTask = deleteTask;
2735
2758
  exports.fieldText = fieldText;
2736
2759
  exports.findClientSecretPath = findClientSecretPath;
2737
- exports.getCalendar = getCalendar;
2738
2760
  exports.getCalendarColors = getCalendarColors;
2739
2761
  exports.getCalendarEvent = getCalendarEvent;
2762
+ exports.getCalendarMeta = getCalendarMeta;
2740
2763
  exports.getGoogleAccessToken = getGoogleAccessToken;
2741
2764
  exports.googleApiError = googleApiError;
2742
2765
  exports.googleAuthFlow = googleAuthFlow;
@@ -2783,6 +2806,7 @@ exports.pushCollectionNow = pushCollectionNow;
2783
2806
  exports.pushableMap = pushableMap;
2784
2807
  exports.readDriveFile = readDriveFile;
2785
2808
  exports.releaseOrphanedCalendarToken = releaseOrphanedCalendarToken;
2809
+ exports.reportedAccessRole = reportedAccessRole;
2786
2810
  exports.resolveEventSpan = resolveEventSpan;
2787
2811
  exports.saveCalendarShadow = saveCalendarShadow;
2788
2812
  exports.saveCalendarSyncToken = saveCalendarSyncToken;
@@ -2794,6 +2818,7 @@ exports.syncCalendarForCollection = syncCalendarForCollection;
2794
2818
  exports.syncCalendarGroup = syncCalendarGroup;
2795
2819
  exports.syncDueCalendarCollections = syncDueCalendarCollections;
2796
2820
  exports.syncNewCalendarCollections = syncNewCalendarCollections;
2821
+ exports.toCalendarMeta = toCalendarMeta;
2797
2822
  exports.toCalendarSummary = toCalendarSummary;
2798
2823
  exports.toCollectionDateTime = toCollectionDateTime;
2799
2824
  exports.toCollectionRecord = toCollectionRecord;