@bitcobblers/wod-wiki-engine 0.61.2259 → 0.62.2261

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/index.d.cts CHANGED
@@ -1,12 +1,12 @@
1
- import { EventRecord, Note, IDialect, NoteBlock, NoteTelemetryBundleResult, NoteTelemetryBundle, NotebookId, NotebookLinkTargetKind, Tag, TagTypeRecord, TagIndex, OverridePropertyKind, ScopedPropertyOverride, Session as Session$1, StoredOutputStatement } from '@bitcobblers/wod-wiki-core';
1
+ import { EventRecord, Note, IDialect, NoteBlock, NoteTelemetryBundleResult, NoteTelemetryBundle, NotebookId, NotebookLinkTargetKind, ScheduleItem, Session as Session$1, ScheduleStatus, NoteRevision, Tag, TagTypeRecord, TagIndex, OverridePropertyKind, ScopedPropertyOverride, StoredOutputStatement } from '@bitcobblers/wod-wiki-core';
2
2
  export * from '@bitcobblers/wod-wiki-core';
3
3
  import { IRealtimeProcessor, ISummaryProcessor, IEffort, IEquipment, ReferenceIndex } from '@bitcobblers/wod-wiki-lang';
4
4
  export { ABSENT, AGGREGATE_BUILTINS, AUTHORITATIVE_CASTS, AmrapLogicStrategy, AnalyticsContext, AnalyticsEngine, AnalyticsProfileContext, AnalyticsResult, AnalyticsTransformer, BUILTIN_CALCS, BUNDLED_EFFORT_COUNT, BehaviorContext, BehaviorEventListener, BehaviorEventType, BlockBuilder, BlockContext, BlockLifecycleOptions, ButtonBehavior, CONSUMED_HINTS, CONSUMED_HINT_KEYS, CONTEXT_ATOMS, CalcDefinition, CalcEngine, CalcOrigin, CalcScope, CalculationDefinition, CalculationRegistry, CardioDialect, ChildSelectionBehavior, ChildrenStrategy, ChoiceGroupMetric, ClimbDialect, ClimbMetricType, CompletionDecision, CountdownTimerBehavior, CountupTimerBehavior, CrossFitDialect, DAY, DEFAULT_RESOLVER_OPTIONS, DEFAULT_RUNTIME_OPTIONS, DEFAULT_SOUND_PROFILE, DEFAULT_UNRESOLVED_EFFORT_MET, DIM_LENGTH, DIM_MASS, DIM_TIME, DIM_ZERO, DayRollup, DialectStack, DimVector, EFFORT_DATA_METRIC_TYPE, EFFORT_REGISTRY_ORIGINS, EffortBaseAttributes, EffortDerivation, EffortFallbackStrategy, EffortRegistrySource, EffortResolutionOptions, EffortResolver, EffortResolverOptions, ErrorAction, EventBus, EventCallback, EventHandlerOptions, ExecutionContext, ExecutionStatus, ExitBehavior, ExprNode, FixtureSyntaxError, GenericGroupStrategy, GenericLoopStrategy, GenericTimerStrategy, HabitsDialect, IAnalyticsEngine, IAnalyticsProcessorDescriptor, IAnalyticsProfile, IAnchorValue, IBehaviorContext, IBlockContext, ICastSubscription, IEffort, IEffortRegistry, IEffortResolver, IEvent, IEventBus, IEventHandler, IJitCompiler, ILookupTable, IMemoryLocation, IMemoryReference, IMetricPresentationPolicy, INTENSITY_TIERS, INowProvider, IRealtimeProcessor, IRuntimeAction, IRuntimeActionable, IRuntimeBehavior, IRuntimeBlock, IRuntimeBlockStrategy, IRuntimeClock, IRuntimeEventProvider, IRuntimeFactory, IRuntimeMemory, IRuntimeStack, IRuntimeSubscription, IScript, IScriptRuntime, ISummaryProcessor, InMemoryEffortRegistry, IntensityTier, InterceptMode, IntervalLogicStrategy, JitCompiler, LabelingBehavior, LineFormScope, LiteralKind, LiveRoundSplitRow, LiveSessionTelemetryFrame, LiveSummaryMetric, LocalRuntimeSubscription, LookupRegistry, MAX_TAG_CONTRIBUTION_DEPTH, MatchMode, MdTimerRuntime, MemoryEntry, MemoryLocation, MemoryTag, MemoryTypeEnum, MetricLine, MetricPresentationSurface, MetricPresentationToken, MetricRenderKind, MetricTone, MetricVisibility, MockClock, NextEvent, OutputEmitter, OutputListener, PRODUCTION_STRATEGIES, PopBlockAction, ProjectedRepTarget, ProjectedSecondaryTimer, ProjectionResult, PropertyRuleInput, PropertySourceLayer, PushBlockAction, RegisterEventHandlerAction, Registry, ReportOutputBehavior, ReportOutputStrategy, ResolvedEffort, ResolvedEffortData, ResolvedTagContributions, RoundState, RoundsMetric, RuntimeAdapter, RuntimeBlock, RuntimeBlockOptions, RuntimeClock, RuntimeController, RuntimeError, RuntimeFactory, RuntimeLogger, RuntimeMemory, RuntimeObservers, RuntimeStack, RuntimeStackOptions, SEED_PRECEDENCE_RANK, SOUND_PLAY_EVENT, SOUND_PROFILE_METRIC, STORE_CALCS, STREAM_ATOMS, ScriptOutlineNode, ScriptOutlineStatus, ScriptRuntime, ScriptRuntimeDependencies, SeedPrecedenceTier, SegmentWithMetadata, SerializedTimerSpan, SessionClockFrame, SessionClockInputSignal, SessionClockProjectionOptions, SessionExecutionStatus, SessionRootStrategy, SessionVisualPolarity, ShakeOutResult, SkippedDependencyDiagnostic, SnapshotClock, SoundProfile, SoundProfileBehavior, SoundRule, SoundStrategy, SoundTriggerAnchor, SoundTriggerPoint, StackEvent, StackListener, StackObserver, StackSnapshot, StackedDashboardWidgetDescriptor, StandardAnalyticsProfile, StartSessionAction, StartSessionOptions, StartWorkoutAction, StatementMetricDiff, SubscribeOptions, SubscriptionManager, TAG_MARKER_PREFIX, TestableBlockConfig, TimeSpan, TimerState, TwoPassEffortResolutionProcess, TypedMemoryReference, UNITS, UnitsDialect, UnregisterEventHandlerAction, Unsubscribe, VISIBILITY_ICONS, VISIBILITY_LABELS, Val, WhiteboardScript, WodDialect, YogaDialect, buildTooltip, bundledEfforts, calculateDuration, calculateElapsed, canonicalizeType, collapseUnresolvedChoices, compareStatement, compileLineForm, compilePropertySummaryCalcs, compoundName, computeColumnLabel, computeLabel, computeWorkloadRollups, createAnalyticsEngineForBlock, createCalcEngine, createCompiler, createDialectStack, createMetricPresentationPolicy, createMockClock, createParser, dailySessionLoads, dayBucket, dedupeEntitiesByPrecedence, dialectRegistry, dialectStack, diffStatement, evaluate, extractMetrics, extractPropertyRulesFromMeta, extractStatements, extractTagPropertyRules, findBestFuzzyMatch, findTagContributionCycles, findUnresolvedChoices, formatDurationCompact, formatDurationSmart, formatSecondsHHMMSS, formatSecondsMMSS, formatSoundTrigger, formatTime, formatTimeHHMMSS, formatTimeMMSS, formatTimePrecise, formatTimestamp, frozenNow, getAnalyticsFromLogs, getAnalyticsFromRuntime, getHints, getMetricVisibility, getRuntimeNowMs, hasHint, hintMetric, hintsToContainer, interpolateSessionClockFrame, isCastSubscription, isChoiceResolved, isRequiredCountdownLocked, isTimeLikeMetric, isWithinThreshold, levenshteinDistance, metricPresentation, normalizeForFuzzy, observeSessionClockInputs, outputNodeId, outputNodeIds, parseCalcLine, parseExpression, parseMetricLine, parseScript, parseSoundTrigger, projectLiveSessionTelemetry, projectScriptOutline, projectSessionClock, realtimeProcessorRegistry, renderMetric, resolveEntityRank, resolveEntityTier, resolveProfileRules, resolvePropertyDashboardWidgets, resolveSoundProfile, resolveSourceRank, resolveSourceTier, resolveTagContributions, resolveVisualPolarity, roundToTenth, runMetricShakeOutQueue, strategyRegistry, summaryProcessorRegistry, synthesizeWorkoutFormat, tagContributionMetrics, tagMarkerSlug, tagMarkerSlugs, tagMarkerType, toStoredOutputStatement, truthy, wallClockNow, whiteboardParser, whiteboardScript, whiteboardScriptLanguage, writeChoiceSelection } from '@bitcobblers/wod-wiki-lang';
5
5
  import { EffortQueryStore, FeedCatalogQueryStore, QueryServiceStores, EventStore } from '@bitcobblers/wod-wiki-wql';
6
6
  export { Aggregator, AnyParsedQuery, BlockQueryStore, BuildScopedDashboardOptions, ComparisonOp, DASHBOARD_GRID_MAX_COLS, DASHBOARD_WIDGET_TYPES, DEFAULT_DASHBOARD_TITLE, DEFAULT_NOTEBOOK_SLUGS, DashboardDocument, DashboardMeta, DashboardToken, DashboardWidget, EffortQueryStore, EntityScopeDescriptor, EntityScopeKind, EventStore, FeedCatalogQueryStore, FindOptions, FindPredicate, FindQueryResult, MetricPredicate, MovementRollupItem, NoteQueryStore, NotebookId, PLANNED_WIDGET_TYPES, ParseQueryBlockOptions, ParsedAggregateQuery, ParsedFindQuery, ParsedPipelineQuery, ParsedRowsQuery, PipelineSink, PipelineSource, QueryBlockObject, QueryOptions, QueryResult, QuerySeriesSpec, QueryService, QueryServiceStores, QuerySortSpec, QueryViewKind, QueryWidgetSuffix, QueryWindow, ResolveEntityScopeInput, RowsQueryResult, RowsRun, RowsRunSummary, ScalarOrParam, Series, SeriesPoint, TagFilter, TagValue, WQL_AGGREGATORS, WQL_CALC_TARGETS, WQL_CHART_HEADS, WQL_COMPARISON_OPS, WQL_CONTENT_FILTER_KEYS, WQL_DISPLAY_UNITS, WQL_FIND_TARGETS, WQL_FUNCTION_HEADS, WQL_GRAINS, WQL_INTENSITY_TIERS, WQL_KEYWORDS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_RESULT_PLANES, WQL_ROLLUP_PERIODS, WQL_SOURCES, WQL_SOURCE_HEADS, WQL_SOURCE_VALUES, WQL_STANDARD_DATASETS, WQL_TAG_KEYS, WQL_TYPED_TAG_KEYS, WQL_VIRTUAL_DIMS, WorkoutDashboardScaffoldOptions, WqlChartHead, WqlFindTarget, WqlSourceValue, bindQueryParams, buildDashboardDocument, buildDashboardFromScope, buildDashboardScaffold, buildWidgetsForWqlScope, buildWorkoutDashboardScaffold, collectQueryBlockParams, collectQueryParams, computeRowsRunSummary, dashboardSlug, defaultTokenValues, extractDashboardTokens, extractNoteWqlOverride, isAggregateQuery, isDashboardMeta, isDashboardWidgetType, isDefaultShorthandQueryBlock, isFindQuery, isNoteEditable, isPipelineQuery, isYamlQueryBlockBody, normalizeWql, notebookOfItem, notebookSlugFromId, notebooksOfItem, parseFilterFragment, parseQuery, parseQueryBlock, parseQueryWidgetSuffix, parseWqlSuffixes, queryBlockAttributes, queryBlockToDocumentText, resolveEntityScope, resolveWidgetType, serialize, serializeQueryBlock, serializeQueryBlockFence, splitAtWhere, substituteTokens, toNotebookId, unknownTokensMessage, unknownWidgetTypeMessage, wql, wqlLanguage, wqlParser, wqlTerms } from '@bitcobblers/wod-wiki-wql';
7
- import { b as SeedRow, c as SeedManifest, d as SeedMetaRecord, N as NotebookIndex, e as FeedTreeReader, F as FeedTree } from './ir-B46Q9icI.cjs';
8
- export { C as CANVAS_CHUNK_ID, f as ChunkKind, g as CorpusIRData, D as DASHBOARDS_CHUNK_ID, h as DirectoryHandleFeedTree, E as EFFORTS_CHUNK_ID, i as EQUIPMENT_CHUNK_ID, j as ExecutionLog, k as FEED_SUBSCRIPTIONS_META_KEY, l as FeedFileStat, m as FeedPath, a as FeedSubscriptionEntry, n as FeedSubscriptionsMetaRecord, o as FeedTreeError, p as FeedTreeErrorCode, q as FeedTreeWriter, r as FetchLike, s as FileSystemDirectoryHandleLike, t as FileSystemFileHandleLike, u as FileSystemWritableLike, H as HttpFeedTree, I as IrKind, M as ManifestChunk, v as MemoryFeedTree, w as MetricNode, x as NotebookIndexSummary, y as PortabilityImportReport, P as PortableFileEntry, z as PrepareJournalSessionRunInput, A as PreparedJournalSessionRun, R as ResolvedUpstreamProvenance, B as SEED_BROADCAST_CHANNEL, G as SEED_NAMESPACE, J as SEED_REGISTERED_WIDGETS, K as SEED_SCHEMA, L as SeedRecordRef, S as StatementNode, W as WodWikiIRFile, O as buildNoteProvenance, Q as buildStatementTree, T as canvasRouteSlug, U as cloneRemoteRecord, V as createIRFile, X as decodeUtf8, Y as deleteFeedSourceHeadless, Z as emptySeedMeta, _ as encodeUtf8, $ as exportPortableFilesFromStorage, a0 as feedIdOfMetaKey, a1 as getNotePublicationSummary, a2 as ingestPortableFilesIntoStorage, a3 as isIRFile, a4 as listFeedSubscriptionsHeadless, a5 as normalizeFeedTreePath, a6 as notebookSlugForChunkId, a7 as prepareJournalSessionRun, a8 as previewRemoteNotebook, a9 as previewRemoteRecord, aa as removeSeedSourceContent, ab as resolveUpstreamProvenance, ac as seedMetaKey, ad as seedNoteSourceId, ae as seedPrecedenceRank, af as seedSourceTier, ag as setNotebookPublic, ah as setSessionPublic, ai as sha256HexAsync, aj as statementToNode, ak as subscribeFeedSourceHeadless, al as unsubscribeFeedSourceHeadless } from './ir-B46Q9icI.cjs';
9
- import { IStorage, Session, Note as Note$1, StoreName } from '@bitcobblers/wod-wiki-storage';
7
+ import { c as SeedRow, d as SeedManifest, e as SeedMetaRecord, N as NotebookIndex, f as FeedTreeReader, F as FeedTree, g as RemoteWorkoutResolution } from './ir-fqQyyX01.cjs';
8
+ export { C as CANVAS_CHUNK_ID, h as ChunkKind, i as CompileMarkdownSeedRowInput, j as CorpusIRData, k as DASHBOARDS_CHUNK_ID, D as DeleteNotebookResult, l as DirectoryHandleFeedTree, E as EFFORTS_CHUNK_ID, m as EQUIPMENT_CHUNK_ID, n as EnsurePinnedExternalWorkoutInput, o as ExecutionLog, p as ExternalWorkoutPayload, q as FEED_INDEX_META_PREFIX, r as FEED_REGISTRY_META_KEY, s as FEED_SUBSCRIPTIONS_META_KEY, t as FeedFileStat, b as FeedOfflinePolicy, u as FeedPath, v as FeedRegistryMetaRecord, a as FeedSubscriptionEntry, w as FeedSubscriptionsMetaRecord, x as FeedTreeError, y as FeedTreeErrorCode, z as FeedTreeWriter, A as FetchLike, B as FileSystemDirectoryHandleLike, G as FileSystemFileHandleLike, H as FileSystemWritableLike, I as ForkNoteOptions, J as HttpFeedTree, K as IrKind, L as LogSessionAgainstExternalWorkoutInput, M as LoggedExternalWorkoutSession, O as ManifestChunk, Q as MemoryFeedTree, T as MetricNode, U as NotebookIndexSummary, V as ParsedRemoteNoteId, W as PinnedExternalWorkoutResult, X as PortabilityImportReport, P as PortableFileEntry, Y as PrepareJournalSessionRunInput, Z as PreparedJournalSessionRun, _ as RegisteredCustomFeedEntry, $ as RemoteSeedRowLike, a0 as RemoveSeedSourceResult, a1 as ResolvedRemoteWorkoutEnvelope, R as ResolvedUpstreamProvenance, a2 as SEED_BROADCAST_CHANNEL, a3 as SEED_NAMESPACE, a4 as SEED_REGISTERED_WIDGETS, a5 as SEED_SCHEMA, a6 as SeedRecordRef, S as StatementNode, a7 as WodWikiIRFile, a8 as buildNoteProvenance, a9 as buildStatementTree, aa as canvasRouteSlug, ab as cloneRemoteRecord, ac as compileSeedRowFromMarkdown, ad as createIRFile, ae as decodeUtf8, af as deleteFeedSourceHeadless, ag as deleteUserNotebook, ah as emptySeedMeta, ai as encodeUtf8, aj as ensurePinnedExternalWorkout, ak as exportPortableFilesFromStorage, al as feedIdOfMetaKey, am as feedIndexMetaKey, an as forkNoteToUserNotebook, ao as getNotePublicationSummary, ap as ingestPortableFilesIntoStorage, aq as isIRFile, ar as listFeedSubscriptionsHeadless, as as logSessionAgainstExternalWorkout, at as materializeCachedRemoteRecord, au as normalizeFeedTreePath, av as notebookSlugForChunkId, aw as parseRemoteNoteId, ax as prepareJournalSessionRun, ay as previewRemoteNotebook, az as previewRemoteRecord, aA as readFeedRegistryHeadless, aB as reconcileRemovedFeedRecords, aC as removeFeedNotebookContent, aD as removeFeedSourceContentById, aE as removeSeedSourceContent, aF as resolveUpstreamProvenance, aG as seedMetaKey, aH as seedNoteSourceId, aI as seedPrecedenceRank, aJ as seedSourceTier, aK as setNotebookPublic, aL as setSessionPublic, aM as sha256HexAsync, aN as statementToNode, aO as subscribeFeedSourceHeadless, aP as unsubscribeFeedSourceHeadless, aQ as writeFeedRegistryHeadless } from './ir-fqQyyX01.cjs';
9
+ import { IStorage, Session, Note as Note$1, IStorageTransaction, StoreName } from '@bitcobblers/wod-wiki-storage';
10
10
  import { DomainWorld, DomainWorldInput } from '@bitcobblers/wod-wiki-core/testing';
11
11
 
12
12
  type DatasetStore = {
@@ -222,13 +222,13 @@ declare function csvToTelemetryBundle(csv: string): NoteTelemetryBundleResult;
222
222
  * Auto-generated build version metadata.
223
223
  * Do not edit directly; updated by scripts/stamp-version.ts
224
224
  */
225
- declare const VERSION = "0.61.2259";
226
- declare const GIT_SHA = "e65814e";
227
- declare const BUILD_TIME = "2026-11-21T02:31:54.391Z";
225
+ declare const VERSION = "0.62.2261";
226
+ declare const GIT_SHA = "e0e9bb0";
227
+ declare const BUILD_TIME = "2026-11-23T01:20:07.186Z";
228
228
  declare const SEMVER: {
229
- readonly version: "0.61.2259";
230
- readonly gitSha: "e65814e";
231
- readonly buildTime: "2026-11-21T02:31:54.391Z";
229
+ readonly version: "0.62.2261";
230
+ readonly gitSha: "e0e9bb0";
231
+ readonly buildTime: "2026-11-23T01:20:07.186Z";
232
232
  };
233
233
 
234
234
  declare function seedNoteId(path: string): Promise<string>;
@@ -246,14 +246,17 @@ interface SeedChunkResult {
246
246
  totalBlocks: number;
247
247
  skippedUserOwned: number;
248
248
  deleted: number;
249
+ /** Session-pinned feed notes preserved instead of deleted during sweep/unsubscribe. */
250
+ preservedPinned?: number;
249
251
  /** Committed canonical notes that did not exist before this chunk. */
250
252
  addedNotes: number;
251
253
  /** Committed canonical notes whose content changed in this chunk. */
252
254
  updatedNotes: number;
253
255
  }
254
256
  /**
255
- * Apply multiple seed chunk writes inside ONE atomic storage transaction so
256
- * partial non-canvas chunk counts are never exposed mid-import.
257
+ * Apply seed chunk writes, committing each chunk in its own transaction with a
258
+ * macrotask yield between chunks so concurrent user writes can interleave
259
+ * without waiting behind a multi-second bulk import lock.
257
260
  */
258
261
  declare function applySeedChunks(storage: IStorage, writes: SeedChunkWrite[]): Promise<SeedChunkResult>;
259
262
  declare function applySeedChunk(storage: IStorage, write: SeedChunkWrite): Promise<SeedChunkResult>;
@@ -435,10 +438,10 @@ declare function checkUnpublishedFeedChanges(storage: IStorage, currentTree?: Fe
435
438
  * `Note.notebookIds` and `Session.notebookIds` projections).
436
439
  *
437
440
  * Invariants:
438
- * 1. `notebook/journal` is the permanent private container tracking every
439
- * user-owned Note and Session created in the application. User Notes
440
- * promoted to one or more user Notebooks NEVER lose `notebook/journal`
441
- * membership.
441
+ * 1. Notes are cleanly decoupled from `notebook/journal`: user Notes authored
442
+ * in custom Notebooks stay in those Notebooks, and Notes detached from all
443
+ * Notebooks remain valid unfiled (`notebookIds: []`) records discoverable
444
+ * via `:note{!notebook:*}`.
442
445
  * 2. Read-only system Notebooks (`notebook/defaults`, `notebook/guides`,
443
446
  * `notebook/efforts`, `notebook/equipment`, `notebook/dashboards`) and
444
447
  * feed-delivered Notebooks (`origin: 'feed'`) reject user Note membership
@@ -471,17 +474,16 @@ interface PromoteNoteResult {
471
474
  */
472
475
  declare function promoteNoteToNotebooks(storage: IStorage, input: PromoteNoteToNotebooksInput): Promise<PromoteNoteResult>;
473
476
  /**
474
- * Replace the exact set of user Notebooks a Note is promoted to while keeping
475
- * its mandatory `notebook/journal` (and `notebook/playground`, if applicable)
476
- * anchor intact.
477
+ * Replace the exact set of user Notebooks a Note is linked to (`[]` is valid
478
+ * for unfiled / orphaned Notes).
477
479
  */
478
480
  declare function setNoteNotebooks(storage: IStorage, input: {
479
481
  noteId: string;
480
482
  notebookIds: readonly string[];
481
483
  }): Promise<NotebookId[]>;
482
484
  /**
483
- * Detach a Note from one promoted user Notebook. Refuses detaching a user Note
484
- * from `notebook/journal`, which permanently tracks all created Notes.
485
+ * Detach a Note from one user Notebook. When detaching the last Notebook, the
486
+ * Note becomes unfiled/orphaned (`notebookIds: []`).
485
487
  */
486
488
  declare function removeNoteFromNotebook(storage: IStorage, noteId: string, notebookIdOrSlug: string): Promise<NotebookId[]>;
487
489
  /**
@@ -490,6 +492,118 @@ declare function removeNoteFromNotebook(storage: IStorage, noteId: string, noteb
490
492
  */
491
493
  declare function getNoteNotebooks(storage: IStorage, noteId: string): Promise<NotebookId[]>;
492
494
 
495
+ /**
496
+ * Schedule, NoteRevision & Session Overlay Service (ADR 0009, V35)
497
+ *
498
+ * Pure headless TypeScript (zero DOM/React imports) managing:
499
+ * 1. Immutable `note_revisions` snapshots whenever a Note with existing
500
+ * recorded Sessions is edited (`snapshotNoteRevisionIfHasSessionsInTx`).
501
+ * 2. Many-to-many `schedule_items` linking canonical Notes (user Notebooks,
502
+ * Feed Notebooks, or unfiled Quick-Logs) to local civil dates (`YYYY-MM-DD`).
503
+ * 3. Post-run mutable Session attribution (`sessionDate`, `pageId`,
504
+ * `scheduleItemId`) + ±N-day smart match lookup, while preserving
505
+ * immutable `(noteId, blockId, blockVersion, noteSourceRevision)` pins.
506
+ * 4. Paired-by-default Journal day overlay (`getJournalDayOverlay`) and
507
+ * idempotent V34 -> V35 backfill (`migrateDatedPageNotesToSchedule`).
508
+ */
509
+
510
+ /**
511
+ * Format an epoch timestamp as local civil `YYYY-MM-DD`.
512
+ */
513
+ declare function localCivilDateKey(ms?: number, timeZone?: string): string;
514
+ declare function normalizeCivilDate(input?: string, nowMs?: number, timeZone?: string): string;
515
+ declare function noteHasRecordedSessionsInTx(tx: IStorageTransaction, noteId: string): Promise<boolean>;
516
+ /**
517
+ * Persist an immutable NoteRevision snapshot (`[noteId, previous.sourceRevision]`)
518
+ * before mutating a Note whenever one or more recorded Sessions exist for that
519
+ * Note. Ensures historical Sessions remain mapped to an existing `(noteId, version)`.
520
+ */
521
+ declare function snapshotNoteRevisionIfHasSessionsInTx(tx: IStorageTransaction, previous: Note | undefined, now?: number): Promise<NoteRevision | undefined>;
522
+ declare function getNoteRevision(storage: IStorage, noteId: string, version: number): Promise<NoteRevision | undefined>;
523
+ declare function listNoteRevisions(storage: IStorage, noteId: string): Promise<NoteRevision[]>;
524
+ interface ScheduleNoteOnDateInput {
525
+ id?: string;
526
+ noteId: string;
527
+ date: string;
528
+ blockId?: string;
529
+ slot?: string;
530
+ notes?: string;
531
+ position?: number;
532
+ status?: ScheduleStatus;
533
+ sourceNotebookId?: string;
534
+ now?: number;
535
+ remotePayload?: RemoteWorkoutResolution;
536
+ resolveRemoteWorkout?: (noteId: string) => Promise<RemoteWorkoutResolution | undefined>;
537
+ }
538
+ /**
539
+ * Link an existing Note (user Notebook, Feed Notebook, or unfiled Quick-Log)
540
+ * onto a civil calendar date without cloning the Note.
541
+ *
542
+ * External/Feed workouts are automatically pinned locally with
543
+ * `retention: 'schedule-pinned'` so offline execution and Feed unsubscribes
544
+ * preserve scheduled training days cleanly.
545
+ */
546
+ declare function scheduleNoteOnDate(storage: IStorage, input: ScheduleNoteOnDateInput): Promise<ScheduleItem>;
547
+ declare function batchScheduleNotes(storage: IStorage, entries: readonly ScheduleNoteOnDateInput[]): Promise<ScheduleItem[]>;
548
+ interface UpdateScheduleItemPatch {
549
+ date?: string;
550
+ slot?: string | null;
551
+ position?: number;
552
+ status?: ScheduleStatus;
553
+ notes?: string | null;
554
+ blockId?: string | null;
555
+ now?: number;
556
+ }
557
+ declare function updateScheduleItem(storage: IStorage, id: string, patch: UpdateScheduleItemPatch): Promise<ScheduleItem>;
558
+ declare function removeScheduleItem(storage: IStorage, id: string): Promise<boolean>;
559
+ declare function listScheduleItemsByDateRange(storage: IStorage, fromDate: string, toDate: string): Promise<ScheduleItem[]>;
560
+ declare function listScheduleItemsForNote(storage: IStorage, noteId: string): Promise<ScheduleItem[]>;
561
+ interface NoteUsageCounts {
562
+ scheduleCount: number;
563
+ sessionCount: number;
564
+ scheduledDates: string[];
565
+ }
566
+ declare function getScheduleAndSessionCountsByNote(storage: IStorage): Promise<Map<string, NoteUsageCounts>>;
567
+ interface AttributeSessionInput {
568
+ sessionId: string;
569
+ /** New civil training date (`YYYY-MM-DD`), or omitted to keep existing. */
570
+ sessionDate?: string;
571
+ /** Optional explicit ScheduleItem ID, or `null` to unlink from any planned slot. */
572
+ scheduleItemId?: string | null;
573
+ now?: number;
574
+ }
575
+ /**
576
+ * Re-attribute a recorded Session's `sessionDate`, `pageId`, and/or `scheduleItemId`
577
+ * without altering its immutable `(noteId, blockId, blockVersion, noteSourceRevision)` pin.
578
+ */
579
+ declare function attributeSession(storage: IStorage, input: AttributeSessionInput): Promise<Session$1>;
580
+ declare function findNearbyMatchingScheduleItems(storage: IStorage, session: Pick<Session$1, 'id' | 'noteId' | 'sessionDate' | 'startTime' | 'scheduleItemId'>, windowDays?: number): Promise<ScheduleItem[]>;
581
+ interface JournalOverlayPlannedEntry {
582
+ item: ScheduleItem;
583
+ note?: Note;
584
+ pairedSessions: Session$1[];
585
+ }
586
+ interface JournalOverlayAdhocSession {
587
+ session: Session$1;
588
+ note?: Note;
589
+ }
590
+ interface JournalDayOverlay {
591
+ date: string;
592
+ pageId: string | null;
593
+ planned: JournalOverlayPlannedEntry[];
594
+ adhocSessions: JournalOverlayAdhocSession[];
595
+ allSessions: Session$1[];
596
+ }
597
+ declare function resolveSessionCivilDate(session: Pick<Session$1, 'sessionDate' | 'startTime' | 'createdAt'>, pageDateById?: ReadonlyMap<string, string>, sessionPageId?: string): string;
598
+ /**
599
+ * Paired-by-default day overlay uniting `ScheduleItem`s + executed `Session`s.
600
+ */
601
+ declare function getJournalDayOverlay(storage: IStorage, rawDate?: string): Promise<JournalDayOverlay>;
602
+ /**
603
+ * Idempotently copy legacy dated `page_notes` rows into `schedule_items` (V35 backfill).
604
+ */
605
+ declare function migrateDatedPageNotesToSchedule(storage: IStorage): Promise<number>;
606
+
493
607
  /**
494
608
  * ScopedPropertyInheritance — Deep module owning Property Note override storage,
495
609
  * Notebook-scoped inheritance (`notebook/defaults` -> subscribed Feed or user
@@ -603,4 +717,4 @@ declare function buildSampleBundle(session: SampleSession, now?: number): Sample
603
717
  */
604
718
  declare function buildSampleWorld(anchorNow?: number): DomainWorldInput;
605
719
 
606
- export { APP_ORIGIN, BUILD_TIME, type BuildContextualPageSourceScope, type BuildQueryServiceStoresOptions, type DatasetStore, type FeedLandingData, FeedTree, FeedTreeReader, GIT_SHA, type LandingNote, type LandingNotebook, type LanguagePack, type LanguagePackIdentity, type LanguagePackLangSlice, type LanguagePackUiSlice, NOTE_ID_FRONTMATTER_KEY, type NoteIdentity, NotebookIndex, PERSIST_WORLD_STORES, PUBLISHED_FEED_META_KEY, type ParsedNoteMarkdown, type PromoteNoteResult, type PromoteNoteToNotebooksInput, type PropertyInheritanceMode, type PropertyResolutionContext, type PublishFeedOptions, type PublishFeedReport, type PublishedFeedCheckpoint, QR_SCRIPT_ID, type ResolvedScopedCatalog, SAMPLE_TAG, SEMVER, SESSION_CSV_HEADER, type SampleBundle, type SampleMovement, type SampleSession, type SampleWorkoutType, type SaveScopedPropertyOverrideInput, type SeedChunkResult, type SeedChunkWrite, SeedManifest, SeedMetaRecord, SeedRow, type SessionImportRows, TELEMETRY_CSV_HEADER, type TypedTagItem, type UnpublishedFeedStatus, VERSION, applySeedChunk, applySeedChunks, assertNotebookIndex, assertSeedManifest, assertSeedRow, assertSeedRows, backfillFeedProvenance, buildContextualPageSource, buildQueryServiceStoresFromStorage, buildSampleBundle, buildSampleWorld, buildSessionLogs, checkUnpublishedFeedChanges, composeNoteMarkdown, createUserNotebookLanding, csvToEquipmentLabels, csvToSessionRows, csvToTelemetryBundle, defineLanguagePack, effortToMarkdown, equipmentToCsv, equipmentToMarkdown, extractNoteIdentity, extractTypedTags, generateSampleSessions, getNoteNotebooks, getRegisteredLanguagePacks, inMemoryEventStore, injectIdentityFrontmatter, listLanguagePacks, listScopedPropertyOverrides, makeNotebookLinkId, makeScopedOverrideId, migrateNotebookVocabulary, parseCsvLine, parseFrontmatterDateMs, parseNoteMarkdown, persistDomainWorld, promoteNoteToNotebooks, promoteReferencedOverridesToNotebook, publishFeedFromStorage, qrInlineScript, readFrontmatterMeta, recordPublishedFeedCheckpoint, registerLanguagePack, removeNoteFromNotebook, renderFeedLandingHtml, resolveScopedPropertyCatalog, round1, saveScopedPropertyOverride, seedNoteId, sessionToCsv, setNoteNotebooks, splitCsvRecords, telemetryBundleToCsv, unregisterLanguagePack };
720
+ export { APP_ORIGIN, type AttributeSessionInput, BUILD_TIME, type BuildContextualPageSourceScope, type BuildQueryServiceStoresOptions, type DatasetStore, type FeedLandingData, FeedTree, FeedTreeReader, GIT_SHA, type JournalDayOverlay, type JournalOverlayAdhocSession, type JournalOverlayPlannedEntry, type LandingNote, type LandingNotebook, type LanguagePack, type LanguagePackIdentity, type LanguagePackLangSlice, type LanguagePackUiSlice, NOTE_ID_FRONTMATTER_KEY, type NoteIdentity, type NoteUsageCounts, NotebookIndex, PERSIST_WORLD_STORES, PUBLISHED_FEED_META_KEY, type ParsedNoteMarkdown, type PromoteNoteResult, type PromoteNoteToNotebooksInput, type PropertyInheritanceMode, type PropertyResolutionContext, type PublishFeedOptions, type PublishFeedReport, type PublishedFeedCheckpoint, QR_SCRIPT_ID, RemoteWorkoutResolution, type ResolvedScopedCatalog, SAMPLE_TAG, SEMVER, SESSION_CSV_HEADER, type SampleBundle, type SampleMovement, type SampleSession, type SampleWorkoutType, type SaveScopedPropertyOverrideInput, type ScheduleNoteOnDateInput, type SeedChunkResult, type SeedChunkWrite, SeedManifest, SeedMetaRecord, SeedRow, type SessionImportRows, TELEMETRY_CSV_HEADER, type TypedTagItem, type UnpublishedFeedStatus, type UpdateScheduleItemPatch, VERSION, applySeedChunk, applySeedChunks, assertNotebookIndex, assertSeedManifest, assertSeedRow, assertSeedRows, attributeSession, backfillFeedProvenance, batchScheduleNotes, buildContextualPageSource, buildQueryServiceStoresFromStorage, buildSampleBundle, buildSampleWorld, buildSessionLogs, checkUnpublishedFeedChanges, composeNoteMarkdown, createUserNotebookLanding, csvToEquipmentLabels, csvToSessionRows, csvToTelemetryBundle, defineLanguagePack, effortToMarkdown, equipmentToCsv, equipmentToMarkdown, extractNoteIdentity, extractTypedTags, findNearbyMatchingScheduleItems, generateSampleSessions, getJournalDayOverlay, getNoteNotebooks, getNoteRevision, getRegisteredLanguagePacks, getScheduleAndSessionCountsByNote, inMemoryEventStore, injectIdentityFrontmatter, listLanguagePacks, listNoteRevisions, listScheduleItemsByDateRange, listScheduleItemsForNote, listScopedPropertyOverrides, localCivilDateKey, makeNotebookLinkId, makeScopedOverrideId, migrateDatedPageNotesToSchedule, migrateNotebookVocabulary, normalizeCivilDate, noteHasRecordedSessionsInTx, parseCsvLine, parseFrontmatterDateMs, parseNoteMarkdown, persistDomainWorld, promoteNoteToNotebooks, promoteReferencedOverridesToNotebook, publishFeedFromStorage, qrInlineScript, readFrontmatterMeta, recordPublishedFeedCheckpoint, registerLanguagePack, removeNoteFromNotebook, removeScheduleItem, renderFeedLandingHtml, resolveScopedPropertyCatalog, resolveSessionCivilDate, round1, saveScopedPropertyOverride, scheduleNoteOnDate, seedNoteId, sessionToCsv, setNoteNotebooks, snapshotNoteRevisionIfHasSessionsInTx, splitCsvRecords, telemetryBundleToCsv, unregisterLanguagePack, updateScheduleItem };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import { EventRecord, Note, IDialect, NoteBlock, NoteTelemetryBundleResult, NoteTelemetryBundle, NotebookId, NotebookLinkTargetKind, Tag, TagTypeRecord, TagIndex, OverridePropertyKind, ScopedPropertyOverride, Session as Session$1, StoredOutputStatement } from '@bitcobblers/wod-wiki-core';
1
+ import { EventRecord, Note, IDialect, NoteBlock, NoteTelemetryBundleResult, NoteTelemetryBundle, NotebookId, NotebookLinkTargetKind, ScheduleItem, Session as Session$1, ScheduleStatus, NoteRevision, Tag, TagTypeRecord, TagIndex, OverridePropertyKind, ScopedPropertyOverride, StoredOutputStatement } from '@bitcobblers/wod-wiki-core';
2
2
  export * from '@bitcobblers/wod-wiki-core';
3
3
  import { IRealtimeProcessor, ISummaryProcessor, IEffort, IEquipment, ReferenceIndex } from '@bitcobblers/wod-wiki-lang';
4
4
  export { ABSENT, AGGREGATE_BUILTINS, AUTHORITATIVE_CASTS, AmrapLogicStrategy, AnalyticsContext, AnalyticsEngine, AnalyticsProfileContext, AnalyticsResult, AnalyticsTransformer, BUILTIN_CALCS, BUNDLED_EFFORT_COUNT, BehaviorContext, BehaviorEventListener, BehaviorEventType, BlockBuilder, BlockContext, BlockLifecycleOptions, ButtonBehavior, CONSUMED_HINTS, CONSUMED_HINT_KEYS, CONTEXT_ATOMS, CalcDefinition, CalcEngine, CalcOrigin, CalcScope, CalculationDefinition, CalculationRegistry, CardioDialect, ChildSelectionBehavior, ChildrenStrategy, ChoiceGroupMetric, ClimbDialect, ClimbMetricType, CompletionDecision, CountdownTimerBehavior, CountupTimerBehavior, CrossFitDialect, DAY, DEFAULT_RESOLVER_OPTIONS, DEFAULT_RUNTIME_OPTIONS, DEFAULT_SOUND_PROFILE, DEFAULT_UNRESOLVED_EFFORT_MET, DIM_LENGTH, DIM_MASS, DIM_TIME, DIM_ZERO, DayRollup, DialectStack, DimVector, EFFORT_DATA_METRIC_TYPE, EFFORT_REGISTRY_ORIGINS, EffortBaseAttributes, EffortDerivation, EffortFallbackStrategy, EffortRegistrySource, EffortResolutionOptions, EffortResolver, EffortResolverOptions, ErrorAction, EventBus, EventCallback, EventHandlerOptions, ExecutionContext, ExecutionStatus, ExitBehavior, ExprNode, FixtureSyntaxError, GenericGroupStrategy, GenericLoopStrategy, GenericTimerStrategy, HabitsDialect, IAnalyticsEngine, IAnalyticsProcessorDescriptor, IAnalyticsProfile, IAnchorValue, IBehaviorContext, IBlockContext, ICastSubscription, IEffort, IEffortRegistry, IEffortResolver, IEvent, IEventBus, IEventHandler, IJitCompiler, ILookupTable, IMemoryLocation, IMemoryReference, IMetricPresentationPolicy, INTENSITY_TIERS, INowProvider, IRealtimeProcessor, IRuntimeAction, IRuntimeActionable, IRuntimeBehavior, IRuntimeBlock, IRuntimeBlockStrategy, IRuntimeClock, IRuntimeEventProvider, IRuntimeFactory, IRuntimeMemory, IRuntimeStack, IRuntimeSubscription, IScript, IScriptRuntime, ISummaryProcessor, InMemoryEffortRegistry, IntensityTier, InterceptMode, IntervalLogicStrategy, JitCompiler, LabelingBehavior, LineFormScope, LiteralKind, LiveRoundSplitRow, LiveSessionTelemetryFrame, LiveSummaryMetric, LocalRuntimeSubscription, LookupRegistry, MAX_TAG_CONTRIBUTION_DEPTH, MatchMode, MdTimerRuntime, MemoryEntry, MemoryLocation, MemoryTag, MemoryTypeEnum, MetricLine, MetricPresentationSurface, MetricPresentationToken, MetricRenderKind, MetricTone, MetricVisibility, MockClock, NextEvent, OutputEmitter, OutputListener, PRODUCTION_STRATEGIES, PopBlockAction, ProjectedRepTarget, ProjectedSecondaryTimer, ProjectionResult, PropertyRuleInput, PropertySourceLayer, PushBlockAction, RegisterEventHandlerAction, Registry, ReportOutputBehavior, ReportOutputStrategy, ResolvedEffort, ResolvedEffortData, ResolvedTagContributions, RoundState, RoundsMetric, RuntimeAdapter, RuntimeBlock, RuntimeBlockOptions, RuntimeClock, RuntimeController, RuntimeError, RuntimeFactory, RuntimeLogger, RuntimeMemory, RuntimeObservers, RuntimeStack, RuntimeStackOptions, SEED_PRECEDENCE_RANK, SOUND_PLAY_EVENT, SOUND_PROFILE_METRIC, STORE_CALCS, STREAM_ATOMS, ScriptOutlineNode, ScriptOutlineStatus, ScriptRuntime, ScriptRuntimeDependencies, SeedPrecedenceTier, SegmentWithMetadata, SerializedTimerSpan, SessionClockFrame, SessionClockInputSignal, SessionClockProjectionOptions, SessionExecutionStatus, SessionRootStrategy, SessionVisualPolarity, ShakeOutResult, SkippedDependencyDiagnostic, SnapshotClock, SoundProfile, SoundProfileBehavior, SoundRule, SoundStrategy, SoundTriggerAnchor, SoundTriggerPoint, StackEvent, StackListener, StackObserver, StackSnapshot, StackedDashboardWidgetDescriptor, StandardAnalyticsProfile, StartSessionAction, StartSessionOptions, StartWorkoutAction, StatementMetricDiff, SubscribeOptions, SubscriptionManager, TAG_MARKER_PREFIX, TestableBlockConfig, TimeSpan, TimerState, TwoPassEffortResolutionProcess, TypedMemoryReference, UNITS, UnitsDialect, UnregisterEventHandlerAction, Unsubscribe, VISIBILITY_ICONS, VISIBILITY_LABELS, Val, WhiteboardScript, WodDialect, YogaDialect, buildTooltip, bundledEfforts, calculateDuration, calculateElapsed, canonicalizeType, collapseUnresolvedChoices, compareStatement, compileLineForm, compilePropertySummaryCalcs, compoundName, computeColumnLabel, computeLabel, computeWorkloadRollups, createAnalyticsEngineForBlock, createCalcEngine, createCompiler, createDialectStack, createMetricPresentationPolicy, createMockClock, createParser, dailySessionLoads, dayBucket, dedupeEntitiesByPrecedence, dialectRegistry, dialectStack, diffStatement, evaluate, extractMetrics, extractPropertyRulesFromMeta, extractStatements, extractTagPropertyRules, findBestFuzzyMatch, findTagContributionCycles, findUnresolvedChoices, formatDurationCompact, formatDurationSmart, formatSecondsHHMMSS, formatSecondsMMSS, formatSoundTrigger, formatTime, formatTimeHHMMSS, formatTimeMMSS, formatTimePrecise, formatTimestamp, frozenNow, getAnalyticsFromLogs, getAnalyticsFromRuntime, getHints, getMetricVisibility, getRuntimeNowMs, hasHint, hintMetric, hintsToContainer, interpolateSessionClockFrame, isCastSubscription, isChoiceResolved, isRequiredCountdownLocked, isTimeLikeMetric, isWithinThreshold, levenshteinDistance, metricPresentation, normalizeForFuzzy, observeSessionClockInputs, outputNodeId, outputNodeIds, parseCalcLine, parseExpression, parseMetricLine, parseScript, parseSoundTrigger, projectLiveSessionTelemetry, projectScriptOutline, projectSessionClock, realtimeProcessorRegistry, renderMetric, resolveEntityRank, resolveEntityTier, resolveProfileRules, resolvePropertyDashboardWidgets, resolveSoundProfile, resolveSourceRank, resolveSourceTier, resolveTagContributions, resolveVisualPolarity, roundToTenth, runMetricShakeOutQueue, strategyRegistry, summaryProcessorRegistry, synthesizeWorkoutFormat, tagContributionMetrics, tagMarkerSlug, tagMarkerSlugs, tagMarkerType, toStoredOutputStatement, truthy, wallClockNow, whiteboardParser, whiteboardScript, whiteboardScriptLanguage, writeChoiceSelection } from '@bitcobblers/wod-wiki-lang';
5
5
  import { EffortQueryStore, FeedCatalogQueryStore, QueryServiceStores, EventStore } from '@bitcobblers/wod-wiki-wql';
6
6
  export { Aggregator, AnyParsedQuery, BlockQueryStore, BuildScopedDashboardOptions, ComparisonOp, DASHBOARD_GRID_MAX_COLS, DASHBOARD_WIDGET_TYPES, DEFAULT_DASHBOARD_TITLE, DEFAULT_NOTEBOOK_SLUGS, DashboardDocument, DashboardMeta, DashboardToken, DashboardWidget, EffortQueryStore, EntityScopeDescriptor, EntityScopeKind, EventStore, FeedCatalogQueryStore, FindOptions, FindPredicate, FindQueryResult, MetricPredicate, MovementRollupItem, NoteQueryStore, NotebookId, PLANNED_WIDGET_TYPES, ParseQueryBlockOptions, ParsedAggregateQuery, ParsedFindQuery, ParsedPipelineQuery, ParsedRowsQuery, PipelineSink, PipelineSource, QueryBlockObject, QueryOptions, QueryResult, QuerySeriesSpec, QueryService, QueryServiceStores, QuerySortSpec, QueryViewKind, QueryWidgetSuffix, QueryWindow, ResolveEntityScopeInput, RowsQueryResult, RowsRun, RowsRunSummary, ScalarOrParam, Series, SeriesPoint, TagFilter, TagValue, WQL_AGGREGATORS, WQL_CALC_TARGETS, WQL_CHART_HEADS, WQL_COMPARISON_OPS, WQL_CONTENT_FILTER_KEYS, WQL_DISPLAY_UNITS, WQL_FIND_TARGETS, WQL_FUNCTION_HEADS, WQL_GRAINS, WQL_INTENSITY_TIERS, WQL_KEYWORDS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_RESULT_PLANES, WQL_ROLLUP_PERIODS, WQL_SOURCES, WQL_SOURCE_HEADS, WQL_SOURCE_VALUES, WQL_STANDARD_DATASETS, WQL_TAG_KEYS, WQL_TYPED_TAG_KEYS, WQL_VIRTUAL_DIMS, WorkoutDashboardScaffoldOptions, WqlChartHead, WqlFindTarget, WqlSourceValue, bindQueryParams, buildDashboardDocument, buildDashboardFromScope, buildDashboardScaffold, buildWidgetsForWqlScope, buildWorkoutDashboardScaffold, collectQueryBlockParams, collectQueryParams, computeRowsRunSummary, dashboardSlug, defaultTokenValues, extractDashboardTokens, extractNoteWqlOverride, isAggregateQuery, isDashboardMeta, isDashboardWidgetType, isDefaultShorthandQueryBlock, isFindQuery, isNoteEditable, isPipelineQuery, isYamlQueryBlockBody, normalizeWql, notebookOfItem, notebookSlugFromId, notebooksOfItem, parseFilterFragment, parseQuery, parseQueryBlock, parseQueryWidgetSuffix, parseWqlSuffixes, queryBlockAttributes, queryBlockToDocumentText, resolveEntityScope, resolveWidgetType, serialize, serializeQueryBlock, serializeQueryBlockFence, splitAtWhere, substituteTokens, toNotebookId, unknownTokensMessage, unknownWidgetTypeMessage, wql, wqlLanguage, wqlParser, wqlTerms } from '@bitcobblers/wod-wiki-wql';
7
- import { b as SeedRow, c as SeedManifest, d as SeedMetaRecord, N as NotebookIndex, e as FeedTreeReader, F as FeedTree } from './ir-B46Q9icI.js';
8
- export { C as CANVAS_CHUNK_ID, f as ChunkKind, g as CorpusIRData, D as DASHBOARDS_CHUNK_ID, h as DirectoryHandleFeedTree, E as EFFORTS_CHUNK_ID, i as EQUIPMENT_CHUNK_ID, j as ExecutionLog, k as FEED_SUBSCRIPTIONS_META_KEY, l as FeedFileStat, m as FeedPath, a as FeedSubscriptionEntry, n as FeedSubscriptionsMetaRecord, o as FeedTreeError, p as FeedTreeErrorCode, q as FeedTreeWriter, r as FetchLike, s as FileSystemDirectoryHandleLike, t as FileSystemFileHandleLike, u as FileSystemWritableLike, H as HttpFeedTree, I as IrKind, M as ManifestChunk, v as MemoryFeedTree, w as MetricNode, x as NotebookIndexSummary, y as PortabilityImportReport, P as PortableFileEntry, z as PrepareJournalSessionRunInput, A as PreparedJournalSessionRun, R as ResolvedUpstreamProvenance, B as SEED_BROADCAST_CHANNEL, G as SEED_NAMESPACE, J as SEED_REGISTERED_WIDGETS, K as SEED_SCHEMA, L as SeedRecordRef, S as StatementNode, W as WodWikiIRFile, O as buildNoteProvenance, Q as buildStatementTree, T as canvasRouteSlug, U as cloneRemoteRecord, V as createIRFile, X as decodeUtf8, Y as deleteFeedSourceHeadless, Z as emptySeedMeta, _ as encodeUtf8, $ as exportPortableFilesFromStorage, a0 as feedIdOfMetaKey, a1 as getNotePublicationSummary, a2 as ingestPortableFilesIntoStorage, a3 as isIRFile, a4 as listFeedSubscriptionsHeadless, a5 as normalizeFeedTreePath, a6 as notebookSlugForChunkId, a7 as prepareJournalSessionRun, a8 as previewRemoteNotebook, a9 as previewRemoteRecord, aa as removeSeedSourceContent, ab as resolveUpstreamProvenance, ac as seedMetaKey, ad as seedNoteSourceId, ae as seedPrecedenceRank, af as seedSourceTier, ag as setNotebookPublic, ah as setSessionPublic, ai as sha256HexAsync, aj as statementToNode, ak as subscribeFeedSourceHeadless, al as unsubscribeFeedSourceHeadless } from './ir-B46Q9icI.js';
9
- import { IStorage, Session, Note as Note$1, StoreName } from '@bitcobblers/wod-wiki-storage';
7
+ import { c as SeedRow, d as SeedManifest, e as SeedMetaRecord, N as NotebookIndex, f as FeedTreeReader, F as FeedTree, g as RemoteWorkoutResolution } from './ir-fqQyyX01.js';
8
+ export { C as CANVAS_CHUNK_ID, h as ChunkKind, i as CompileMarkdownSeedRowInput, j as CorpusIRData, k as DASHBOARDS_CHUNK_ID, D as DeleteNotebookResult, l as DirectoryHandleFeedTree, E as EFFORTS_CHUNK_ID, m as EQUIPMENT_CHUNK_ID, n as EnsurePinnedExternalWorkoutInput, o as ExecutionLog, p as ExternalWorkoutPayload, q as FEED_INDEX_META_PREFIX, r as FEED_REGISTRY_META_KEY, s as FEED_SUBSCRIPTIONS_META_KEY, t as FeedFileStat, b as FeedOfflinePolicy, u as FeedPath, v as FeedRegistryMetaRecord, a as FeedSubscriptionEntry, w as FeedSubscriptionsMetaRecord, x as FeedTreeError, y as FeedTreeErrorCode, z as FeedTreeWriter, A as FetchLike, B as FileSystemDirectoryHandleLike, G as FileSystemFileHandleLike, H as FileSystemWritableLike, I as ForkNoteOptions, J as HttpFeedTree, K as IrKind, L as LogSessionAgainstExternalWorkoutInput, M as LoggedExternalWorkoutSession, O as ManifestChunk, Q as MemoryFeedTree, T as MetricNode, U as NotebookIndexSummary, V as ParsedRemoteNoteId, W as PinnedExternalWorkoutResult, X as PortabilityImportReport, P as PortableFileEntry, Y as PrepareJournalSessionRunInput, Z as PreparedJournalSessionRun, _ as RegisteredCustomFeedEntry, $ as RemoteSeedRowLike, a0 as RemoveSeedSourceResult, a1 as ResolvedRemoteWorkoutEnvelope, R as ResolvedUpstreamProvenance, a2 as SEED_BROADCAST_CHANNEL, a3 as SEED_NAMESPACE, a4 as SEED_REGISTERED_WIDGETS, a5 as SEED_SCHEMA, a6 as SeedRecordRef, S as StatementNode, a7 as WodWikiIRFile, a8 as buildNoteProvenance, a9 as buildStatementTree, aa as canvasRouteSlug, ab as cloneRemoteRecord, ac as compileSeedRowFromMarkdown, ad as createIRFile, ae as decodeUtf8, af as deleteFeedSourceHeadless, ag as deleteUserNotebook, ah as emptySeedMeta, ai as encodeUtf8, aj as ensurePinnedExternalWorkout, ak as exportPortableFilesFromStorage, al as feedIdOfMetaKey, am as feedIndexMetaKey, an as forkNoteToUserNotebook, ao as getNotePublicationSummary, ap as ingestPortableFilesIntoStorage, aq as isIRFile, ar as listFeedSubscriptionsHeadless, as as logSessionAgainstExternalWorkout, at as materializeCachedRemoteRecord, au as normalizeFeedTreePath, av as notebookSlugForChunkId, aw as parseRemoteNoteId, ax as prepareJournalSessionRun, ay as previewRemoteNotebook, az as previewRemoteRecord, aA as readFeedRegistryHeadless, aB as reconcileRemovedFeedRecords, aC as removeFeedNotebookContent, aD as removeFeedSourceContentById, aE as removeSeedSourceContent, aF as resolveUpstreamProvenance, aG as seedMetaKey, aH as seedNoteSourceId, aI as seedPrecedenceRank, aJ as seedSourceTier, aK as setNotebookPublic, aL as setSessionPublic, aM as sha256HexAsync, aN as statementToNode, aO as subscribeFeedSourceHeadless, aP as unsubscribeFeedSourceHeadless, aQ as writeFeedRegistryHeadless } from './ir-fqQyyX01.js';
9
+ import { IStorage, Session, Note as Note$1, IStorageTransaction, StoreName } from '@bitcobblers/wod-wiki-storage';
10
10
  import { DomainWorld, DomainWorldInput } from '@bitcobblers/wod-wiki-core/testing';
11
11
 
12
12
  type DatasetStore = {
@@ -222,13 +222,13 @@ declare function csvToTelemetryBundle(csv: string): NoteTelemetryBundleResult;
222
222
  * Auto-generated build version metadata.
223
223
  * Do not edit directly; updated by scripts/stamp-version.ts
224
224
  */
225
- declare const VERSION = "0.61.2259";
226
- declare const GIT_SHA = "e65814e";
227
- declare const BUILD_TIME = "2026-11-21T02:31:54.391Z";
225
+ declare const VERSION = "0.62.2261";
226
+ declare const GIT_SHA = "e0e9bb0";
227
+ declare const BUILD_TIME = "2026-11-23T01:20:07.186Z";
228
228
  declare const SEMVER: {
229
- readonly version: "0.61.2259";
230
- readonly gitSha: "e65814e";
231
- readonly buildTime: "2026-11-21T02:31:54.391Z";
229
+ readonly version: "0.62.2261";
230
+ readonly gitSha: "e0e9bb0";
231
+ readonly buildTime: "2026-11-23T01:20:07.186Z";
232
232
  };
233
233
 
234
234
  declare function seedNoteId(path: string): Promise<string>;
@@ -246,14 +246,17 @@ interface SeedChunkResult {
246
246
  totalBlocks: number;
247
247
  skippedUserOwned: number;
248
248
  deleted: number;
249
+ /** Session-pinned feed notes preserved instead of deleted during sweep/unsubscribe. */
250
+ preservedPinned?: number;
249
251
  /** Committed canonical notes that did not exist before this chunk. */
250
252
  addedNotes: number;
251
253
  /** Committed canonical notes whose content changed in this chunk. */
252
254
  updatedNotes: number;
253
255
  }
254
256
  /**
255
- * Apply multiple seed chunk writes inside ONE atomic storage transaction so
256
- * partial non-canvas chunk counts are never exposed mid-import.
257
+ * Apply seed chunk writes, committing each chunk in its own transaction with a
258
+ * macrotask yield between chunks so concurrent user writes can interleave
259
+ * without waiting behind a multi-second bulk import lock.
257
260
  */
258
261
  declare function applySeedChunks(storage: IStorage, writes: SeedChunkWrite[]): Promise<SeedChunkResult>;
259
262
  declare function applySeedChunk(storage: IStorage, write: SeedChunkWrite): Promise<SeedChunkResult>;
@@ -435,10 +438,10 @@ declare function checkUnpublishedFeedChanges(storage: IStorage, currentTree?: Fe
435
438
  * `Note.notebookIds` and `Session.notebookIds` projections).
436
439
  *
437
440
  * Invariants:
438
- * 1. `notebook/journal` is the permanent private container tracking every
439
- * user-owned Note and Session created in the application. User Notes
440
- * promoted to one or more user Notebooks NEVER lose `notebook/journal`
441
- * membership.
441
+ * 1. Notes are cleanly decoupled from `notebook/journal`: user Notes authored
442
+ * in custom Notebooks stay in those Notebooks, and Notes detached from all
443
+ * Notebooks remain valid unfiled (`notebookIds: []`) records discoverable
444
+ * via `:note{!notebook:*}`.
442
445
  * 2. Read-only system Notebooks (`notebook/defaults`, `notebook/guides`,
443
446
  * `notebook/efforts`, `notebook/equipment`, `notebook/dashboards`) and
444
447
  * feed-delivered Notebooks (`origin: 'feed'`) reject user Note membership
@@ -471,17 +474,16 @@ interface PromoteNoteResult {
471
474
  */
472
475
  declare function promoteNoteToNotebooks(storage: IStorage, input: PromoteNoteToNotebooksInput): Promise<PromoteNoteResult>;
473
476
  /**
474
- * Replace the exact set of user Notebooks a Note is promoted to while keeping
475
- * its mandatory `notebook/journal` (and `notebook/playground`, if applicable)
476
- * anchor intact.
477
+ * Replace the exact set of user Notebooks a Note is linked to (`[]` is valid
478
+ * for unfiled / orphaned Notes).
477
479
  */
478
480
  declare function setNoteNotebooks(storage: IStorage, input: {
479
481
  noteId: string;
480
482
  notebookIds: readonly string[];
481
483
  }): Promise<NotebookId[]>;
482
484
  /**
483
- * Detach a Note from one promoted user Notebook. Refuses detaching a user Note
484
- * from `notebook/journal`, which permanently tracks all created Notes.
485
+ * Detach a Note from one user Notebook. When detaching the last Notebook, the
486
+ * Note becomes unfiled/orphaned (`notebookIds: []`).
485
487
  */
486
488
  declare function removeNoteFromNotebook(storage: IStorage, noteId: string, notebookIdOrSlug: string): Promise<NotebookId[]>;
487
489
  /**
@@ -490,6 +492,118 @@ declare function removeNoteFromNotebook(storage: IStorage, noteId: string, noteb
490
492
  */
491
493
  declare function getNoteNotebooks(storage: IStorage, noteId: string): Promise<NotebookId[]>;
492
494
 
495
+ /**
496
+ * Schedule, NoteRevision & Session Overlay Service (ADR 0009, V35)
497
+ *
498
+ * Pure headless TypeScript (zero DOM/React imports) managing:
499
+ * 1. Immutable `note_revisions` snapshots whenever a Note with existing
500
+ * recorded Sessions is edited (`snapshotNoteRevisionIfHasSessionsInTx`).
501
+ * 2. Many-to-many `schedule_items` linking canonical Notes (user Notebooks,
502
+ * Feed Notebooks, or unfiled Quick-Logs) to local civil dates (`YYYY-MM-DD`).
503
+ * 3. Post-run mutable Session attribution (`sessionDate`, `pageId`,
504
+ * `scheduleItemId`) + ±N-day smart match lookup, while preserving
505
+ * immutable `(noteId, blockId, blockVersion, noteSourceRevision)` pins.
506
+ * 4. Paired-by-default Journal day overlay (`getJournalDayOverlay`) and
507
+ * idempotent V34 -> V35 backfill (`migrateDatedPageNotesToSchedule`).
508
+ */
509
+
510
+ /**
511
+ * Format an epoch timestamp as local civil `YYYY-MM-DD`.
512
+ */
513
+ declare function localCivilDateKey(ms?: number, timeZone?: string): string;
514
+ declare function normalizeCivilDate(input?: string, nowMs?: number, timeZone?: string): string;
515
+ declare function noteHasRecordedSessionsInTx(tx: IStorageTransaction, noteId: string): Promise<boolean>;
516
+ /**
517
+ * Persist an immutable NoteRevision snapshot (`[noteId, previous.sourceRevision]`)
518
+ * before mutating a Note whenever one or more recorded Sessions exist for that
519
+ * Note. Ensures historical Sessions remain mapped to an existing `(noteId, version)`.
520
+ */
521
+ declare function snapshotNoteRevisionIfHasSessionsInTx(tx: IStorageTransaction, previous: Note | undefined, now?: number): Promise<NoteRevision | undefined>;
522
+ declare function getNoteRevision(storage: IStorage, noteId: string, version: number): Promise<NoteRevision | undefined>;
523
+ declare function listNoteRevisions(storage: IStorage, noteId: string): Promise<NoteRevision[]>;
524
+ interface ScheduleNoteOnDateInput {
525
+ id?: string;
526
+ noteId: string;
527
+ date: string;
528
+ blockId?: string;
529
+ slot?: string;
530
+ notes?: string;
531
+ position?: number;
532
+ status?: ScheduleStatus;
533
+ sourceNotebookId?: string;
534
+ now?: number;
535
+ remotePayload?: RemoteWorkoutResolution;
536
+ resolveRemoteWorkout?: (noteId: string) => Promise<RemoteWorkoutResolution | undefined>;
537
+ }
538
+ /**
539
+ * Link an existing Note (user Notebook, Feed Notebook, or unfiled Quick-Log)
540
+ * onto a civil calendar date without cloning the Note.
541
+ *
542
+ * External/Feed workouts are automatically pinned locally with
543
+ * `retention: 'schedule-pinned'` so offline execution and Feed unsubscribes
544
+ * preserve scheduled training days cleanly.
545
+ */
546
+ declare function scheduleNoteOnDate(storage: IStorage, input: ScheduleNoteOnDateInput): Promise<ScheduleItem>;
547
+ declare function batchScheduleNotes(storage: IStorage, entries: readonly ScheduleNoteOnDateInput[]): Promise<ScheduleItem[]>;
548
+ interface UpdateScheduleItemPatch {
549
+ date?: string;
550
+ slot?: string | null;
551
+ position?: number;
552
+ status?: ScheduleStatus;
553
+ notes?: string | null;
554
+ blockId?: string | null;
555
+ now?: number;
556
+ }
557
+ declare function updateScheduleItem(storage: IStorage, id: string, patch: UpdateScheduleItemPatch): Promise<ScheduleItem>;
558
+ declare function removeScheduleItem(storage: IStorage, id: string): Promise<boolean>;
559
+ declare function listScheduleItemsByDateRange(storage: IStorage, fromDate: string, toDate: string): Promise<ScheduleItem[]>;
560
+ declare function listScheduleItemsForNote(storage: IStorage, noteId: string): Promise<ScheduleItem[]>;
561
+ interface NoteUsageCounts {
562
+ scheduleCount: number;
563
+ sessionCount: number;
564
+ scheduledDates: string[];
565
+ }
566
+ declare function getScheduleAndSessionCountsByNote(storage: IStorage): Promise<Map<string, NoteUsageCounts>>;
567
+ interface AttributeSessionInput {
568
+ sessionId: string;
569
+ /** New civil training date (`YYYY-MM-DD`), or omitted to keep existing. */
570
+ sessionDate?: string;
571
+ /** Optional explicit ScheduleItem ID, or `null` to unlink from any planned slot. */
572
+ scheduleItemId?: string | null;
573
+ now?: number;
574
+ }
575
+ /**
576
+ * Re-attribute a recorded Session's `sessionDate`, `pageId`, and/or `scheduleItemId`
577
+ * without altering its immutable `(noteId, blockId, blockVersion, noteSourceRevision)` pin.
578
+ */
579
+ declare function attributeSession(storage: IStorage, input: AttributeSessionInput): Promise<Session$1>;
580
+ declare function findNearbyMatchingScheduleItems(storage: IStorage, session: Pick<Session$1, 'id' | 'noteId' | 'sessionDate' | 'startTime' | 'scheduleItemId'>, windowDays?: number): Promise<ScheduleItem[]>;
581
+ interface JournalOverlayPlannedEntry {
582
+ item: ScheduleItem;
583
+ note?: Note;
584
+ pairedSessions: Session$1[];
585
+ }
586
+ interface JournalOverlayAdhocSession {
587
+ session: Session$1;
588
+ note?: Note;
589
+ }
590
+ interface JournalDayOverlay {
591
+ date: string;
592
+ pageId: string | null;
593
+ planned: JournalOverlayPlannedEntry[];
594
+ adhocSessions: JournalOverlayAdhocSession[];
595
+ allSessions: Session$1[];
596
+ }
597
+ declare function resolveSessionCivilDate(session: Pick<Session$1, 'sessionDate' | 'startTime' | 'createdAt'>, pageDateById?: ReadonlyMap<string, string>, sessionPageId?: string): string;
598
+ /**
599
+ * Paired-by-default day overlay uniting `ScheduleItem`s + executed `Session`s.
600
+ */
601
+ declare function getJournalDayOverlay(storage: IStorage, rawDate?: string): Promise<JournalDayOverlay>;
602
+ /**
603
+ * Idempotently copy legacy dated `page_notes` rows into `schedule_items` (V35 backfill).
604
+ */
605
+ declare function migrateDatedPageNotesToSchedule(storage: IStorage): Promise<number>;
606
+
493
607
  /**
494
608
  * ScopedPropertyInheritance — Deep module owning Property Note override storage,
495
609
  * Notebook-scoped inheritance (`notebook/defaults` -> subscribed Feed or user
@@ -603,4 +717,4 @@ declare function buildSampleBundle(session: SampleSession, now?: number): Sample
603
717
  */
604
718
  declare function buildSampleWorld(anchorNow?: number): DomainWorldInput;
605
719
 
606
- export { APP_ORIGIN, BUILD_TIME, type BuildContextualPageSourceScope, type BuildQueryServiceStoresOptions, type DatasetStore, type FeedLandingData, FeedTree, FeedTreeReader, GIT_SHA, type LandingNote, type LandingNotebook, type LanguagePack, type LanguagePackIdentity, type LanguagePackLangSlice, type LanguagePackUiSlice, NOTE_ID_FRONTMATTER_KEY, type NoteIdentity, NotebookIndex, PERSIST_WORLD_STORES, PUBLISHED_FEED_META_KEY, type ParsedNoteMarkdown, type PromoteNoteResult, type PromoteNoteToNotebooksInput, type PropertyInheritanceMode, type PropertyResolutionContext, type PublishFeedOptions, type PublishFeedReport, type PublishedFeedCheckpoint, QR_SCRIPT_ID, type ResolvedScopedCatalog, SAMPLE_TAG, SEMVER, SESSION_CSV_HEADER, type SampleBundle, type SampleMovement, type SampleSession, type SampleWorkoutType, type SaveScopedPropertyOverrideInput, type SeedChunkResult, type SeedChunkWrite, SeedManifest, SeedMetaRecord, SeedRow, type SessionImportRows, TELEMETRY_CSV_HEADER, type TypedTagItem, type UnpublishedFeedStatus, VERSION, applySeedChunk, applySeedChunks, assertNotebookIndex, assertSeedManifest, assertSeedRow, assertSeedRows, backfillFeedProvenance, buildContextualPageSource, buildQueryServiceStoresFromStorage, buildSampleBundle, buildSampleWorld, buildSessionLogs, checkUnpublishedFeedChanges, composeNoteMarkdown, createUserNotebookLanding, csvToEquipmentLabels, csvToSessionRows, csvToTelemetryBundle, defineLanguagePack, effortToMarkdown, equipmentToCsv, equipmentToMarkdown, extractNoteIdentity, extractTypedTags, generateSampleSessions, getNoteNotebooks, getRegisteredLanguagePacks, inMemoryEventStore, injectIdentityFrontmatter, listLanguagePacks, listScopedPropertyOverrides, makeNotebookLinkId, makeScopedOverrideId, migrateNotebookVocabulary, parseCsvLine, parseFrontmatterDateMs, parseNoteMarkdown, persistDomainWorld, promoteNoteToNotebooks, promoteReferencedOverridesToNotebook, publishFeedFromStorage, qrInlineScript, readFrontmatterMeta, recordPublishedFeedCheckpoint, registerLanguagePack, removeNoteFromNotebook, renderFeedLandingHtml, resolveScopedPropertyCatalog, round1, saveScopedPropertyOverride, seedNoteId, sessionToCsv, setNoteNotebooks, splitCsvRecords, telemetryBundleToCsv, unregisterLanguagePack };
720
+ export { APP_ORIGIN, type AttributeSessionInput, BUILD_TIME, type BuildContextualPageSourceScope, type BuildQueryServiceStoresOptions, type DatasetStore, type FeedLandingData, FeedTree, FeedTreeReader, GIT_SHA, type JournalDayOverlay, type JournalOverlayAdhocSession, type JournalOverlayPlannedEntry, type LandingNote, type LandingNotebook, type LanguagePack, type LanguagePackIdentity, type LanguagePackLangSlice, type LanguagePackUiSlice, NOTE_ID_FRONTMATTER_KEY, type NoteIdentity, type NoteUsageCounts, NotebookIndex, PERSIST_WORLD_STORES, PUBLISHED_FEED_META_KEY, type ParsedNoteMarkdown, type PromoteNoteResult, type PromoteNoteToNotebooksInput, type PropertyInheritanceMode, type PropertyResolutionContext, type PublishFeedOptions, type PublishFeedReport, type PublishedFeedCheckpoint, QR_SCRIPT_ID, RemoteWorkoutResolution, type ResolvedScopedCatalog, SAMPLE_TAG, SEMVER, SESSION_CSV_HEADER, type SampleBundle, type SampleMovement, type SampleSession, type SampleWorkoutType, type SaveScopedPropertyOverrideInput, type ScheduleNoteOnDateInput, type SeedChunkResult, type SeedChunkWrite, SeedManifest, SeedMetaRecord, SeedRow, type SessionImportRows, TELEMETRY_CSV_HEADER, type TypedTagItem, type UnpublishedFeedStatus, type UpdateScheduleItemPatch, VERSION, applySeedChunk, applySeedChunks, assertNotebookIndex, assertSeedManifest, assertSeedRow, assertSeedRows, attributeSession, backfillFeedProvenance, batchScheduleNotes, buildContextualPageSource, buildQueryServiceStoresFromStorage, buildSampleBundle, buildSampleWorld, buildSessionLogs, checkUnpublishedFeedChanges, composeNoteMarkdown, createUserNotebookLanding, csvToEquipmentLabels, csvToSessionRows, csvToTelemetryBundle, defineLanguagePack, effortToMarkdown, equipmentToCsv, equipmentToMarkdown, extractNoteIdentity, extractTypedTags, findNearbyMatchingScheduleItems, generateSampleSessions, getJournalDayOverlay, getNoteNotebooks, getNoteRevision, getRegisteredLanguagePacks, getScheduleAndSessionCountsByNote, inMemoryEventStore, injectIdentityFrontmatter, listLanguagePacks, listNoteRevisions, listScheduleItemsByDateRange, listScheduleItemsForNote, listScopedPropertyOverrides, localCivilDateKey, makeNotebookLinkId, makeScopedOverrideId, migrateDatedPageNotesToSchedule, migrateNotebookVocabulary, normalizeCivilDate, noteHasRecordedSessionsInTx, parseCsvLine, parseFrontmatterDateMs, parseNoteMarkdown, persistDomainWorld, promoteNoteToNotebooks, promoteReferencedOverridesToNotebook, publishFeedFromStorage, qrInlineScript, readFrontmatterMeta, recordPublishedFeedCheckpoint, registerLanguagePack, removeNoteFromNotebook, removeScheduleItem, renderFeedLandingHtml, resolveScopedPropertyCatalog, resolveSessionCivilDate, round1, saveScopedPropertyOverride, scheduleNoteOnDate, seedNoteId, sessionToCsv, setNoteNotebooks, snapshotNoteRevisionIfHasSessionsInTx, splitCsvRecords, telemetryBundleToCsv, unregisterLanguagePack, updateScheduleItem };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { APP_ORIGIN, BUILD_TIME, CANVAS_CHUNK_ID, DASHBOARDS_CHUNK_ID, DirectoryHandleFeedTree, EFFORTS_CHUNK_ID, EQUIPMENT_CHUNK_ID, 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, backfillFeedProvenance, buildContextualPageSource, buildNoteProvenance, buildQueryServiceStoresFromStorage, buildStatementTree, canvasRouteSlug, checkUnpublishedFeedChanges, cloneRemoteRecord, composeNoteMarkdown, createIRFile, createUserNotebookLanding, csvToEquipmentLabels, csvToSessionRows, csvToTelemetryBundle, decodeUtf8, deleteFeedSourceHeadless, effortToMarkdown, emptySeedMeta, encodeUtf8, equipmentToCsv, equipmentToMarkdown, exportPortableFilesFromStorage, extractNoteIdentity, extractTypedTags, feedIdOfMetaKey, getNoteNotebooks, getNotePublicationSummary, ingestPortableFilesIntoStorage, injectIdentityFrontmatter, isIRFile, listFeedSubscriptionsHeadless, listScopedPropertyOverrides, makeNotebookLinkId, makeScopedOverrideId, migrateNotebookVocabulary, normalizeFeedTreePath, notebookSlugForChunkId, parseCsvLine, parseFrontmatterDateMs, parseNoteMarkdown, prepareJournalSessionRun, previewRemoteNotebook, previewRemoteRecord, promoteNoteToNotebooks, promoteReferencedOverridesToNotebook, publishFeedFromStorage, qrInlineScript, readFrontmatterMeta, recordPublishedFeedCheckpoint, removeNoteFromNotebook, removeSeedSourceContent, renderFeedLandingHtml, resolveScopedPropertyCatalog, resolveUpstreamProvenance, saveScopedPropertyOverride, seedMetaKey, seedNoteId, seedNoteSourceId, seedPrecedenceRank, seedSourceTier, sessionToCsv, setNoteNotebooks, setNotebookPublic, setSessionPublic, sha256HexAsync, splitCsvRecords, statementToNode, subscribeFeedSourceHeadless, telemetryBundleToCsv, unsubscribeFeedSourceHeadless } from './chunk-C2WDXQZH.mjs';
1
+ 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 } from './chunk-OMZHUD6T.mjs';
2
2
  import { reconcileNoteBlocks, blockContentId, MetricType } from '@bitcobblers/wod-wiki-core';
3
3
  export * from '@bitcobblers/wod-wiki-core';
4
4
  import { dialectRegistry, realtimeProcessorRegistry, summaryProcessorRegistry } from '@bitcobblers/wod-wiki-lang';
@@ -90,6 +90,7 @@ function inMemoryEventStore(events) {
90
90
  var PERSIST_WORLD_STORES = [
91
91
  "notes",
92
92
  "block_revisions",
93
+ "note_revisions",
93
94
  "block_index",
94
95
  "block_efforts",
95
96
  "block_equipment",
@@ -102,6 +103,7 @@ var PERSIST_WORLD_STORES = [
102
103
  "equipment",
103
104
  "page",
104
105
  "page_notes",
106
+ "schedule_items",
105
107
  "sessions",
106
108
  "events"
107
109
  ];
@@ -123,6 +125,7 @@ async function persistDomainWorld(storage, worldInput) {
123
125
  }
124
126
  if (world.notes.length) await tx.readwrite("notes").putMany(world.notes);
125
127
  if (world.revisions.length) await tx.readwrite("block_revisions").putMany(world.revisions);
128
+ if (world.noteRevisions?.length) await tx.readwrite("note_revisions").putMany(world.noteRevisions);
126
129
  if (world.blockIndex.length) await tx.readwrite("block_index").putMany(world.blockIndex);
127
130
  if (world.blockEfforts.length) await tx.readwrite("block_efforts").putMany(world.blockEfforts);
128
131
  if (world.blockEquipment.length) await tx.readwrite("block_equipment").putMany(world.blockEquipment);
@@ -172,6 +175,7 @@ async function persistDomainWorld(storage, worldInput) {
172
175
  }
173
176
  if (world.pages.length) await tx.readwrite("page").putMany(world.pages);
174
177
  if (world.pageNotes.length) await tx.readwrite("page_notes").putMany(world.pageNotes);
178
+ if (world.scheduleItems?.length) await tx.readwrite("schedule_items").putMany(world.scheduleItems);
175
179
  if (world.sessions.length) await tx.readwrite("sessions").putMany(world.sessions);
176
180
  if (world.events.length) await tx.readwrite("events").putMany(world.events);
177
181
  });
@@ -467,8 +471,8 @@ function buildSessionLogs(session) {
467
471
  const monotony = round1(1.1 + dayPhase(4) * 0.7);
468
472
  const acwr = round1(0.85 + dayPhase(5) * 0.4);
469
473
  push("Readiness", readiness, "pts", "calc.readiness", { intensityTier: sessionIntensity });
470
- push("HRV", hrvMs, "pts", "calc.hrv", { intensityTier: sessionIntensity });
471
- push("Sleep", sleepHours, "pts", "calc.sleep", { intensityTier: sessionIntensity });
474
+ push("HRV", hrvMs, "ms", "calc.hrv", { intensityTier: sessionIntensity });
475
+ push("Sleep", sleepHours, "h", "calc.sleep", { intensityTier: sessionIntensity });
472
476
  push("Soreness", soreness, "rating", "calc.soreness", { intensityTier: sessionIntensity });
473
477
  push("Monotony", monotony, "ratio", "calc.monotony", { intensityTier: sessionIntensity });
474
478
  push("ACWR", acwr, "ratio", "calc.acwr", { intensityTier: sessionIntensity });