@mulmoclaude/core 3.6.0 → 3.7.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/dist/collection/registry/server/index.cjs +19 -19
- package/dist/collection/registry/server/index.cjs.map +1 -1
- package/dist/collection/registry/server/index.js +2 -2
- package/dist/collection/server/host.d.ts +11 -0
- package/dist/collection/server/index.cjs +72 -59
- package/dist/collection/server/index.d.ts +4 -0
- package/dist/collection/server/index.js +3 -3
- package/dist/collection/server/manageTool.d.ts +4 -0
- package/dist/collection/server/publish.d.ts +56 -0
- package/dist/collection/server/publishChecks.d.ts +29 -0
- package/dist/collection/server/publishManifest.d.ts +181 -0
- package/dist/collection/server/publishProject.d.ts +86 -0
- package/dist/collection/server/validate.d.ts +12 -0
- package/dist/collection-watchers/index.cjs +15 -15
- package/dist/collection-watchers/index.cjs.map +1 -1
- package/dist/collection-watchers/index.js +2 -2
- package/dist/feeds/server/index.cjs +10 -10
- package/dist/feeds/server/index.cjs.map +1 -1
- package/dist/feeds/server/index.js +2 -2
- package/dist/google/index.cjs +12 -12
- package/dist/google/index.cjs.map +1 -1
- package/dist/google/index.js +1 -1
- package/dist/{server-DdHaX_Uu.js → server-B48Jyxcj.js} +1079 -228
- package/dist/server-B48Jyxcj.js.map +1 -0
- package/dist/{server-9mFaGLdq.cjs → server-CWZyg8fn.cjs} +1318 -389
- package/dist/server-CWZyg8fn.cjs.map +1 -0
- package/dist/{discovery-Cw5xWzZD.cjs → store-5_P_NsGa.cjs} +1947 -1947
- package/dist/store-5_P_NsGa.cjs.map +1 -0
- package/dist/{discovery-CdkaURVY.js → store-_61sO8K8.js} +1948 -1948
- package/dist/store-_61sO8K8.js.map +1 -0
- package/dist/whisper/index.cjs +1 -1
- package/dist/whisper/index.js +1 -1
- package/package.json +1 -1
- package/dist/discovery-CdkaURVY.js.map +0 -1
- package/dist/discovery-Cw5xWzZD.cjs.map +0 -1
- package/dist/server-9mFaGLdq.cjs.map +0 -1
- package/dist/server-DdHaX_Uu.js.map +0 -1
package/dist/google/index.cjs
CHANGED
|
@@ -6,7 +6,7 @@ const require_root = require("../root-rPH6FGDT.cjs");
|
|
|
6
6
|
const require_utils_fetch = require("../utils/fetch.cjs");
|
|
7
7
|
const require_calendarGrid = require("../calendarGrid-DGILaVxI.cjs");
|
|
8
8
|
const require_project = require("../project-C1ep9pvo.cjs");
|
|
9
|
-
const
|
|
9
|
+
const require_store = require("../store-5_P_NsGa.cjs");
|
|
10
10
|
const require_paths = require("../paths-ClV946_f.cjs");
|
|
11
11
|
let node_fs = require("node:fs");
|
|
12
12
|
let node_path = require("node:path");
|
|
@@ -19,11 +19,11 @@ let node_http = require("node:http");
|
|
|
19
19
|
node_http = require_rolldown_runtime.__toESM(node_http, 1);
|
|
20
20
|
let google_auth_library = require("google-auth-library");
|
|
21
21
|
//#region src/google/host.ts
|
|
22
|
-
var hostSlot =
|
|
22
|
+
var hostSlot = require_store.createHostSlot("@mulmoclaude/core/google: configureGoogleHost()");
|
|
23
23
|
function configureGoogleHost(binding) {
|
|
24
24
|
hostSlot.set(binding.log);
|
|
25
25
|
}
|
|
26
|
-
var log =
|
|
26
|
+
var log = require_store.createForwardingLogger(() => hostSlot.peek());
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region src/google/datetime.ts
|
|
29
29
|
var ISO_DATE_TIME_WITH_OFFSET_RE = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:Z|[+-](\d{2}):(\d{2}))$/;
|
|
@@ -1023,7 +1023,7 @@ var stateLockPath = (statePath) => `${statePath}.lock`;
|
|
|
1023
1023
|
var SYNC_STATE_MODE = 384;
|
|
1024
1024
|
/** `<workspace>/data/calendar/.sync-state.json` */
|
|
1025
1025
|
function calendarSyncStatePath(workspaceRoot) {
|
|
1026
|
-
return node_path.default.join(workspaceRoot ??
|
|
1026
|
+
return node_path.default.join(workspaceRoot ?? require_store.getWorkspaceRoot(), "data", "calendar", ".sync-state.json");
|
|
1027
1027
|
}
|
|
1028
1028
|
var calendarKey = canonicalCalendarId;
|
|
1029
1029
|
/** The key for a consumer that reads a calendar without KEEPING what it reads.
|
|
@@ -1210,7 +1210,7 @@ async function markCalendarBackfilled(dataDir, calendarId, walkedAt) {
|
|
|
1210
1210
|
var PUSH_STATE_MODE = 384;
|
|
1211
1211
|
/** `<workspace>/data/calendar/.push-state.json` */
|
|
1212
1212
|
function calendarPushStatePath(workspaceRoot) {
|
|
1213
|
-
return node_path.default.join(workspaceRoot ??
|
|
1213
|
+
return node_path.default.join(workspaceRoot ?? require_store.getWorkspaceRoot(), "data", "calendar", ".push-state.json");
|
|
1214
1214
|
}
|
|
1215
1215
|
var toShadowEvent = (event) => ({
|
|
1216
1216
|
summary: event.summary,
|
|
@@ -1614,7 +1614,7 @@ async function liveCalendarMeta(accessToken, calendarId) {
|
|
|
1614
1614
|
};
|
|
1615
1615
|
}
|
|
1616
1616
|
async function findCalendarCollection(slug, workspaceRoot) {
|
|
1617
|
-
return (await
|
|
1617
|
+
return (await require_store.discoverCollections({ workspaceRoot })).find((collection) => collection.slug === slug && collection.schema.googleCalendar) ?? null;
|
|
1618
1618
|
}
|
|
1619
1619
|
var liveDeps = {
|
|
1620
1620
|
findCollection: findCalendarCollection,
|
|
@@ -1867,7 +1867,7 @@ function locallyEditedIds(records, shadow, map, primaryKey, fields) {
|
|
|
1867
1867
|
async function unsentLocalEdits(collection, workspaceRoot) {
|
|
1868
1868
|
const { schema } = collection;
|
|
1869
1869
|
const shadow = await loadCalendarShadow(schema.googleCalendar?.calendarId, workspaceRoot);
|
|
1870
|
-
return locallyEditedIds(await
|
|
1870
|
+
return locallyEditedIds(await require_store.storeFor(collection, { workspaceRoot }).list(), shadow, pushableMap(schema.googleCalendar?.map ?? {}), schema.primaryKey, schema.fields);
|
|
1871
1871
|
}
|
|
1872
1872
|
/** Push one collection WITHOUT taking the calendar lock.
|
|
1873
1873
|
*
|
|
@@ -1886,7 +1886,7 @@ async function pushCollectionNow(collection, workspaceRoot, deps = liveDeps) {
|
|
|
1886
1886
|
};
|
|
1887
1887
|
const map = pushableMap(schema.googleCalendar?.map ?? {});
|
|
1888
1888
|
const shadow = await loadCalendarShadow(calendarId, workspaceRoot);
|
|
1889
|
-
const records = await
|
|
1889
|
+
const records = await require_store.storeFor(collection, { workspaceRoot }).list();
|
|
1890
1890
|
const ctx = {
|
|
1891
1891
|
accessToken,
|
|
1892
1892
|
calendarId,
|
|
@@ -2005,7 +2005,7 @@ async function writeProjected(write, event, schema, existing) {
|
|
|
2005
2005
|
async function applyEvent(collection, event, workspaceRoot, hasUnsentEdit) {
|
|
2006
2006
|
const { schema } = collection;
|
|
2007
2007
|
try {
|
|
2008
|
-
const store =
|
|
2008
|
+
const store = require_store.storeFor(collection, { workspaceRoot });
|
|
2009
2009
|
if (!store.write || !store.delete) return {
|
|
2010
2010
|
kind: "unwritable",
|
|
2011
2011
|
message: `collection '${collection.slug}' is read-only`
|
|
@@ -2522,7 +2522,7 @@ function orphanedCalendarId(deleted, remaining) {
|
|
|
2522
2522
|
async function releaseOrphanedCalendarToken(deleted, workspaceRoot) {
|
|
2523
2523
|
try {
|
|
2524
2524
|
if (!deleted.googleCalendar) return null;
|
|
2525
|
-
const orphaned = orphanedCalendarId(deleted, (await
|
|
2525
|
+
const orphaned = orphanedCalendarId(deleted, (await require_store.discoverCollections({ workspaceRoot })).map((collection) => collection.schema));
|
|
2526
2526
|
if (orphaned === null) return null;
|
|
2527
2527
|
await clearCalendarSyncToken(orphaned, workspaceRoot);
|
|
2528
2528
|
await clearCalendarShadow(orphaned, workspaceRoot);
|
|
@@ -2536,7 +2536,7 @@ async function releaseOrphanedCalendarToken(deleted, workspaceRoot) {
|
|
|
2536
2536
|
}
|
|
2537
2537
|
/** Every declaring collection, grouped by the calendar it reads. */
|
|
2538
2538
|
async function declaringGroups(workspaceRoot) {
|
|
2539
|
-
return groupByCalendar((await
|
|
2539
|
+
return groupByCalendar((await require_store.discoverCollections({ workspaceRoot })).filter((collection) => collection.schema.googleCalendar));
|
|
2540
2540
|
}
|
|
2541
2541
|
/** Whether a background sync of these groups may run at all.
|
|
2542
2542
|
*
|
|
@@ -2666,7 +2666,7 @@ function googleCalendarSyncTaskDef(opts) {
|
|
|
2666
2666
|
intervalMs: opts?.intervalMs ?? DEFAULT_SYNC_INTERVAL_MS
|
|
2667
2667
|
},
|
|
2668
2668
|
missedRunPolicy: _receptron_task_scheduler.MISSED_RUN_POLICIES.runOnce,
|
|
2669
|
-
run: () => syncDueCalendarCollections(opts?.workspaceRoot ??
|
|
2669
|
+
run: () => syncDueCalendarCollections(opts?.workspaceRoot ?? require_store.getWorkspaceRoot(), scheduledIntervalMs(def)).then(() => {})
|
|
2670
2670
|
};
|
|
2671
2671
|
return def;
|
|
2672
2672
|
}
|