@mulmoclaude/core 5.12.1 → 5.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.
- package/assets/helps/presenthtml.md +24 -0
- package/dist/artifacts/paths.cjs +1 -2
- package/dist/artifacts/paths.js +1 -2
- package/dist/collection/firestore.cjs +1 -2
- package/dist/collection/firestore.js +1 -2
- package/dist/collection/index.cjs +18 -30
- package/dist/collection/index.cjs.map +1 -1
- package/dist/collection/index.js +18 -30
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/paths.cjs +1 -1
- package/dist/collection/paths.js +1 -1
- package/dist/collection/registry/index.cjs +1 -1
- package/dist/collection/registry/index.js +1 -1
- package/dist/collection/registry/server/index.cjs +17 -26
- package/dist/collection/registry/server/index.cjs.map +1 -1
- package/dist/collection/registry/server/index.js +16 -25
- package/dist/collection/registry/server/index.js.map +1 -1
- package/dist/collection/server/index.cjs +5 -5
- package/dist/collection/server/index.js +5 -5
- package/dist/collection-watchers/index.cjs +10 -14
- package/dist/collection-watchers/index.cjs.map +1 -1
- package/dist/collection-watchers/index.js +10 -14
- package/dist/collection-watchers/index.js.map +1 -1
- package/dist/{discovery-DgZRmO7F.cjs → discovery-CYIV1J5l.cjs} +25 -42
- package/dist/{discovery-DgZRmO7F.cjs.map → discovery-CYIV1J5l.cjs.map} +1 -1
- package/dist/{discovery-CbwHtcwk.js → discovery-duLlygnJ.js} +24 -41
- package/dist/{discovery-CbwHtcwk.js.map → discovery-duLlygnJ.js.map} +1 -1
- package/dist/{dist-BZ62pKuU.cjs → dist-734JaRYi.cjs} +2 -4
- package/dist/{dist-BZ62pKuU.cjs.map → dist-734JaRYi.cjs.map} +1 -1
- package/dist/{dist-MFUV9FYo.js → dist-BmO4oSQy.js} +2 -4
- package/dist/{dist-MFUV9FYo.js.map → dist-BmO4oSQy.js.map} +1 -1
- package/dist/errorMessage-D0kR547_.cjs +1 -0
- package/dist/errorMessage-TpKxrmeo.js +1 -0
- package/dist/{errors-zTAsW7dS.js → errors-0QwjDxsv.js} +3 -4
- package/dist/{errors-zTAsW7dS.js.map → errors-0QwjDxsv.js.map} +1 -1
- package/dist/{errors-B0xloJ3E.cjs → errors-B9mCEVG9.cjs} +3 -4
- package/dist/{errors-B0xloJ3E.cjs.map → errors-B9mCEVG9.cjs.map} +1 -1
- package/dist/feeds/index.cjs +2 -2
- package/dist/feeds/index.js +2 -2
- package/dist/feeds/paths.cjs +2 -3
- package/dist/feeds/paths.js +1 -2
- package/dist/feeds/server/index.cjs +23 -37
- package/dist/feeds/server/index.cjs.map +1 -1
- package/dist/feeds/server/index.js +22 -36
- package/dist/feeds/server/index.js.map +1 -1
- package/dist/file-change/index.cjs +2 -3
- package/dist/file-change/index.js +1 -2
- package/dist/files/index.cjs +159 -11
- package/dist/files/index.cjs.map +1 -1
- package/dist/files/index.d.ts +1 -0
- package/dist/files/index.js +154 -12
- package/dist/files/index.js.map +1 -1
- package/dist/files/verified.d.ts +33 -0
- package/dist/global-config/index.cjs +3 -5
- package/dist/global-config/index.cjs.map +1 -1
- package/dist/global-config/index.js +3 -5
- package/dist/global-config/index.js.map +1 -1
- package/dist/google/index.cjs +38 -67
- package/dist/google/index.cjs.map +1 -1
- package/dist/google/index.js +37 -66
- package/dist/google/index.js.map +1 -1
- package/dist/{graph-CURotEkH.cjs → graph-BvVMZfDV.cjs} +6 -11
- package/dist/{graph-CURotEkH.cjs.map → graph-BvVMZfDV.cjs.map} +1 -1
- package/dist/{graph-DBxSOx3v.js → graph-DBbzemby.js} +6 -11
- package/dist/{graph-DBxSOx3v.js.map → graph-DBbzemby.js.map} +1 -1
- package/dist/{iconGlyph-fSBp6k4J.cjs → iconGlyph-CFOiFsmq.cjs} +2 -3
- package/dist/{iconGlyph-fSBp6k4J.cjs.map → iconGlyph-CFOiFsmq.cjs.map} +1 -1
- package/dist/{iconGlyph-D8JeNg7R.js → iconGlyph-D9h__VaM.js} +2 -3
- package/dist/{iconGlyph-D8JeNg7R.js.map → iconGlyph-D9h__VaM.js.map} +1 -1
- package/dist/{ingestTypes-DS9HiR2I.cjs → ingestTypes-CLDvn7kw.cjs} +3 -4
- package/dist/{ingestTypes-DS9HiR2I.cjs.map → ingestTypes-CLDvn7kw.cjs.map} +1 -1
- package/dist/{ingestTypes-Bs31Xt5c.js → ingestTypes-DuXuSBSn.js} +3 -4
- package/dist/{ingestTypes-Bs31Xt5c.js.map → ingestTypes-DuXuSBSn.js.map} +1 -1
- package/dist/{itemId-CVrNibwT.cjs → itemId-D2XAQ8RU.cjs} +9 -17
- package/dist/{itemId-CVrNibwT.cjs.map → itemId-D2XAQ8RU.cjs.map} +1 -1
- package/dist/{itemId-C9s-Jd5s.js → itemId-D_pSpa3U.js} +9 -17
- package/dist/{itemId-C9s-Jd5s.js.map → itemId-D_pSpa3U.js.map} +1 -1
- package/dist/{listen-N_8XdKz_.cjs → listen-OmfLDX1l.cjs} +3 -4
- package/dist/{listen-N_8XdKz_.cjs.map → listen-OmfLDX1l.cjs.map} +1 -1
- package/dist/{listen-DUlzSOzX.js → listen-uiEnXcW9.js} +3 -4
- package/dist/{listen-DUlzSOzX.js.map → listen-uiEnXcW9.js.map} +1 -1
- package/dist/notifier/index.cjs +1 -1
- package/dist/notifier/index.js +1 -1
- package/dist/{notifier-CiemUClt.cjs → notifier-CRTk34EC.cjs} +6 -10
- package/dist/{notifier-CiemUClt.cjs.map → notifier-CRTk34EC.cjs.map} +1 -1
- package/dist/{notifier-dgkC-h80.js → notifier-htdf4ekH.js} +6 -10
- package/dist/{notifier-dgkC-h80.js.map → notifier-htdf4ekH.js.map} +1 -1
- package/dist/{paths-CkJxNZ7T.js → paths-BMQNHdaJ.js} +2 -3
- package/dist/{paths-CkJxNZ7T.js.map → paths-BMQNHdaJ.js.map} +1 -1
- package/dist/{paths-C8-jxR0s.cjs → paths-DUHAueEv.cjs} +2 -3
- package/dist/{paths-C8-jxR0s.cjs.map → paths-DUHAueEv.cjs.map} +1 -1
- package/dist/plugin-vue/i18n.cjs +1 -2
- package/dist/plugin-vue/i18n.js +1 -2
- package/dist/plugin-vue/index.cjs +9 -17
- package/dist/plugin-vue/index.cjs.map +1 -1
- package/dist/plugin-vue/index.js +9 -17
- package/dist/plugin-vue/index.js.map +1 -1
- package/dist/{project-C1ep9pvo.cjs → project-DDTIVEMU.cjs} +2 -3
- package/dist/{project-C1ep9pvo.cjs.map → project-DDTIVEMU.cjs.map} +1 -1
- package/dist/{project-B0j_Vf_Q.js → project-mU6-xLfy.js} +2 -3
- package/dist/{project-B0j_Vf_Q.js.map → project-mU6-xLfy.js.map} +1 -1
- package/dist/prompt-files/index.cjs +4 -6
- package/dist/prompt-files/index.cjs.map +1 -1
- package/dist/prompt-files/index.js +3 -5
- package/dist/prompt-files/index.js.map +1 -1
- package/dist/{promptSafety-DFaOnOWN.js → promptSafety-B8LECAkY.js} +14 -25
- package/dist/{promptSafety-DFaOnOWN.js.map → promptSafety-B8LECAkY.js.map} +1 -1
- package/dist/{promptSafety-yET9jLep.cjs → promptSafety-CjxafW2b.cjs} +14 -25
- package/dist/{promptSafety-yET9jLep.cjs.map → promptSafety-CjxafW2b.cjs.map} +1 -1
- package/dist/{relPath-DW8MC8VO.js → relPath-BkKmqiiF.js} +2 -3
- package/dist/{relPath-DW8MC8VO.js.map → relPath-BkKmqiiF.js.map} +1 -1
- package/dist/{relPath-CTAjGdCL.cjs → relPath-CZiP2S_a.cjs} +3 -4
- package/dist/{relPath-CTAjGdCL.cjs.map → relPath-CZiP2S_a.cjs.map} +1 -1
- package/dist/remote-host/index.cjs +1 -1
- package/dist/remote-host/index.js +1 -1
- package/dist/remote-host/server/index.cjs +14 -25
- package/dist/remote-host/server/index.cjs.map +1 -1
- package/dist/remote-host/server/index.js +14 -25
- package/dist/remote-host/server/index.js.map +1 -1
- package/dist/{remote-host-CR5W9uj4.cjs → remote-host-BW_eH-Nu.cjs} +4 -6
- package/dist/{remote-host-CR5W9uj4.cjs.map → remote-host-BW_eH-Nu.cjs.map} +1 -1
- package/dist/{remote-host-9NNAvUhU.js → remote-host-CSeDNbE6.js} +4 -6
- package/dist/{remote-host-9NNAvUhU.js.map → remote-host-CSeDNbE6.js.map} +1 -1
- package/dist/remote-view/index.cjs +3 -4
- package/dist/remote-view/index.js +3 -4
- package/dist/{rolldown-runtime-VH7oDXx4.cjs → rolldown-runtime-CmQyd0Gu.cjs} +1 -2
- package/dist/{root-BvwBUcol.cjs → root-9lRFeXbm.cjs} +10 -6
- package/dist/{root-BvwBUcol.cjs.map → root-9lRFeXbm.cjs.map} +1 -1
- package/dist/{root-BcS4-Kge.js → root-CqxPNSyK.js} +4 -6
- package/dist/{root-BcS4-Kge.js.map → root-CqxPNSyK.js.map} +1 -1
- package/dist/scheduler/index.cjs +6 -9
- package/dist/scheduler/index.cjs.map +1 -1
- package/dist/scheduler/index.js +5 -8
- package/dist/scheduler/index.js.map +1 -1
- package/dist/{server-CJek9Y3Q.cjs → server-ByKWGQn2.cjs} +25 -41
- package/dist/{server-CJek9Y3Q.cjs.map → server-ByKWGQn2.cjs.map} +1 -1
- package/dist/{server-BtbbQqBY.js → server-CA-alqqN.js} +24 -40
- package/dist/{server-BtbbQqBY.js.map → server-CA-alqqN.js.map} +1 -1
- package/dist/skill-bridge/index.cjs +3 -4
- package/dist/skill-bridge/index.js +2 -3
- package/dist/{slug-BpjumQfe.js → slug-D24AYqCZ.js} +2 -3
- package/dist/{slug-BpjumQfe.js.map → slug-D24AYqCZ.js.map} +1 -1
- package/dist/{slug-JxgB0ru9.cjs → slug-DVkuPjIv.cjs} +2 -3
- package/dist/{slug-JxgB0ru9.cjs.map → slug-DVkuPjIv.cjs.map} +1 -1
- package/dist/{templatePath-27vUZowm.cjs → templatePath-BIh7wqgS.cjs} +2 -3
- package/dist/{templatePath-27vUZowm.cjs.map → templatePath-BIh7wqgS.cjs.map} +1 -1
- package/dist/{templatePath-k_WNbL_Q.js → templatePath-CB3wtVpe.js} +2 -3
- package/dist/{templatePath-k_WNbL_Q.js.map → templatePath-CB3wtVpe.js.map} +1 -1
- package/dist/{text-CjDbP2O1.js → text-BQAuwKVj.js} +2 -3
- package/dist/{text-CjDbP2O1.js.map → text-BQAuwKVj.js.map} +1 -1
- package/dist/{text-CaAh9ZSO.cjs → text-BQiyo5R9.cjs} +2 -3
- package/dist/{text-CaAh9ZSO.cjs.map → text-BQiyo5R9.cjs.map} +1 -1
- package/dist/translation/client.cjs +1 -2
- package/dist/translation/client.js +1 -2
- package/dist/{types-BKVZrtyc.js → types-BLCZTGW2.js} +4 -7
- package/dist/{types-BKVZrtyc.js.map → types-BLCZTGW2.js.map} +1 -1
- package/dist/{types-CNqkLT4M.cjs → types-DPycxnDf.cjs} +4 -7
- package/dist/{types-CNqkLT4M.cjs.map → types-DPycxnDf.cjs.map} +1 -1
- package/dist/utils/fetch.cjs +0 -1
- package/dist/utils/fetch.js +0 -1
- package/dist/utils/index.cjs +3 -3
- package/dist/utils/index.js +3 -3
- package/dist/whisper/client.cjs +2 -4
- package/dist/whisper/client.cjs.map +1 -1
- package/dist/whisper/client.js +2 -4
- package/dist/whisper/client.js.map +1 -1
- package/dist/whisper/index.cjs +9 -15
- package/dist/whisper/index.cjs.map +1 -1
- package/dist/whisper/index.js +8 -14
- package/dist/whisper/index.js.map +1 -1
- package/dist/wiki/index.cjs +5 -7
- package/dist/wiki/index.cjs.map +1 -1
- package/dist/wiki/index.js +5 -7
- package/dist/wiki/index.js.map +1 -1
- package/dist/wiki/paths.cjs +3 -4
- package/dist/wiki/paths.js +2 -3
- package/dist/wiki/server/index.cjs +7 -11
- package/dist/wiki/server/index.cjs.map +1 -1
- package/dist/wiki/server/index.js +6 -10
- package/dist/wiki/server/index.js.map +1 -1
- package/dist/workspace-setup/index.js +4 -9
- package/dist/workspace-setup/index.js.map +1 -1
- package/dist/workspace-setup/slug.js +1 -2
- package/package.json +2 -2
- package/dist/errorMessage-OEQzRwsi.cjs +0 -1
- package/dist/errorMessage-VEiXHRnX.js +0 -1
package/dist/google/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { i as hasStringProp, t as errorMessage } from "../dist-
|
|
2
|
-
import "../errors-
|
|
3
|
-
import { t as truncate } from "../text-
|
|
4
|
-
import {
|
|
1
|
+
import { i as hasStringProp, t as errorMessage } from "../dist-BmO4oSQy.js";
|
|
2
|
+
import "../errors-0QwjDxsv.js";
|
|
3
|
+
import { t as truncate } from "../text-BQAuwKVj.js";
|
|
4
|
+
import { r as writeFileAtomic } from "../root-CqxPNSyK.js";
|
|
5
5
|
import { fetchWithTimeout } from "../utils/fetch.js";
|
|
6
|
-
import { f as parseIsoDate, p as parseIsoDateTime } from "../itemId-
|
|
7
|
-
import { t as mergeIntoExisting } from "../project-
|
|
8
|
-
import { _t as createForwardingLogger, d as storeFor, n as discoverCollections, rt as getWorkspaceRoot, vt as createHostSlot } from "../discovery-
|
|
9
|
-
import { t as mulmoConfigDir } from "../paths-
|
|
6
|
+
import { f as parseIsoDate, p as parseIsoDateTime } from "../itemId-D_pSpa3U.js";
|
|
7
|
+
import { t as mergeIntoExisting } from "../project-mU6-xLfy.js";
|
|
8
|
+
import { _t as createForwardingLogger, d as storeFor, n as discoverCollections, rt as getWorkspaceRoot, vt as createHostSlot } from "../discovery-duLlygnJ.js";
|
|
9
|
+
import { t as mulmoConfigDir } from "../paths-BMQNHdaJ.js";
|
|
10
10
|
import { promises } from "node:fs";
|
|
11
11
|
import path, { join } from "node:path";
|
|
12
12
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
@@ -15,14 +15,13 @@ import { homedir } from "node:os";
|
|
|
15
15
|
import { MISSED_RUN_POLICIES, SCHEDULE_TYPES } from "@receptron/task-scheduler";
|
|
16
16
|
import http from "node:http";
|
|
17
17
|
import { CodeChallengeMethod, OAuth2Client } from "google-auth-library";
|
|
18
|
-
|
|
18
|
+
// src/google/host.ts
|
|
19
19
|
var hostSlot = createHostSlot("@mulmoclaude/core/google: configureGoogleHost()");
|
|
20
20
|
function configureGoogleHost(binding) {
|
|
21
21
|
hostSlot.set(binding.log);
|
|
22
22
|
}
|
|
23
23
|
var log = createForwardingLogger(() => hostSlot.peek());
|
|
24
|
-
|
|
25
|
-
//#region src/google/datetime.ts
|
|
24
|
+
// src/google/datetime.ts
|
|
26
25
|
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}))$/;
|
|
27
26
|
var FRACTIONAL_SECONDS_RE$2 = /\.\d+(?=Z|[+-])/;
|
|
28
27
|
var MAX_HOUR = 23;
|
|
@@ -40,8 +39,7 @@ var isIsoDateTimeWithOffset = (value) => {
|
|
|
40
39
|
const offsetInRange = match[7] === void 0 || Number(match[7]) <= MAX_HOUR && Number(match[8]) <= MAX_MINUTE;
|
|
41
40
|
return isRealCalendarDate(year, month, day) && timeInRange && offsetInRange;
|
|
42
41
|
};
|
|
43
|
-
|
|
44
|
-
//#region src/google/deletePlan.ts
|
|
42
|
+
// src/google/deletePlan.ts
|
|
45
43
|
var ATTENDEES_REASON = "it carries attendees — deleting an invited event withdraws it from their calendars too";
|
|
46
44
|
var ALREADY_GONE_REASON = "it is no longer in Google";
|
|
47
45
|
/** The message the push reports for a refusal, with the event named. */
|
|
@@ -70,15 +68,13 @@ function planDelete(fetched) {
|
|
|
70
68
|
etag: fetched.etag
|
|
71
69
|
};
|
|
72
70
|
}
|
|
73
|
-
|
|
74
|
-
//#region src/google/util.ts
|
|
71
|
+
// src/google/util.ts
|
|
75
72
|
var ONE_SECOND_MS = 1e3;
|
|
76
73
|
var ONE_MINUTE_MS = 6e4;
|
|
77
74
|
function isRecord(value) {
|
|
78
75
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
79
76
|
}
|
|
80
|
-
|
|
81
|
-
//#region src/google/eventDerived.ts
|
|
77
|
+
// src/google/eventDerived.ts
|
|
82
78
|
var stringAt = (record, key) => typeof record[key] === "string" ? record[key] : "";
|
|
83
79
|
var recordsIn = (value) => Array.isArray(value) ? value.filter(isRecord) : [];
|
|
84
80
|
/** The signed-in user's own `responseStatus` on this event, `""` when Google
|
|
@@ -108,8 +104,7 @@ function conferenceVideoUri(conferenceData) {
|
|
|
108
104
|
const video = recordsIn(conferenceData.entryPoints).find((entry) => entry.entryPointType === VIDEO_ENTRY_POINT);
|
|
109
105
|
return video === void 0 ? "" : stringAt(video, "uri");
|
|
110
106
|
}
|
|
111
|
-
|
|
112
|
-
//#region src/google/eventSpanInput.ts
|
|
107
|
+
// src/google/eventSpanInput.ts
|
|
113
108
|
var DATE_ONLY_RE$1 = /^\d{4}-\d{2}-\d{2}$/;
|
|
114
109
|
/** Whether `value` is a bare calendar day — the all-day spelling of an event
|
|
115
110
|
* time, and the one shape `isIsoDateTimeWithOffset` is built to refuse.
|
|
@@ -206,8 +201,7 @@ function resolvePartialSpanInput(start, end) {
|
|
|
206
201
|
times: {}
|
|
207
202
|
};
|
|
208
203
|
}
|
|
209
|
-
|
|
210
|
-
//#region src/google/paths.ts
|
|
204
|
+
// src/google/paths.ts
|
|
211
205
|
/** Same directory as every other cross-app per-user file — see
|
|
212
206
|
* `../global-config/paths.ts`, which owns the spelling. */
|
|
213
207
|
function googleConfigDir(home) {
|
|
@@ -223,8 +217,7 @@ function googleTokenPath(home) {
|
|
|
223
217
|
function googleSecretsDir(home) {
|
|
224
218
|
return join(home ?? homedir(), ".secrets");
|
|
225
219
|
}
|
|
226
|
-
|
|
227
|
-
//#region src/google/clientSecret.ts
|
|
220
|
+
// src/google/clientSecret.ts
|
|
228
221
|
var isNonEmptyString = (value) => typeof value === "string" && value !== "";
|
|
229
222
|
var isInstalledClientSecret = (value) => {
|
|
230
223
|
if (!isRecord(value) || !isRecord(value.installed)) return false;
|
|
@@ -269,8 +262,7 @@ async function loadClientSecret(home) {
|
|
|
269
262
|
client_secret: parsed.installed.client_secret
|
|
270
263
|
};
|
|
271
264
|
}
|
|
272
|
-
|
|
273
|
-
//#region src/google/fsJson.ts
|
|
265
|
+
// src/google/fsJson.ts
|
|
274
266
|
var JSON_INDENT = 2;
|
|
275
267
|
async function readJsonOrNull(filePath) {
|
|
276
268
|
try {
|
|
@@ -289,8 +281,7 @@ async function writeJsonAtomicWithMode(filePath, data, mode) {
|
|
|
289
281
|
uniqueTmp: false
|
|
290
282
|
});
|
|
291
283
|
}
|
|
292
|
-
|
|
293
|
-
//#region src/google/tokenStore.ts
|
|
284
|
+
// src/google/tokenStore.ts
|
|
294
285
|
var TOKEN_FILE_MODE = 384;
|
|
295
286
|
function mergeGoogleTokens(existing, incoming) {
|
|
296
287
|
const merged = {
|
|
@@ -328,8 +319,7 @@ async function saveGoogleTokens(incoming, home) {
|
|
|
328
319
|
async function deleteGoogleTokens(home) {
|
|
329
320
|
await rm(googleTokenPath(home), { force: true });
|
|
330
321
|
}
|
|
331
|
-
|
|
332
|
-
//#region src/google/broker.ts
|
|
322
|
+
// src/google/broker.ts
|
|
333
323
|
var DEFAULT_BROKER_BASE_URL = "https://asia-northeast1-mulmoserver.cloudfunctions.net";
|
|
334
324
|
var BROKER_TIMEOUT_MS = 20 * ONE_SECOND_MS;
|
|
335
325
|
var withoutTrailingSlashes = (url) => {
|
|
@@ -435,8 +425,7 @@ async function brokerRefresh(refreshToken, baseUrl = brokerBaseUrl()) {
|
|
|
435
425
|
body: JSON.stringify({ refresh_token: refreshToken })
|
|
436
426
|
}), refreshToken);
|
|
437
427
|
}
|
|
438
|
-
|
|
439
|
-
//#region src/google/auth.ts
|
|
428
|
+
// src/google/auth.ts
|
|
440
429
|
var GOOGLE_CALENDAR_SCOPE = "https://www.googleapis.com/auth/calendar.events";
|
|
441
430
|
/** Minimal read scope for the calendar list + per-calendar colours.
|
|
442
431
|
* `calendar.events` already covers reading/writing events on any calendar, but
|
|
@@ -648,8 +637,7 @@ async function authorizeGoogle(opts = {}) {
|
|
|
648
637
|
server.close();
|
|
649
638
|
}
|
|
650
639
|
}
|
|
651
|
-
|
|
652
|
-
//#region src/google/authFlow.ts
|
|
640
|
+
// src/google/authFlow.ts
|
|
653
641
|
var createGoogleAuthFlow = (authorize) => {
|
|
654
642
|
let flowRunning = false;
|
|
655
643
|
let lastError = null;
|
|
@@ -695,8 +683,7 @@ var createGoogleAuthFlow = (authorize) => {
|
|
|
695
683
|
};
|
|
696
684
|
};
|
|
697
685
|
var googleAuthFlow = createGoogleAuthFlow(authorizeGoogle);
|
|
698
|
-
|
|
699
|
-
//#region src/google/apiClient.ts
|
|
686
|
+
// src/google/apiClient.ts
|
|
700
687
|
var GOOGLE_API_TIMEOUT_MS = 30 * ONE_SECOND_MS;
|
|
701
688
|
var ERROR_BODY_MAX_CHARS = 300;
|
|
702
689
|
var HTTP_FORBIDDEN = 403;
|
|
@@ -743,8 +730,7 @@ var itemsOf = (value) => {
|
|
|
743
730
|
const record = asRecord(value);
|
|
744
731
|
return Array.isArray(record.items) ? record.items : [];
|
|
745
732
|
};
|
|
746
|
-
|
|
747
|
-
//#region src/google/calendar.ts
|
|
733
|
+
// src/google/calendar.ts
|
|
748
734
|
var CALENDAR_BASE_URL = "https://www.googleapis.com/calendar/v3";
|
|
749
735
|
var CALENDAR_API_LABEL = "Google Calendar API";
|
|
750
736
|
var DEFAULT_CALENDAR_ID = "primary";
|
|
@@ -1042,8 +1028,7 @@ async function getCalendarColors(accessToken) {
|
|
|
1042
1028
|
calendar: toColorMap(record.calendar)
|
|
1043
1029
|
};
|
|
1044
1030
|
}
|
|
1045
|
-
|
|
1046
|
-
//#region src/google/calendarStateLock.ts
|
|
1031
|
+
// src/google/calendarStateLock.ts
|
|
1047
1032
|
var LOCK_MODE = 384;
|
|
1048
1033
|
/** How long a lock may sit untouched before another process may reclaim it.
|
|
1049
1034
|
*
|
|
@@ -1195,8 +1180,7 @@ async function acquireBefore(lockPath, holder, deadline, clock) {
|
|
|
1195
1180
|
}
|
|
1196
1181
|
/** `<state file>.lock`, so each state file is serialised on its own. */
|
|
1197
1182
|
var stateLockPath = (statePath) => `${statePath}.lock`;
|
|
1198
|
-
|
|
1199
|
-
//#region src/google/calendarSyncStore.ts
|
|
1183
|
+
// src/google/calendarSyncStore.ts
|
|
1200
1184
|
var SYNC_STATE_MODE = 384;
|
|
1201
1185
|
/** `<workspace>/data/calendar/.sync-state.json` */
|
|
1202
1186
|
function calendarSyncStatePath(workspaceRoot) {
|
|
@@ -1318,8 +1302,7 @@ async function clearCalendarLastSyncedAt(calendarId, workspaceRoot) {
|
|
|
1318
1302
|
lastSyncedAt: withoutKey(state.lastSyncedAt, dropped)
|
|
1319
1303
|
}), workspaceRoot);
|
|
1320
1304
|
}
|
|
1321
|
-
|
|
1322
|
-
//#region src/google/calendarSyncDue.ts
|
|
1305
|
+
// src/google/calendarSyncDue.ts
|
|
1323
1306
|
/** Slack between a tick and the marker it writes. Without it a lone host reads
|
|
1324
1307
|
* its OWN marker as "not due yet" — elapsed lands a hair under the interval
|
|
1325
1308
|
* every time — and syncs every other hour. */
|
|
@@ -1342,8 +1325,7 @@ function isCalendarSyncDue(lastSyncedAt, windowMs, now = Date.now()) {
|
|
|
1342
1325
|
if (elapsed < -windowMs) return true;
|
|
1343
1326
|
return elapsed >= windowMs;
|
|
1344
1327
|
}
|
|
1345
|
-
|
|
1346
|
-
//#region src/google/calendarBackfillState.ts
|
|
1328
|
+
// src/google/calendarBackfillState.ts
|
|
1347
1329
|
var BACKFILL_STATE_MODE = 384;
|
|
1348
1330
|
var BACKFILL_FILE = ".calendar-sync.json";
|
|
1349
1331
|
/** `<dataDir>/.calendar-sync.json` */
|
|
@@ -1382,8 +1364,7 @@ async function markCalendarBackfilled(dataDir, calendarId, walkedAt) {
|
|
|
1382
1364
|
});
|
|
1383
1365
|
}
|
|
1384
1366
|
}
|
|
1385
|
-
|
|
1386
|
-
//#region src/google/calendarPushState.ts
|
|
1367
|
+
// src/google/calendarPushState.ts
|
|
1387
1368
|
var PUSH_STATE_MODE = 384;
|
|
1388
1369
|
/** `<workspace>/data/calendar/.push-state.json` */
|
|
1389
1370
|
function calendarPushStatePath(workspaceRoot) {
|
|
@@ -1438,8 +1419,7 @@ async function clearCalendarShadow(calendarId, workspaceRoot) {
|
|
|
1438
1419
|
const dropped = canonicalCalendarId(calendarId);
|
|
1439
1420
|
await updateState((events) => Object.fromEntries(Object.entries(events).filter(([key]) => key !== dropped)), workspaceRoot);
|
|
1440
1421
|
}
|
|
1441
|
-
|
|
1442
|
-
//#region src/google/calendarLock.ts
|
|
1422
|
+
// src/google/calendarLock.ts
|
|
1443
1423
|
/** Serialise `run` against whatever is already running for `key`.
|
|
1444
1424
|
*
|
|
1445
1425
|
* `locks` is passed in so the queuing rule is testable without module state;
|
|
@@ -1471,8 +1451,7 @@ var calendarLocks = /* @__PURE__ */ new Map();
|
|
|
1471
1451
|
async function withCalendarLock(calendarId, run) {
|
|
1472
1452
|
return await withKeyedLock(calendarLocks, canonicalCalendarId(calendarId), run);
|
|
1473
1453
|
}
|
|
1474
|
-
|
|
1475
|
-
//#region src/google/pushDateTime.ts
|
|
1454
|
+
// src/google/pushDateTime.ts
|
|
1476
1455
|
/** RFC3339 zone designator: `Z`, `+09:00`, `-0500`. */
|
|
1477
1456
|
var ZONE_SUFFIX_RE$1 = /(?:Z|[+-]\d{2}:?\d{2})$/;
|
|
1478
1457
|
var FRACTIONAL_SECONDS_RE$1 = /\.\d+$/;
|
|
@@ -1567,8 +1546,7 @@ function toGoogleEventTime(local, previous, calendarTimeZone) {
|
|
|
1567
1546
|
timeZone: calendarTimeZone
|
|
1568
1547
|
} : { dateTime: `${dateTime}${zone}` };
|
|
1569
1548
|
}
|
|
1570
|
-
|
|
1571
|
-
//#region src/google/collectionDateTime.ts
|
|
1549
|
+
// src/google/collectionDateTime.ts
|
|
1572
1550
|
/** All-day events carry no clock; midnight is where the day view places them. */
|
|
1573
1551
|
var ALL_DAY_CLOCK = "00:00";
|
|
1574
1552
|
var DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
@@ -1587,8 +1565,7 @@ function toCollectionDateTime(value) {
|
|
|
1587
1565
|
if (!trimmed.includes("T")) return value;
|
|
1588
1566
|
return trimmed.replace(ZONE_SUFFIX_RE, "").replace(FRACTIONAL_SECONDS_RE, "");
|
|
1589
1567
|
}
|
|
1590
|
-
|
|
1591
|
-
//#region src/google/collectionProjection.ts
|
|
1568
|
+
// src/google/collectionProjection.ts
|
|
1592
1569
|
var DATETIME_FIELD_TYPE = "datetime";
|
|
1593
1570
|
/** Own-property lookup, mirroring what the record lint reads: a spec reachable
|
|
1594
1571
|
* only through the prototype chain is not a DECLARED field, so it must not
|
|
@@ -1613,8 +1590,7 @@ function toCollectionRecord(event, map, primaryKey, fields) {
|
|
|
1613
1590
|
[primaryKey]: event.id
|
|
1614
1591
|
};
|
|
1615
1592
|
}
|
|
1616
|
-
|
|
1617
|
-
//#region src/google/pushPlan.ts
|
|
1593
|
+
// src/google/pushPlan.ts
|
|
1618
1594
|
/** The event fields Google lets a caller write — a SUBSET of what the pull can
|
|
1619
1595
|
* read (`GOOGLE_CALENDAR_SOURCE_FIELDS`). A column mapped to one of the
|
|
1620
1596
|
* pull-only fields is ignored here rather than rejected: the mapping was
|
|
@@ -1762,8 +1738,7 @@ function locallyDeletedIds(shadow, presentIds) {
|
|
|
1762
1738
|
const present = new Set(presentIds);
|
|
1763
1739
|
return Object.keys(shadow).filter((eventId) => !present.has(eventId));
|
|
1764
1740
|
}
|
|
1765
|
-
|
|
1766
|
-
//#region src/google/collectionPush.ts
|
|
1741
|
+
// src/google/collectionPush.ts
|
|
1767
1742
|
/** Access roles that may write events. `reader` / `freeBusyReader` cannot, and a
|
|
1768
1743
|
* push under them fails per event with an opaque 403 — checked once up front so
|
|
1769
1744
|
* the user is told the real reason. */
|
|
@@ -2229,8 +2204,7 @@ async function pushCalendarForCollection(slug, workspaceRoot, deps = liveDeps) {
|
|
|
2229
2204
|
};
|
|
2230
2205
|
}
|
|
2231
2206
|
}
|
|
2232
|
-
|
|
2233
|
-
//#region src/google/collectionSync.ts
|
|
2207
|
+
// src/google/collectionSync.ts
|
|
2234
2208
|
var GOOGLE_CALENDAR_SYNC_TASK_ID = "system:google-calendar-sync";
|
|
2235
2209
|
var DEFAULT_SYNC_INTERVAL_MS = 36e5;
|
|
2236
2210
|
function classifyWrite(eventId, kind) {
|
|
@@ -2963,8 +2937,7 @@ function googleCalendarSyncTaskDef(opts) {
|
|
|
2963
2937
|
};
|
|
2964
2938
|
return def;
|
|
2965
2939
|
}
|
|
2966
|
-
|
|
2967
|
-
//#region src/google/tasks.ts
|
|
2940
|
+
// src/google/tasks.ts
|
|
2968
2941
|
var TASKS_BASE_URL = "https://tasks.googleapis.com/tasks/v1";
|
|
2969
2942
|
var TASKS_API_LABEL = "Google Tasks API";
|
|
2970
2943
|
var DEFAULT_TASK_LIST_ID = "@default";
|
|
@@ -3064,8 +3037,7 @@ async function uncompleteTask(accessToken, input) {
|
|
|
3064
3037
|
async function deleteTask(accessToken, input) {
|
|
3065
3038
|
await googleRequest(TASKS_API_LABEL, accessToken, tasksUrl(input.taskListId, `/${encodeURIComponent(input.taskId)}`), { method: "DELETE" });
|
|
3066
3039
|
}
|
|
3067
|
-
|
|
3068
|
-
//#region src/google/driveFile.ts
|
|
3040
|
+
// src/google/driveFile.ts
|
|
3069
3041
|
var DRIVE_FILES_URL = "https://www.googleapis.com/drive/v3/files";
|
|
3070
3042
|
var DRIVE_UPLOAD_URL = "https://www.googleapis.com/upload/drive/v3/files";
|
|
3071
3043
|
var DRIVE_API_LABEL = "Google Drive API";
|
|
@@ -3157,7 +3129,6 @@ async function readDriveFile(accessToken, input) {
|
|
|
3157
3129
|
async function deleteDriveFile(accessToken, input) {
|
|
3158
3130
|
await googleRequest(DRIVE_API_LABEL, accessToken, `${DRIVE_FILES_URL}/${encodeURIComponent(input.fileId)}`, { method: "DELETE" });
|
|
3159
3131
|
}
|
|
3160
|
-
//#endregion
|
|
3161
3132
|
export { ALL_DAY_END_HINT, CANCELLED_EVENT_STATUS, DEFAULT_LIST_MAX_RESULTS, EVENT_ABSENT_STATUSES, EVENT_TIME_HINT, GOOGLE_AUTH_CANCELLED, GOOGLE_CALENDARLIST_SCOPE, GOOGLE_CALENDAR_SCOPE, GOOGLE_CALENDAR_SYNC_TASK_ID, GOOGLE_DRIVE_FILE_SCOPE, GOOGLE_SCOPES, GOOGLE_TASKS_SCOPE, GoogleApiError, HTTP_CONFLICT, HTTP_FORBIDDEN, HTTP_PRECONDITION_FAILED, LONE_ALL_DAY_HINT, MAX_LIST_RESULTS, MIXED_SPAN_HINT, PARTIAL_CALENDAR_WINDOW, PROTECTION_UNKNOWN, PUSHABLE_SOURCE_FIELDS, allUnpushed, anySyncedCollectionSurvives, applyPlanFor, assertSafeMimeType, authorizeGoogle, baselineRecord, brokerBaseUrl, brokerExchange, brokerRefresh, brokerStart, buildEventPatch, buildMultipartBody, buildTaskPatch, bySourceField, calendarApiError, calendarBackfillPath, calendarPushStatePath, calendarSyncDueWindowMs, calendarSyncStatePath, canonicalCalendarId, canonicalTaskListId, claimCalendarSyncIfDue, classifyDelete, classifyWrite, clearCalendarLastSyncedAt, clearCalendarShadow, clearCalendarSyncToken, clientSecretPresence, collectCalendarPages, collectionsNeedingBackfill, commitLinkedTokens, completeTask, conferenceVideoUri, configureGoogleHost, conflictingFields, createCalendarEvent, createDriveFile, createGoogleAuthFlow, createTask, deleteCalendarEvent, deleteDriveFile, deleteGoogleTokens, deleteRefusalMessage, deleteTask, eventTimeHint, fieldText, findClientSecretPath, getCalendarColors, getCalendarEvent, getCalendarMeta, getGoogleAccessToken, googleApiError, googleAuthFlow, googleCalendarSyncTaskDef, googleConfigDir, googleSecretsDir, googleTokenPath, groupByCalendar, groupsNeedingBackfill, heldBack, isCalendarDateOnly, isCalendarSyncDue, isClientSettableEventId, isDeniedAccessRole, isGoogleApiError, isIsoDateTimeWithOffset, isTextMimeType, isUnpushed, legacyGoogleTokenPath, listCalendarEvents, listCalendars, listDriveFiles, listTaskLists, listTasks, liveLockClock, loadCalendarLastSyncedAt, loadCalendarShadow, loadCalendarSyncToken, loadClientSecret, loadGoogleTokens, locallyChangedFields, locallyDeletedIds, locallyEditedIds, markCalendarBackfilled, mayAdoptExisting, mergeGoogleTokens, mergeIntoExisting, mergeShadow, needsCalendarBackfill, orphanedCalendarId, pickBoundary, planDelete, planRecord, pullProtectionFor, pullableEvents, pushAndProtect, pushCalendarForCollection, pushCollectionNow, pushResultFrom, pushableMap, readDriveFile, releaseOrphanedCalendarToken, reportedAccessRole, resolveEventSpan, resolvePartialSpanInput, resolveSpanInput, resumableToken, saveCalendarShadow, saveCalendarSyncToken, saveGoogleTokens, selfResponseStatus, shadowUpdates, stateLockPath, sweepDeletes, syncCalendarEvents, syncCalendarForCollection, syncCalendarGroup, syncDueCalendarCollections, syncNewCalendarCollections, syncPageParams, toCalendarMeta, toCalendarSummary, toCollectionDateTime, toCollectionRecord, toDriveFileSummary, toEventSummary, toEventTimeInput, toGoogleEventTime, toShadowEvent, toTaskListSummary, toTaskSummary, toolCalendarSyncKey, uncompleteTask, unlinkGoogle, unpushedFor, unsentEditGuard, unsentLocalEdits, updateCalendarEvent, updateTask, waitForAuthCode, windowAdvance, withCalendarLock, withCalendarStateLock, withKeyedLock, withPartialWindowError, zoneSuffixOf };
|
|
3162
3133
|
|
|
3163
3134
|
//# sourceMappingURL=index.js.map
|