@bitcobblers/wod-wiki-engine 0.63.2271 → 0.63.2273

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/agent.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { buildQueryServiceStoresFromStorage, extractNoteIdentity, extractTypedTags, noteHasRecordedSessionsInTx, snapshotNoteRevisionIfHasSessionsInTx, makeNotebookLinkId, resolveScopedPropertyCatalog, effortToMarkdown, equipmentToMarkdown, saveScopedPropertyOverride, listFeedSubscriptionsHeadless, seedMetaKey, subscribeFeedSourceHeadless, unsubscribeFeedSourceHeadless, deleteFeedSourceHeadless, checkUnpublishedFeedChanges, MemoryFeedTree, publishFeedFromStorage, ingestPortableFilesIntoStorage, exportPortableFilesFromStorage, getJournalDayOverlay, readFrontmatterMeta, createUserNotebookLanding, setNotebookPublic, promoteNoteToNotebooks, removeNoteFromNotebook, deleteUserNotebook, getNoteNotebooks, resolveUpstreamProvenance, getNotePublicationSummary, listScheduleItemsForNote, listNoteRevisions, composeNoteMarkdown, buildNoteProvenance, listScheduleItemsByDateRange, scheduleNoteOnDate, batchScheduleNotes, updateScheduleItem, removeScheduleItem, buildStatementTree, prepareJournalSessionRun, localCivilDateKey, setSessionPublic, attributeSession } from './chunk-F3M5TAUJ.mjs';
1
+ import { buildQueryServiceStoresFromStorage, extractNoteIdentity, extractTypedTags, noteHasRecordedSessionsInTx, snapshotNoteRevisionIfHasSessionsInTx, makeNotebookLinkId, resolveScopedPropertyCatalog, effortToMarkdown, equipmentToMarkdown, saveScopedPropertyOverride, listFeedSubscriptionsHeadless, seedMetaKey, subscribeFeedSourceHeadless, unsubscribeFeedSourceHeadless, deleteFeedSourceHeadless, checkUnpublishedFeedChanges, MemoryFeedTree, publishFeedFromStorage, ingestPortableFilesIntoStorage, exportPortableFilesFromStorage, getJournalDayOverlay, readFrontmatterMeta, createUserNotebookLanding, setNotebookPublic, promoteNoteToNotebooks, removeNoteFromNotebook, deleteUserNotebook, getNoteNotebooks, resolveUpstreamProvenance, getNotePublicationSummary, listScheduleItemsForNote, listNoteRevisions, composeNoteMarkdown, buildNoteProvenance, listScheduleItemsByDateRange, scheduleNoteOnDate, batchScheduleNotes, updateScheduleItem, removeScheduleItem, buildStatementTree, prepareJournalSessionRun, localCivilDateKey, setSessionPublic, attributeSession } from './chunk-H2I2BWPR.mjs';
2
2
  import { BUILTIN_NOTEBOOKS, parseDocumentSections, KNOWN_SECTION_WIDGETS, isNoteEditable, reconcileNoteBlocks, validateNoteBlocks, toNotebookId, blockContentId, MetricType, orderPlacements, countNotesByNotebook, isSystemReadOnlyNotebook, isNotebookLanding, notebookSlugFromId, isNonPublishableNotebook } from '@bitcobblers/wod-wiki-core';
3
3
  import { bundledEfforts, createReferenceIndex, parseScript, extractStatementRefs, createParser, findUnresolvedChoices, createMockClock, RuntimeStack, EventBus, frozenNow, ScriptRuntime, createCompiler, createAnalyticsEngineForBlock, StartSessionAction, NextEvent, toStoredOutputStatement } from '@bitcobblers/wod-wiki-lang';
4
4
  import { rowsEqual, userDeletedSeedKey } from '@bitcobblers/wod-wiki-storage';
@@ -858,13 +858,13 @@ function csvToTelemetryBundle(csv) {
858
858
  }
859
859
 
860
860
  // src/version.ts
861
- var VERSION = "0.63.2271";
862
- var GIT_SHA = "b3b70b1";
863
- var BUILD_TIME = "2026-11-27T02:37:15.802Z";
861
+ var VERSION = "0.63.2273";
862
+ var GIT_SHA = "050c924";
863
+ var BUILD_TIME = "2026-11-27T18:53:01.259Z";
864
864
  var SEMVER = {
865
- version: "0.63.2271",
866
- gitSha: "b3b70b1",
867
- buildTime: "2026-11-27T02:37:15.802Z"
865
+ version: "0.63.2273",
866
+ gitSha: "050c924",
867
+ buildTime: "2026-11-27T18:53:01.259Z"
868
868
  };
869
869
  var SEED_SCHEMA = 9;
870
870
  var SEED_REGISTERED_WIDGETS = KNOWN_SECTION_WIDGETS;
@@ -2175,12 +2175,33 @@ function buildQueryServiceStoresFromStorage(storage, options = {}) {
2175
2175
  const rawEventStore = {
2176
2176
  getEventsByTimeRange: async (start, end) => storage.readonly("events").getAllFromIndex("by-timestamp", asRange(start, end)),
2177
2177
  getEventsByMetricDates: async (dates) => {
2178
+ if (dates.length === 0) return [];
2178
2179
  const store = storage.readonly("events");
2179
2180
  const byId = /* @__PURE__ */ new Map();
2180
- for (const date of dates) {
2181
- for (const row of await store.getAllFromIndex("by-metric-date", date)) {
2181
+ if (dates.length === 1) {
2182
+ for (const row of await store.getAllFromIndex("by-metric-date", dates[0])) {
2182
2183
  byId.set(row.id, row);
2183
2184
  }
2185
+ return Array.from(byId.values());
2186
+ }
2187
+ let minDate = dates[0];
2188
+ let maxDate = dates[0];
2189
+ const wanted = /* @__PURE__ */ new Set();
2190
+ for (const date of dates) {
2191
+ wanted.add(date);
2192
+ if (date < minDate) minDate = date;
2193
+ if (date > maxDate) maxDate = date;
2194
+ }
2195
+ const rows = await store.getAllFromIndex(
2196
+ "by-metric-date",
2197
+ asRange(minDate, maxDate)
2198
+ );
2199
+ for (const row of rows) {
2200
+ if (byId.has(row.id)) continue;
2201
+ if (Array.isArray(row.metricDateKeys) && row.metricDateKeys.length > 0) {
2202
+ if (!row.metricDateKeys.some((k) => wanted.has(k))) continue;
2203
+ }
2204
+ byId.set(row.id, row);
2184
2205
  }
2185
2206
  return Array.from(byId.values());
2186
2207
  },
@@ -6775,6 +6796,20 @@ async function getJournalDayOverlay(storage, rawDate) {
6775
6796
  };
6776
6797
  }
6777
6798
  async function migrateDatedPageNotesToSchedule(storage) {
6799
+ const hasDatedPageNotes = await storage.transaction(["page", "page_notes"], "readonly", async (tx) => {
6800
+ const [pages, pageNotes] = await Promise.all([
6801
+ tx.readonly("page").getAll(),
6802
+ tx.readonly("page_notes").getAll()
6803
+ ]);
6804
+ if (pageNotes.length === 0) return false;
6805
+ const datedPageIds = /* @__PURE__ */ new Set();
6806
+ for (const p of pages) {
6807
+ if (p.date) datedPageIds.add(p.id);
6808
+ }
6809
+ if (datedPageIds.size === 0) return false;
6810
+ return pageNotes.some((pn) => datedPageIds.has(pn.pageId));
6811
+ });
6812
+ if (!hasDatedPageNotes) return 0;
6778
6813
  return storage.transaction(["page", "page_notes", "schedule_items", "notes"], "readwrite", async (tx) => {
6779
6814
  const [pages, pageNotes, existingSchedules, notes] = await Promise.all([
6780
6815
  tx.readonly("page").getAll(),
@@ -6823,5 +6858,5 @@ async function migrateDatedPageNotesToSchedule(storage) {
6823
6858
  }
6824
6859
 
6825
6860
  export { APP_ORIGIN, BUILD_TIME, CANVAS_CHUNK_ID, DASHBOARDS_CHUNK_ID, DirectoryHandleFeedTree, EFFORTS_CHUNK_ID, EQUIPMENT_CHUNK_ID, FEED_INDEX_META_PREFIX, FEED_REGISTRY_META_KEY, FEED_SUBSCRIPTIONS_META_KEY, FeedTreeError, GIT_SHA, HttpFeedTree, MemoryFeedTree, NOTE_ID_FRONTMATTER_KEY, PUBLISHED_FEED_META_KEY, QR_SCRIPT_ID, SEED_BROADCAST_CHANNEL, SEED_NAMESPACE, SEED_REGISTERED_WIDGETS, SEED_SCHEMA, SEMVER, SESSION_CSV_HEADER, TELEMETRY_CSV_HEADER, VERSION, applySeedChunk, applySeedChunks, assertNotebookIndex, assertSeedManifest, assertSeedRow, assertSeedRows, attributeSession, backfillFeedProvenance, batchScheduleNotes, buildContextualPageSource, buildNoteProvenance, buildQueryServiceStoresFromStorage, buildStatementTree, canvasRouteSlug, checkUnpublishedFeedChanges, cloneRemoteRecord, compileSeedRowFromMarkdown, composeNoteMarkdown, createIRFile, createUserNotebookLanding, csvToEquipmentLabels, csvToSessionRows, csvToTelemetryBundle, decodeUtf8, deleteFeedSourceHeadless, deleteUserNotebook, effortToMarkdown, emptySeedMeta, encodeUtf8, ensurePinnedExternalWorkout, equipmentToCsv, equipmentToMarkdown, exportPortableFilesFromStorage, extractNoteIdentity, extractTypedTags, feedIdOfMetaKey, feedIndexMetaKey, findNearbyMatchingScheduleItems, forkNoteToUserNotebook, getJournalDayOverlay, getNoteNotebooks, getNotePublicationSummary, getNoteRevision, getScheduleAndSessionCountsByNote, ingestPortableFilesIntoStorage, injectIdentityFrontmatter, isIRFile, listFeedSubscriptionsHeadless, listNoteRevisions, listScheduleItemsByDateRange, listScheduleItemsForNote, listScopedPropertyOverrides, localCivilDateKey, logSessionAgainstExternalWorkout, makeNotebookLinkId, makeScopedOverrideId, materializeCachedRemoteRecord, migrateDatedPageNotesToSchedule, migrateNotebookVocabulary, normalizeCivilDate, normalizeFeedTreePath, noteHasRecordedSessionsInTx, notebookSlugForChunkId, parseCsvLine, parseFrontmatterDateMs, parseNoteMarkdown, parseRemoteNoteId, prepareJournalSessionRun, previewRemoteNotebook, previewRemoteRecord, promoteNoteToNotebooks, promoteReferencedOverridesToNotebook, publishFeedFromStorage, qrInlineScript, readFeedRegistryHeadless, readFrontmatterMeta, reconcileRemovedFeedRecords, recordPublishedFeedCheckpoint, removeFeedNotebookContent, removeFeedSourceContentById, removeNoteFromNotebook, removeScheduleItem, removeSeedSourceContent, renderFeedLandingHtml, resolveScopedPropertyCatalog, resolveSessionCivilDate, resolveUpstreamProvenance, saveScopedPropertyOverride, scheduleNoteOnDate, seedMetaKey, seedNoteId, seedNoteSourceId, seedPrecedenceRank, seedSourceTier, sessionToCsv, setNoteNotebooks, setNotebookPublic, setSessionPublic, sha256HexAsync, snapshotNoteRevisionIfHasSessionsInTx, splitCsvRecords, statementToNode, subscribeFeedSourceHeadless, telemetryBundleToCsv, unsubscribeFeedSourceHeadless, updateScheduleItem, writeFeedRegistryHeadless };
6826
- //# sourceMappingURL=chunk-F3M5TAUJ.mjs.map
6827
- //# sourceMappingURL=chunk-F3M5TAUJ.mjs.map
6861
+ //# sourceMappingURL=chunk-H2I2BWPR.mjs.map
6862
+ //# sourceMappingURL=chunk-H2I2BWPR.mjs.map