@mulmoclaude/core 5.6.0 → 5.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/assets/helps/collection-skills.md +1 -1
- package/assets/helps/error-recovery.md +25 -1
- package/assets/helps/google-calendar-collection.md +8 -3
- package/assets/helps/index.md +3 -3
- package/assets/helps/sandbox.md +1 -1
- package/dist/collection/core/calendarGrid.d.ts +24 -2
- package/dist/collection/index.cjs +5 -2
- package/dist/collection/index.js +3 -3
- package/dist/collection/registry/server/index.cjs +2 -2
- package/dist/collection/registry/server/index.js +2 -2
- package/dist/collection/server/index.cjs +3 -3
- package/dist/collection/server/index.js +3 -3
- package/dist/collection-watchers/index.cjs +4 -4
- package/dist/collection-watchers/index.js +4 -4
- package/dist/{discovery-B79IxEM6.cjs → discovery-CwBXvtyn.cjs} +2 -2
- package/dist/{discovery-B79IxEM6.cjs.map → discovery-CwBXvtyn.cjs.map} +1 -1
- package/dist/{discovery-DIGau7M8.js → discovery-XoYJI2Ot.js} +2 -2
- package/dist/{discovery-DIGau7M8.js.map → discovery-XoYJI2Ot.js.map} +1 -1
- package/dist/feeds/index.cjs +2 -2
- package/dist/feeds/index.js +2 -2
- package/dist/feeds/server/index.cjs +4 -4
- package/dist/feeds/server/index.js +4 -4
- package/dist/google/index.cjs +2 -2
- package/dist/google/index.js +2 -2
- package/dist/{ingestTypes-GkG7bJdB.js → ingestTypes-Bs31Xt5c.js} +2 -2
- package/dist/{ingestTypes-GkG7bJdB.js.map → ingestTypes-Bs31Xt5c.js.map} +1 -1
- package/dist/{ingestTypes-DsVH9BYy.cjs → ingestTypes-DS9HiR2I.cjs} +2 -2
- package/dist/{ingestTypes-DsVH9BYy.cjs.map → ingestTypes-DS9HiR2I.cjs.map} +1 -1
- package/dist/{itemId-4P9S_ehz.js → itemId-C9s-Jd5s.js} +58 -23
- package/dist/{itemId-4P9S_ehz.js.map → itemId-C9s-Jd5s.js.map} +1 -1
- package/dist/{itemId-CGT2J7YK.cjs → itemId-CVrNibwT.cjs} +75 -22
- package/dist/{itemId-CGT2J7YK.cjs.map → itemId-CVrNibwT.cjs.map} +1 -1
- package/dist/{promptSafety-BpBTh5xO.js → promptSafety-B5uGroik.js} +2 -2
- package/dist/{promptSafety-BpBTh5xO.js.map → promptSafety-B5uGroik.js.map} +1 -1
- package/dist/{promptSafety-caJWd1ZQ.cjs → promptSafety-BGV1wrE6.cjs} +2 -2
- package/dist/{promptSafety-caJWd1ZQ.cjs.map → promptSafety-BGV1wrE6.cjs.map} +1 -1
- package/dist/{server--34TYvGP.js → server-CM5XNicg.js} +4 -4
- package/dist/{server--34TYvGP.js.map → server-CM5XNicg.js.map} +1 -1
- package/dist/{server-DZdM2cLD.cjs → server-ObUrsDs2.cjs} +4 -4
- package/dist/{server-DZdM2cLD.cjs.map → server-ObUrsDs2.cjs.map} +1 -1
- package/package.json +1 -1
package/dist/feeds/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_itemId = require("../itemId-
|
|
3
|
-
const require_ingestTypes = require("../ingestTypes-
|
|
2
|
+
const require_itemId = require("../itemId-CVrNibwT.cjs");
|
|
3
|
+
const require_ingestTypes = require("../ingestTypes-DS9HiR2I.cjs");
|
|
4
4
|
exports.AGENT_INGEST_KIND = require_ingestTypes.AGENT_INGEST_KIND;
|
|
5
5
|
exports.DEFAULT_FEED_MAX_ITEMS = require_ingestTypes.DEFAULT_FEED_MAX_ITEMS;
|
|
6
6
|
exports.FEED_SCHEDULES = require_itemId.FEED_SCHEDULES;
|
package/dist/feeds/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as DEFAULT_FEED_MAX_ITEMS, r as isFeedSchedule, t as AGENT_INGEST_KIND } from "../ingestTypes-
|
|
1
|
+
import { J as INGEST_KINDS, q as FEED_SCHEDULES } from "../itemId-C9s-Jd5s.js";
|
|
2
|
+
import { n as DEFAULT_FEED_MAX_ITEMS, r as isFeedSchedule, t as AGENT_INGEST_KIND } from "../ingestTypes-Bs31Xt5c.js";
|
|
3
3
|
export { AGENT_INGEST_KIND, DEFAULT_FEED_MAX_ITEMS, FEED_SCHEDULES, INGEST_KINDS, isFeedSchedule };
|
|
@@ -2,12 +2,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_rolldown_runtime = require("../../rolldown-runtime-VH7oDXx4.cjs");
|
|
3
3
|
const require_dist = require("../../dist-Gj7ygaW2.cjs");
|
|
4
4
|
const require_root = require("../../root-BvwBUcol.cjs");
|
|
5
|
-
const require_itemId = require("../../itemId-
|
|
5
|
+
const require_itemId = require("../../itemId-CVrNibwT.cjs");
|
|
6
6
|
const require_project = require("../../project-C1ep9pvo.cjs");
|
|
7
|
-
const require_discovery = require("../../discovery-
|
|
8
|
-
const require_server = require("../../server-
|
|
7
|
+
const require_discovery = require("../../discovery-CwBXvtyn.cjs");
|
|
8
|
+
const require_server = require("../../server-ObUrsDs2.cjs");
|
|
9
9
|
const require_feeds_paths = require("../paths.cjs");
|
|
10
|
-
const require_ingestTypes = require("../../ingestTypes-
|
|
10
|
+
const require_ingestTypes = require("../../ingestTypes-DS9HiR2I.cjs");
|
|
11
11
|
const require_notifier = require("../../notifier-B65Mvngb.cjs");
|
|
12
12
|
let node_path = require("node:path");
|
|
13
13
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a as isErrorWithCode, l as isUnknownArray, s as isRecord$1 } from "../../dist-BzoA9pDR.js";
|
|
2
2
|
import { t as canonicalRoot } from "../../root-BcS4-Kge.js";
|
|
3
|
-
import {
|
|
3
|
+
import { J as INGEST_KINDS, q as FEED_SCHEDULES } from "../../itemId-C9s-Jd5s.js";
|
|
4
4
|
import { t as mergeIntoExisting } from "../../project-B0j_Vf_Q.js";
|
|
5
|
-
import { W as resolveDataDir, _t as createForwardingLogger, d as storeFor, k as listItems, n as discoverCollections, q as safeSlugName, vt as createHostSlot } from "../../discovery-
|
|
6
|
-
import { F as buildCollectionActionSeedPrompt, I as promptPathsFor, z as readSkillTemplate } from "../../server
|
|
5
|
+
import { W as resolveDataDir, _t as createForwardingLogger, d as storeFor, k as listItems, n as discoverCollections, q as safeSlugName, vt as createHostSlot } from "../../discovery-XoYJI2Ot.js";
|
|
6
|
+
import { F as buildCollectionActionSeedPrompt, I as promptPathsFor, z as readSkillTemplate } from "../../server-CM5XNicg.js";
|
|
7
7
|
import { FEEDS_DIR, feedDir, feedStatePath, feedsRoot, ingestStateDir, ingestStatePath } from "../paths.js";
|
|
8
|
-
import { n as DEFAULT_FEED_MAX_ITEMS, r as isFeedSchedule, t as AGENT_INGEST_KIND } from "../../ingestTypes-
|
|
8
|
+
import { n as DEFAULT_FEED_MAX_ITEMS, r as isFeedSchedule, t as AGENT_INGEST_KIND } from "../../ingestTypes-Bs31Xt5c.js";
|
|
9
9
|
import { d as publish, n as clear } from "../../notifier-vAp5t6wL.js";
|
|
10
10
|
import path from "node:path";
|
|
11
11
|
import { createHash } from "node:crypto";
|
package/dist/google/index.cjs
CHANGED
|
@@ -5,9 +5,9 @@ require("../errors-CdXsfFCF.cjs");
|
|
|
5
5
|
const require_text = require("../text-CaAh9ZSO.cjs");
|
|
6
6
|
const require_root = require("../root-BvwBUcol.cjs");
|
|
7
7
|
const require_utils_fetch = require("../utils/fetch.cjs");
|
|
8
|
-
const require_itemId = require("../itemId-
|
|
8
|
+
const require_itemId = require("../itemId-CVrNibwT.cjs");
|
|
9
9
|
const require_project = require("../project-C1ep9pvo.cjs");
|
|
10
|
-
const require_discovery = require("../discovery-
|
|
10
|
+
const require_discovery = require("../discovery-CwBXvtyn.cjs");
|
|
11
11
|
const require_paths = require("../paths-C8-jxR0s.cjs");
|
|
12
12
|
let node_fs = require("node:fs");
|
|
13
13
|
let node_path = require("node:path");
|
package/dist/google/index.js
CHANGED
|
@@ -3,9 +3,9 @@ import "../errors-C7TI_t_4.js";
|
|
|
3
3
|
import { t as truncate } from "../text-CjDbP2O1.js";
|
|
4
4
|
import { n as writeFileAtomic } from "../root-BcS4-Kge.js";
|
|
5
5
|
import { fetchWithTimeout } from "../utils/fetch.js";
|
|
6
|
-
import {
|
|
6
|
+
import { f as parseIsoDate, p as parseIsoDateTime } from "../itemId-C9s-Jd5s.js";
|
|
7
7
|
import { t as mergeIntoExisting } from "../project-B0j_Vf_Q.js";
|
|
8
|
-
import { _t as createForwardingLogger, d as storeFor, n as discoverCollections, rt as getWorkspaceRoot, vt as createHostSlot } from "../discovery-
|
|
8
|
+
import { _t as createForwardingLogger, d as storeFor, n as discoverCollections, rt as getWorkspaceRoot, vt as createHostSlot } from "../discovery-XoYJI2Ot.js";
|
|
9
9
|
import { t as mulmoConfigDir } from "../paths-CkJxNZ7T.js";
|
|
10
10
|
import { promises } from "node:fs";
|
|
11
11
|
import path, { join } from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { q as FEED_SCHEDULES } from "./itemId-C9s-Jd5s.js";
|
|
2
2
|
import "./collection/index.js";
|
|
3
3
|
//#region src/feeds/ingestTypes.ts
|
|
4
4
|
var AGENT_INGEST_KIND = "agent";
|
|
@@ -12,4 +12,4 @@ var DEFAULT_FEED_MAX_ITEMS = 100;
|
|
|
12
12
|
//#endregion
|
|
13
13
|
export { DEFAULT_FEED_MAX_ITEMS as n, isFeedSchedule as r, AGENT_INGEST_KIND as t };
|
|
14
14
|
|
|
15
|
-
//# sourceMappingURL=ingestTypes-
|
|
15
|
+
//# sourceMappingURL=ingestTypes-Bs31Xt5c.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestTypes-
|
|
1
|
+
{"version":3,"file":"ingestTypes-Bs31Xt5c.js","names":[],"sources":["../src/feeds/ingestTypes.ts"],"sourcesContent":["// Declarative retrieval config for the \"Feeds\" mechanism. A Feed is a\n// CollectionSchema plus this `ingest` block, registered as data (NOT as\n// a skill) under `<workspace>/feeds/<slug>/schema.json`. The host's\n// retrieval engine reads it to periodically refill the collection's\n// records via the shared collections io layer.\n//\n// The ingest vocab (INGEST_KINDS / FEED_SCHEDULES + their literal-union types)\n// lives in the sibling `../collection` subpath alongside the schema contract, so\n// the package's schema validator can enforce it. Re-exported here so the feeds\n// engine's existing importers resolve them unchanged.\nimport { INGEST_KINDS, FEED_SCHEDULES, type IngestKind, type FeedSchedule } from \"../collection/index.js\";\n// Type-only: keeps zod out of this module's runtime graph (the feeds engine\n// imports it browser-free through `../collection`'s type surface).\nimport type { z } from \"zod\";\nimport type { AgentIngestZ, DeclarativeIngestZ } from \"../collection/core/schemaZ\";\n//\n// Two flavours: the declarative kinds (`rss`/`atom`/`http-json`) fetch-and-map,\n// and `agent` dispatches a hidden worker. The `code` kind (LLM-generated\n// deterministic transform) is still reserved for a future retriever.\n\n// The agent ingest kind. Defined HERE (not imported from `../collection`) on\n// purpose: the engine only needs the literal to branch, and re-importing it as a\n// VALUE keeps this module free of a value dependency on the collection vocab.\n// Core owns its own copy for the schema validator; this matches the same literal.\nexport const AGENT_INGEST_KIND = \"agent\" as const;\nexport type AgentIngestKind = typeof AGENT_INGEST_KIND;\n\nexport { INGEST_KINDS, FEED_SCHEDULES, type IngestKind, type FeedSchedule };\n\nconst FEED_SCHEDULE_SET: ReadonlySet<string> = new Set(FEED_SCHEDULES);\n\nexport function isFeedSchedule(value: unknown): value is FeedSchedule {\n return typeof value === \"string\" && FEED_SCHEDULE_SET.has(value);\n}\n\n/** Default cap on stored records per feed when `ingest.maxItems` is\n * omitted. Keeps high-volume feeds (news / podcasts) bounded. */\nexport const DEFAULT_FEED_MAX_ITEMS = 100;\n\n/** Declarative field map: target collection field name → source path\n * into the raw item (dot/bracket path, e.g. `\"title\"` or\n * `\"data.name\"`). */\nexport type IngestFieldMap = Record<string, string>;\n\n/** Declarative retrieval (`rss`/`atom`/`http-json`): the host fetches `url`\n * and projects each item through `map` (target field → source path; a\n * `http-json` feed may add `itemsAt`, a dot/bracket path to the items\n * array; `idFrom` derives the primaryKey; `maxItems` caps stored records,\n * default {@link DEFAULT_FEED_MAX_ITEMS}, `0` = keep everything). The\n * canonical loose contract stays the minimal `CollectionIngest`; this\n * feeds subtype is derived from the zod source of truth\n * (`collection/core/schemaZ` `DeclarativeIngestZ`), so the engine and the\n * schema validator can never drift. */\nexport type DeclarativeIngestSpec = z.infer<typeof DeclarativeIngestZ>;\n\n/** Agent-performed retrieval (`kind: \"agent\"`). No `url`/`map`: the host seeds\n * a hidden background worker (origin `system`) in `role` with `template` + a\n * summary of every record, and the worker edits the records itself via the\n * collections io layer. Valid on any collection (primarily skill-backed).\n * Derived from `AgentIngestZ` in `collection/core/schemaZ`. */\nexport type AgentIngestSpec = z.infer<typeof AgentIngestZ>;\n\n/** The `ingest` block carried on a `CollectionSchema`, discriminated on `kind`. */\nexport type IngestSpec = DeclarativeIngestSpec | AgentIngestSpec;\n"],"mappings":";;;AAwBA,IAAa,oBAAoB;AAKjC,IAAM,oBAAyC,IAAI,IAAI,cAAc;AAErE,SAAgB,eAAe,OAAuC;CACpE,OAAO,OAAO,UAAU,YAAY,kBAAkB,IAAI,KAAK;AACjE;;;AAIA,IAAa,yBAAyB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_itemId = require("./itemId-
|
|
1
|
+
const require_itemId = require("./itemId-CVrNibwT.cjs");
|
|
2
2
|
require("./collection/index.cjs");
|
|
3
3
|
//#region src/feeds/ingestTypes.ts
|
|
4
4
|
var AGENT_INGEST_KIND = "agent";
|
|
@@ -29,4 +29,4 @@ Object.defineProperty(exports, "isFeedSchedule", {
|
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
//# sourceMappingURL=ingestTypes-
|
|
32
|
+
//# sourceMappingURL=ingestTypes-DS9HiR2I.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingestTypes-
|
|
1
|
+
{"version":3,"file":"ingestTypes-DS9HiR2I.cjs","names":[],"sources":["../src/feeds/ingestTypes.ts"],"sourcesContent":["// Declarative retrieval config for the \"Feeds\" mechanism. A Feed is a\n// CollectionSchema plus this `ingest` block, registered as data (NOT as\n// a skill) under `<workspace>/feeds/<slug>/schema.json`. The host's\n// retrieval engine reads it to periodically refill the collection's\n// records via the shared collections io layer.\n//\n// The ingest vocab (INGEST_KINDS / FEED_SCHEDULES + their literal-union types)\n// lives in the sibling `../collection` subpath alongside the schema contract, so\n// the package's schema validator can enforce it. Re-exported here so the feeds\n// engine's existing importers resolve them unchanged.\nimport { INGEST_KINDS, FEED_SCHEDULES, type IngestKind, type FeedSchedule } from \"../collection/index.js\";\n// Type-only: keeps zod out of this module's runtime graph (the feeds engine\n// imports it browser-free through `../collection`'s type surface).\nimport type { z } from \"zod\";\nimport type { AgentIngestZ, DeclarativeIngestZ } from \"../collection/core/schemaZ\";\n//\n// Two flavours: the declarative kinds (`rss`/`atom`/`http-json`) fetch-and-map,\n// and `agent` dispatches a hidden worker. The `code` kind (LLM-generated\n// deterministic transform) is still reserved for a future retriever.\n\n// The agent ingest kind. Defined HERE (not imported from `../collection`) on\n// purpose: the engine only needs the literal to branch, and re-importing it as a\n// VALUE keeps this module free of a value dependency on the collection vocab.\n// Core owns its own copy for the schema validator; this matches the same literal.\nexport const AGENT_INGEST_KIND = \"agent\" as const;\nexport type AgentIngestKind = typeof AGENT_INGEST_KIND;\n\nexport { INGEST_KINDS, FEED_SCHEDULES, type IngestKind, type FeedSchedule };\n\nconst FEED_SCHEDULE_SET: ReadonlySet<string> = new Set(FEED_SCHEDULES);\n\nexport function isFeedSchedule(value: unknown): value is FeedSchedule {\n return typeof value === \"string\" && FEED_SCHEDULE_SET.has(value);\n}\n\n/** Default cap on stored records per feed when `ingest.maxItems` is\n * omitted. Keeps high-volume feeds (news / podcasts) bounded. */\nexport const DEFAULT_FEED_MAX_ITEMS = 100;\n\n/** Declarative field map: target collection field name → source path\n * into the raw item (dot/bracket path, e.g. `\"title\"` or\n * `\"data.name\"`). */\nexport type IngestFieldMap = Record<string, string>;\n\n/** Declarative retrieval (`rss`/`atom`/`http-json`): the host fetches `url`\n * and projects each item through `map` (target field → source path; a\n * `http-json` feed may add `itemsAt`, a dot/bracket path to the items\n * array; `idFrom` derives the primaryKey; `maxItems` caps stored records,\n * default {@link DEFAULT_FEED_MAX_ITEMS}, `0` = keep everything). The\n * canonical loose contract stays the minimal `CollectionIngest`; this\n * feeds subtype is derived from the zod source of truth\n * (`collection/core/schemaZ` `DeclarativeIngestZ`), so the engine and the\n * schema validator can never drift. */\nexport type DeclarativeIngestSpec = z.infer<typeof DeclarativeIngestZ>;\n\n/** Agent-performed retrieval (`kind: \"agent\"`). No `url`/`map`: the host seeds\n * a hidden background worker (origin `system`) in `role` with `template` + a\n * summary of every record, and the worker edits the records itself via the\n * collections io layer. Valid on any collection (primarily skill-backed).\n * Derived from `AgentIngestZ` in `collection/core/schemaZ`. */\nexport type AgentIngestSpec = z.infer<typeof AgentIngestZ>;\n\n/** The `ingest` block carried on a `CollectionSchema`, discriminated on `kind`. */\nexport type IngestSpec = DeclarativeIngestSpec | AgentIngestSpec;\n"],"mappings":";;;AAwBA,IAAa,oBAAoB;AAKjC,IAAM,oBAAyC,IAAI,IAAI,eAAA,cAAc;AAErE,SAAgB,eAAe,OAAuC;CACpE,OAAO,OAAO,UAAU,YAAY,kBAAkB,IAAI,KAAK;AACjE;;;AAIA,IAAa,yBAAyB"}
|
|
@@ -651,41 +651,76 @@ function buildMonthGrid(year, month, weekStartsOn = 0) {
|
|
|
651
651
|
* 1. the clock on a `datetime` anchor/end value, else
|
|
652
652
|
* 2. `timeField` — a separate free-form time-string column (e.g. "14:00-17:00").
|
|
653
653
|
* A record with no resolvable clock has `startMin === endMin === null`. */
|
|
654
|
-
function recordSpan(item, anchorField, endField, timeField) {
|
|
654
|
+
function recordSpan(item, anchorField, endField, timeField, options = {}) {
|
|
655
|
+
const dated = dateSpan(item, anchorField, endField);
|
|
656
|
+
if (!dated) return null;
|
|
657
|
+
return withTimeFieldFallback(options.endExclusive && endField !== void 0 ? withExclusiveEnd(dated, item[endField]) : dated, timeField ? item[timeField] : void 0);
|
|
658
|
+
}
|
|
659
|
+
/** The span options a collection's calendar uses for `endField`. Only a
|
|
660
|
+
* Google Calendar mirror reads its end as exclusive — the field its sync maps
|
|
661
|
+
* to `end` — because a plain collection may mean its end date inclusively. */
|
|
662
|
+
function spanOptionsFor(schema, endField) {
|
|
663
|
+
return { endExclusive: (endField === void 0 ? void 0 : schema.googleCalendar?.map[endField]) === "end" };
|
|
664
|
+
}
|
|
665
|
+
/** `…T00:00` or `…T00:00:00` — midnight to the second. `timeOf` keeps minutes
|
|
666
|
+
* only, so `…T00:00:30` would otherwise read as midnight too. */
|
|
667
|
+
var MIDNIGHT_CLOCK_RE = /T00:00(?::00)?$/;
|
|
668
|
+
/** Whether an end value names the very start of its day: a bare date, or a
|
|
669
|
+
* datetime at exactly `00:00`. */
|
|
670
|
+
function endsAtDayBoundary(endRaw) {
|
|
671
|
+
if (parseIsoDate(endRaw) !== null) return true;
|
|
672
|
+
return typeof endRaw === "string" && parseIsoDateTime(endRaw) !== null && MIDNIGHT_CLOCK_RE.test(endRaw.trim());
|
|
673
|
+
}
|
|
674
|
+
/** An exclusive end that falls at a day boundary on a later day does not
|
|
675
|
+
* occupy that day, so the span stops on the day before. An end with any other
|
|
676
|
+
* clock does occupy its day and is left alone. `endRaw` is the end field's
|
|
677
|
+
* own value — the span may already carry a clock from elsewhere. */
|
|
678
|
+
function withExclusiveEnd(span, endRaw) {
|
|
679
|
+
if (!endsAtDayBoundary(endRaw) || compareYmd(span.end, span.start) <= 0) return span;
|
|
680
|
+
const end = utcMsToYmd(ymdToUtcMs(span.end) - MS_PER_DAY);
|
|
681
|
+
const clocked = span.endMin === 0 || span.startMin !== null;
|
|
682
|
+
return {
|
|
683
|
+
...span,
|
|
684
|
+
end,
|
|
685
|
+
endMin: clocked ? MINUTES_PER_DAY : null
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
/** The span the date fields alone describe: an end that is missing, invalid,
|
|
689
|
+
* or earlier than the start collapses to the start day. */
|
|
690
|
+
function dateSpan(item, anchorField, endField) {
|
|
655
691
|
const startRaw = item[anchorField];
|
|
656
692
|
const start = dateOf(startRaw);
|
|
657
693
|
if (!start) return null;
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
if (endField) {
|
|
662
|
-
const endRaw = item[endField];
|
|
663
|
-
const parsedEnd = dateOf(endRaw);
|
|
664
|
-
if (parsedEnd && compareYmd(parsedEnd, start) >= 0) {
|
|
665
|
-
end = parsedEnd;
|
|
666
|
-
endMin = timeOf(endRaw);
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
if (timeField && startMin === null && endMin === null) {
|
|
670
|
-
const range = parseTimeRange(item[timeField]);
|
|
671
|
-
if (range) ({startMin, endMin} = range);
|
|
672
|
-
}
|
|
694
|
+
const endRaw = endField ? item[endField] : void 0;
|
|
695
|
+
const parsedEnd = dateOf(endRaw);
|
|
696
|
+
const usableEnd = parsedEnd !== null && compareYmd(parsedEnd, start) >= 0 ? parsedEnd : null;
|
|
673
697
|
return {
|
|
674
698
|
item,
|
|
675
699
|
start,
|
|
676
|
-
end,
|
|
677
|
-
startMin,
|
|
678
|
-
endMin
|
|
700
|
+
end: usableEnd ?? start,
|
|
701
|
+
startMin: timeOf(startRaw),
|
|
702
|
+
endMin: usableEnd ? timeOf(endRaw) : null
|
|
679
703
|
};
|
|
680
704
|
}
|
|
705
|
+
/** Fall back to a separate time-string field only when the date fields
|
|
706
|
+
* carried no clock (the date-only anchor + `time` column shape). */
|
|
707
|
+
function withTimeFieldFallback(span, timeValue) {
|
|
708
|
+
if (span.startMin !== null || span.endMin !== null) return span;
|
|
709
|
+
const range = parseTimeRange(timeValue);
|
|
710
|
+
return range ? {
|
|
711
|
+
...span,
|
|
712
|
+
startMin: range.startMin,
|
|
713
|
+
endMin: range.endMin
|
|
714
|
+
} : span;
|
|
715
|
+
}
|
|
681
716
|
/** Split records into those that land on the calendar (with their spans)
|
|
682
717
|
* and those with no usable anchor date (the "no date" tray). Spans are
|
|
683
718
|
* sorted by start day so same-day stacking is stable across renders. */
|
|
684
|
-
function bucketRecords(items, anchorField, endField, timeField) {
|
|
719
|
+
function bucketRecords(items, anchorField, endField, timeField, options = {}) {
|
|
685
720
|
const spans = [];
|
|
686
721
|
const noDate = [];
|
|
687
722
|
for (const item of items) {
|
|
688
|
-
const span = recordSpan(item, anchorField, endField, timeField);
|
|
723
|
+
const span = recordSpan(item, anchorField, endField, timeField, options);
|
|
689
724
|
if (span) spans.push(span);
|
|
690
725
|
else noDate.push(item);
|
|
691
726
|
}
|
|
@@ -832,6 +867,6 @@ function newItemId() {
|
|
|
832
867
|
* reachable under an old name would keep shipping it. */
|
|
833
868
|
var shortHexId = newItemId;
|
|
834
869
|
//#endregion
|
|
835
|
-
export {
|
|
870
|
+
export { fieldText as $, collectionKeyId as A, SAFE_SLUG_PATTERN as B, decodeRecordTimes as C, isCanonicalServerTime as D, encodeServerTime as E, localCollectionKeyOf as F, AGENT_INGEST_KIND as G, isSafeRecordId as H, parseCollectionKeyId as I, INGEST_KINDS as J, COMPUTED_TYPES as K, sameCollectionKey as L, isLocalCollectionKey as M, isSharedCollectionKey as N, serverTimeMillis as O, isValidCollectionName as P, storageKindFor as Q, sharedCollectionKey as R, isAccentColor as S, encodeRecordTimes as T, isSafeSlug as U, generateUniqueId as V, nextUniqueItemId as W, isFieldDrivenEvery as X, embedTargetId as Y, isReadOnlySchema as Z, spanOptionsFor as _, bucketRecords as a, ACCENT_COLORS as b, dateOf as c, monthAnchorDate as d, fieldTextOrNull as et, parseIsoDate as f, spanCoversDay as g, recordSpan as h, assignLanes as i, collectionKeyName as j, serverTimeOf as k, daySlice as l, parseTimeRange as m, shortHexId as n, buildMonthGrid as o, parseIsoDateTime as p, FEED_SCHEDULES as q, MINUTES_PER_DAY as r, compareYmd as s, newItemId as t, endsAtDayBoundary as u, withExclusiveEnd as v, decodeServerTime as w, accentChipClasses as x, ymdKey as y, SAFE_RECORD_ID_PATTERN as z };
|
|
836
871
|
|
|
837
|
-
//# sourceMappingURL=itemId-
|
|
872
|
+
//# sourceMappingURL=itemId-C9s-Jd5s.js.map
|