@bitcobblers/wod-wiki-wql 0.35.2116 → 0.35.2119
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.cjs +236 -233
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -47
- package/dist/index.d.ts +26 -47
- package/dist/index.mjs +238 -232
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { LRParser } from '@lezer/lr';
|
|
|
2
2
|
import { LanguageSupport, HighlightStyle, LRLanguage } from '@codemirror/language';
|
|
3
3
|
import { Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete';
|
|
4
4
|
import { Extension } from '@codemirror/state';
|
|
5
|
-
import { SummaryCoverage, BlockIndexRow, Note, EventRecord, PageNote, Page, AnalyticsDataPoint, ResultOrigin, StoredOutputStatement } from '@bitcobblers/wod-wiki-core';
|
|
5
|
+
import { SummaryCoverage, BlockIndexRow, Note, EventRecord, PageNote, Page, AnalyticsDataPoint, ResultOrigin, StoredOutputStatement, NoteBlockChange } from '@bitcobblers/wod-wiki-core';
|
|
6
6
|
export { SYSTEM_DEFAULT_OUTPUT_UNIT, UnitConversionError, convertViaCatalog, dimensionKeyOf, lookupUnit, systemDefaultUnit } from '@bitcobblers/wod-wiki-core';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -981,6 +981,8 @@ interface EventStore {
|
|
|
981
981
|
/** Store surface for content queries (`:note`). */
|
|
982
982
|
interface NoteQueryStore {
|
|
983
983
|
getAllNotes(): Promise<Note[]>;
|
|
984
|
+
/** Scoped hydration of actionable block parents. */
|
|
985
|
+
getNotesByIds?(noteIds: readonly string[]): Promise<Note[]>;
|
|
984
986
|
getNoteIdsForTag(label: string): Promise<Set<string>>;
|
|
985
987
|
/** Note-tags label set of one note (moved here from FactQueryStore — it
|
|
986
988
|
* reads note tags, not facts). */
|
|
@@ -1099,9 +1101,11 @@ interface EffortQueryStore {
|
|
|
1099
1101
|
* domain parser's 64-value limit) straight through without mapping. WQL
|
|
1100
1102
|
* reads only `label` off each tag record and never imports storage. */
|
|
1101
1103
|
interface NoteRelationBundle {
|
|
1102
|
-
/** The note's junction tag records
|
|
1104
|
+
/** The note's junction tag records — label plus its configured tag type
|
|
1105
|
+
* (domain, equipment, custom types), the property grouping resolves by. */
|
|
1103
1106
|
tags: ReadonlyArray<{
|
|
1104
1107
|
label: string;
|
|
1108
|
+
type?: string;
|
|
1105
1109
|
}>;
|
|
1106
1110
|
/** page_notes junction rows for the note; first by position is the
|
|
1107
1111
|
* parent page. */
|
|
@@ -1116,8 +1120,6 @@ interface QueryServiceStores {
|
|
|
1116
1120
|
* seed importer materializes corpus rows into the same store). */
|
|
1117
1121
|
blockStore?: BlockQueryStore;
|
|
1118
1122
|
effortStore?: EffortQueryStore;
|
|
1119
|
-
/** Derived corpus-note projections (catalog/tag planes). */
|
|
1120
|
-
staticNoteStore?: NoteQueryStore;
|
|
1121
1123
|
/** Serves exercise containment rows (`block_efforts` store). */
|
|
1122
1124
|
blockEffortsStore?: {
|
|
1123
1125
|
getAllFromIndex(index: string, key: string): Promise<any[]>;
|
|
@@ -1364,14 +1366,13 @@ declare class QueryService {
|
|
|
1364
1366
|
private readonly noteStore;
|
|
1365
1367
|
private readonly blockStore;
|
|
1366
1368
|
private readonly effortStore;
|
|
1367
|
-
private readonly staticNoteStore?;
|
|
1368
1369
|
private readonly pageStore?;
|
|
1369
1370
|
private readonly relationStore?;
|
|
1370
1371
|
private readonly datasetStore?;
|
|
1371
1372
|
private blockEffortsStore;
|
|
1372
1373
|
private tagsStore;
|
|
1373
1374
|
private noteTagsStore;
|
|
1374
|
-
constructor(storesOrEventStore?: QueryServiceStores | EventStore, noteStore?: NoteQueryStore, blockStore?: BlockQueryStore, effortStore?: EffortQueryStore
|
|
1375
|
+
constructor(storesOrEventStore?: QueryServiceStores | EventStore, noteStore?: NoteQueryStore, blockStore?: BlockQueryStore, effortStore?: EffortQueryStore);
|
|
1375
1376
|
/** Windowed flat-fact fetch — the projected view over the event store. */
|
|
1376
1377
|
getFactsByTimeRange(start: number, end: number): Promise<AnalyticsDataPoint[]>;
|
|
1377
1378
|
runQuery(raw: string, options?: QueryOptions): Promise<QueryResult>;
|
|
@@ -1404,6 +1405,7 @@ declare class QueryService {
|
|
|
1404
1405
|
* is injected — one bundle read per run instead of a link/page read per
|
|
1405
1406
|
* matched note. */
|
|
1406
1407
|
private containersForNotes;
|
|
1408
|
+
private hydrateBlocks;
|
|
1407
1409
|
/**
|
|
1408
1410
|
* Execute a :block query against the derived block_index store.
|
|
1409
1411
|
*/
|
|
@@ -1725,10 +1727,9 @@ declare function resolveCanonicalMetricKey(projectionName: string): string;
|
|
|
1725
1727
|
interface SummaryFactIdentity {
|
|
1726
1728
|
noteId: string;
|
|
1727
1729
|
resultId: string;
|
|
1728
|
-
/**
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
segmentVersion?: number;
|
|
1730
|
+
/** Actionable occurrence and saved revision that produced the result. */
|
|
1731
|
+
blockId?: string;
|
|
1732
|
+
blockVersion?: number;
|
|
1732
1733
|
/** Content-stable cross-note join key. */
|
|
1733
1734
|
blockContentId?: string;
|
|
1734
1735
|
/** Which surface produced the result; trend queries exclude 'playground' by default. */
|
|
@@ -1800,36 +1801,6 @@ declare function projectEventToFacts(record: EventRecord): AnalyticsDataPoint[];
|
|
|
1800
1801
|
*/
|
|
1801
1802
|
declare function eventsToStoredLogs(events: readonly EventRecord[]): StoredOutputStatement[];
|
|
1802
1803
|
|
|
1803
|
-
/**
|
|
1804
|
-
* Landing/catalog projection for a block row, derived from its sourceId route
|
|
1805
|
-
* (`collection:<catalog>/<item>`, `page:collection:<catalog>`,
|
|
1806
|
-
* `feed:feeds/<catalog>/…`) — never from `noteId`, which is a UUID for
|
|
1807
|
-
* imported notes. Legacy path-keyed rows keep deriving from the noteId stem
|
|
1808
|
-
* through `catalogOfItem` (undefined for UUID or no path); a bare
|
|
1809
|
-
* `collection:<catalog>` route is the legacy landing and gets its canonical
|
|
1810
|
-
* `page:collection:` sourceId.
|
|
1811
|
-
*/
|
|
1812
|
-
declare function staticCatalogRoute(block: Pick<BlockIndexRow, 'noteId' | 'sourceId'>): {
|
|
1813
|
-
landing: boolean;
|
|
1814
|
-
catalog?: string;
|
|
1815
|
-
sourceId?: string;
|
|
1816
|
-
};
|
|
1817
|
-
/**
|
|
1818
|
-
* Pure projection of a block_index into static Notes — one Note per distinct
|
|
1819
|
-
* noteId. `id` stays the canonical storage identity (UUID for imported rows);
|
|
1820
|
-
* `catalog` and feed-landing status come from the sourceId route, not
|
|
1821
|
-
* the noteId path. The catalog (e.g. `crossfit-girls`) is what the Library's
|
|
1822
|
-
* panel uses to target the `+ Filter → Catalog` menu.
|
|
1823
|
-
*/
|
|
1824
|
-
declare function staticNotesFromBlocks(blocks: BlockIndexRow[]): Note[];
|
|
1825
|
-
/**
|
|
1826
|
-
* Tag → noteIds index over a block index's frontmatter rows. Static-corpus
|
|
1827
|
-
* notes declare tags only in frontmatter `tags:`; this recovers the mapping
|
|
1828
|
-
* the note store needs to answer `tags:` clauses (issue #853 — the store
|
|
1829
|
-
* previously returned an empty set for every tag).
|
|
1830
|
-
*/
|
|
1831
|
-
declare function staticTagIndexFromBlocks(blocks: BlockIndexRow[]): Map<string, Set<string>>;
|
|
1832
|
-
|
|
1833
1804
|
/**
|
|
1834
1805
|
* Dashboard Note model (#898 map, format locked in #899).
|
|
1835
1806
|
*
|
|
@@ -2064,6 +2035,7 @@ declare function parseFrontmatterProps(lines: string[]): Record<string, string>;
|
|
|
2064
2035
|
* itself. Move/duplicate/remove operate on the whole group so the rendered
|
|
2065
2036
|
* card — title, question, chart — travels together.
|
|
2066
2037
|
*/
|
|
2038
|
+
|
|
2067
2039
|
interface WidgetSpec {
|
|
2068
2040
|
/** Card title — renders as a `## ` heading above the block. */
|
|
2069
2041
|
title?: string;
|
|
@@ -2099,6 +2071,13 @@ declare function appendWidget(raw: string, spec: WidgetSpec): string;
|
|
|
2099
2071
|
type WidgetOpResult = {
|
|
2100
2072
|
ok: true;
|
|
2101
2073
|
note: string;
|
|
2074
|
+
changes: NoteBlockChange[];
|
|
2075
|
+
retainedBlocks: Array<{
|
|
2076
|
+
from: number;
|
|
2077
|
+
to: number;
|
|
2078
|
+
nextFrom: number;
|
|
2079
|
+
nextTo: number;
|
|
2080
|
+
}>;
|
|
2102
2081
|
} | {
|
|
2103
2082
|
ok: false;
|
|
2104
2083
|
reason: 'not-found' | 'stale-body';
|
|
@@ -2142,13 +2121,13 @@ declare function migrateLegacyDashboardBodies(raw: string): string;
|
|
|
2142
2121
|
* Auto-generated build version metadata.
|
|
2143
2122
|
* Do not edit directly; updated by scripts/stamp-version.ts
|
|
2144
2123
|
*/
|
|
2145
|
-
declare const VERSION = "0.35.
|
|
2146
|
-
declare const GIT_SHA = "
|
|
2147
|
-
declare const BUILD_TIME = "2026-10-
|
|
2124
|
+
declare const VERSION = "0.35.2119";
|
|
2125
|
+
declare const GIT_SHA = "e0eb840";
|
|
2126
|
+
declare const BUILD_TIME = "2026-10-13T06:24:52.520Z";
|
|
2148
2127
|
declare const SEMVER: {
|
|
2149
|
-
readonly version: "0.35.
|
|
2150
|
-
readonly gitSha: "
|
|
2151
|
-
readonly buildTime: "2026-10-
|
|
2128
|
+
readonly version: "0.35.2119";
|
|
2129
|
+
readonly gitSha: "e0eb840";
|
|
2130
|
+
readonly buildTime: "2026-10-13T06:24:52.520Z";
|
|
2152
2131
|
};
|
|
2153
2132
|
|
|
2154
|
-
export { type Aggregator, type AnyParsedQuery, BUILD_TIME, type BlockQueryStore, CONTENT_GROUPING_DIMENSIONS, type CatalogFieldSuggestion, type CatalogValueSuggestion, type ComparisonOp, DASHBOARD_GRID_MAX_COLS, DASHBOARD_WIDGET_TYPES, DEFAULT_DASHBOARD_TITLE, DISCIPLINE_FACTORS, type DashboardDocument, type DashboardMeta, type DashboardParsedSection, type DashboardSectionInput, type DashboardToken, type DashboardWidget, type DashboardWidgetType, type DocumentAssignment, type DocumentDefaults, type DocumentFormula, type DocumentOutput, type DocumentResult, EFFORT_DISCIPLINES, type EffortDiscipline, type EffortQueryStore, type EventRowIdentity, type EventStore, type ExecutionContext, type FamilyRunPayload, type FindOptions, type FindPredicate, type FindQueryResult, type FormulaEvaluation, type FormulaEvaluator, GIT_SHA, type IEffort, type IFieldCatalog, type LinkWidget, type MetricPredicate, type NoteContainer, type NoteQueryStore, type NoteRelationBundle, type OperandValue, type OutputUnitResolution, PLANNED_WIDGET_TYPES, type PageSourceEntry, PageSourceRegistry, type ParsedAggregateQuery, type ParsedDocument, type ParsedFindQuery, type ParsedFrontmatter, type ParsedPipelineQuery, type ParsedRowsQuery, type ParsedWqlRollupSuffix, type ParsedWqlSuffixes, type ParsedWqlWindowSuffix, type PipelineOptions, type PipelineResult, type PipelineSink, type PipelineSource, type PointwiseInputs, type QueryDocument, QueryDocumentRunner$1 as QueryDocumentRunner, type QueryDocumentRunnerHost, type QueryDocumentRunnerOptions, type QueryOptions, type QueryResult, QueryService, type QueryServiceStores, type QueryWidgetSuffix, type QueryWindow, type ResolvedRange, type RowsPipes, type RowsQueryResult, type RowsRun, SEMVER, type Series, type SeriesPoint, QueryDocumentRunner as SharedQueryDocumentRunner, type SharedRunnerOptions, type SummaryFactIdentity, type SummaryFactSourceOutput, type TabularColumn, type TabularGroup, type TabularResult, type TagFilter, type TagValue, UNASSIGNED, type UnitBearingFact, type UnitFamily, VERSION, WQL_AGGREGATORS, WQL_CALC_TARGETS, WQL_CHART_HEADS, WQL_COMPARISON_OPS, WQL_CONTENT_FILTER_KEYS, WQL_CONTENT_ONLY_KEYS, WQL_DISPLAY_UNITS, WQL_EFFORT_FILTER_KEYS, WQL_FIND_TARGETS, WQL_FUNCTION_HEADS, WQL_GRAINS, WQL_INTENSITY_TIERS, WQL_KEYWORDS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_NOTE_DEFAULT_SOURCES, WQL_RESULT_PLANES, WQL_ROLLUP_PERIODS, WQL_SOURCES, WQL_SOURCE_HEADS, WQL_SOURCE_HEAD_SCOPES, WQL_SOURCE_VALUES, WQL_STANDARD_DATASETS, WQL_TAG_KEYS, WQL_TYPED_TAG_KEYS, WQL_TYPE_HEADS, WQL_VIRTUAL_DIMS, type WidgetOpResult, type WidgetSpan, type WidgetSpec, type WqlAggregator, type WqlCalcTarget, type WqlChartHead, type WqlComparisonOp, type WqlCompletionOptions, type WqlContentFilterKey, type WqlDisplayUnit, type WqlDomainOrder, type WqlDomainPredicate, type WqlDomainReadResult, type WqlFindTarget, type WqlFunctionHead, type WqlGrain, type WqlIntensityTier, type WqlKeyword, type WqlMetricAggregate, type WqlMetricFamily, type WqlResultPlane, type WqlRollupPeriod, type WqlSource, type WqlSourceHead, type WqlSourceValue, type WqlStandardDataset, type WqlTagKey, type WqlTypedTagKey, type WqlVirtualDim, allowedFilterTypesForTarget, appendSuffixes, appendWidget, buildDashboardDocument, buildDashboardScaffold, buildDrillDownQuery, captureContext, catalogOfItem, civilDateAdd, civilDateDiff, civilDateOf, civilDatesCoveredByRange, civilMonday, consumesRollupFacts, convertDisplay, createBuiltinFormulaEvaluator, dashboardSlug, defaultTokenValues, disciplineFactorFor, duplicateWidget, eventsToStoredLogs, extractDashboardTokens, extractFrontmatterTags, findTargetAdvisories, getList, getScalar, getUnitFamily, inRange, isAggregateQuery, isDashboardMeta, isDashboardWidgetType, isEffortDiscipline, isFindQuery, isPipelineQuery, isProposedMetric, migrateLegacyDashboardBodies, moveWidget, normalizeSummaryFacts, normalizeWql, parseDashboardNote, parseDocument, parseFlatProperties, parseFrontmatter, parseFrontmatterBody, parseFrontmatterCategories, parseFrontmatterProps, parseQuery, parseQueryWidgetSuffix, parseWqlSuffixes, projectEventToFacts, referencedTokens, removeWidget, renderWidgetGroup, resizeWidget, resolveCanonicalMetricKey, resolveOutputUnit, resolveWidgetType, resolveWindowRange, rowsParseError, serialize, serializeDocument, serializeFrontmatter, setDashboardTokenValue, sourceMatches, splitAtWhere,
|
|
2133
|
+
export { type Aggregator, type AnyParsedQuery, BUILD_TIME, type BlockQueryStore, CONTENT_GROUPING_DIMENSIONS, type CatalogFieldSuggestion, type CatalogValueSuggestion, type ComparisonOp, DASHBOARD_GRID_MAX_COLS, DASHBOARD_WIDGET_TYPES, DEFAULT_DASHBOARD_TITLE, DISCIPLINE_FACTORS, type DashboardDocument, type DashboardMeta, type DashboardParsedSection, type DashboardSectionInput, type DashboardToken, type DashboardWidget, type DashboardWidgetType, type DocumentAssignment, type DocumentDefaults, type DocumentFormula, type DocumentOutput, type DocumentResult, EFFORT_DISCIPLINES, type EffortDiscipline, type EffortQueryStore, type EventRowIdentity, type EventStore, type ExecutionContext, type FamilyRunPayload, type FindOptions, type FindPredicate, type FindQueryResult, type FormulaEvaluation, type FormulaEvaluator, GIT_SHA, type IEffort, type IFieldCatalog, type LinkWidget, type MetricPredicate, type NoteContainer, type NoteQueryStore, type NoteRelationBundle, type OperandValue, type OutputUnitResolution, PLANNED_WIDGET_TYPES, type PageSourceEntry, PageSourceRegistry, type ParsedAggregateQuery, type ParsedDocument, type ParsedFindQuery, type ParsedFrontmatter, type ParsedPipelineQuery, type ParsedRowsQuery, type ParsedWqlRollupSuffix, type ParsedWqlSuffixes, type ParsedWqlWindowSuffix, type PipelineOptions, type PipelineResult, type PipelineSink, type PipelineSource, type PointwiseInputs, type QueryDocument, QueryDocumentRunner$1 as QueryDocumentRunner, type QueryDocumentRunnerHost, type QueryDocumentRunnerOptions, type QueryOptions, type QueryResult, QueryService, type QueryServiceStores, type QueryWidgetSuffix, type QueryWindow, type ResolvedRange, type RowsPipes, type RowsQueryResult, type RowsRun, SEMVER, type Series, type SeriesPoint, QueryDocumentRunner as SharedQueryDocumentRunner, type SharedRunnerOptions, type SummaryFactIdentity, type SummaryFactSourceOutput, type TabularColumn, type TabularGroup, type TabularResult, type TagFilter, type TagValue, UNASSIGNED, type UnitBearingFact, type UnitFamily, VERSION, WQL_AGGREGATORS, WQL_CALC_TARGETS, WQL_CHART_HEADS, WQL_COMPARISON_OPS, WQL_CONTENT_FILTER_KEYS, WQL_CONTENT_ONLY_KEYS, WQL_DISPLAY_UNITS, WQL_EFFORT_FILTER_KEYS, WQL_FIND_TARGETS, WQL_FUNCTION_HEADS, WQL_GRAINS, WQL_INTENSITY_TIERS, WQL_KEYWORDS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_NOTE_DEFAULT_SOURCES, WQL_RESULT_PLANES, WQL_ROLLUP_PERIODS, WQL_SOURCES, WQL_SOURCE_HEADS, WQL_SOURCE_HEAD_SCOPES, WQL_SOURCE_VALUES, WQL_STANDARD_DATASETS, WQL_TAG_KEYS, WQL_TYPED_TAG_KEYS, WQL_TYPE_HEADS, WQL_VIRTUAL_DIMS, type WidgetOpResult, type WidgetSpan, type WidgetSpec, type WqlAggregator, type WqlCalcTarget, type WqlChartHead, type WqlComparisonOp, type WqlCompletionOptions, type WqlContentFilterKey, type WqlDisplayUnit, type WqlDomainOrder, type WqlDomainPredicate, type WqlDomainReadResult, type WqlFindTarget, type WqlFunctionHead, type WqlGrain, type WqlIntensityTier, type WqlKeyword, type WqlMetricAggregate, type WqlMetricFamily, type WqlResultPlane, type WqlRollupPeriod, type WqlSource, type WqlSourceHead, type WqlSourceValue, type WqlStandardDataset, type WqlTagKey, type WqlTypedTagKey, type WqlVirtualDim, allowedFilterTypesForTarget, appendSuffixes, appendWidget, buildDashboardDocument, buildDashboardScaffold, buildDrillDownQuery, captureContext, catalogOfItem, civilDateAdd, civilDateDiff, civilDateOf, civilDatesCoveredByRange, civilMonday, consumesRollupFacts, convertDisplay, createBuiltinFormulaEvaluator, dashboardSlug, defaultTokenValues, disciplineFactorFor, duplicateWidget, eventsToStoredLogs, extractDashboardTokens, extractFrontmatterTags, findTargetAdvisories, getList, getScalar, getUnitFamily, inRange, isAggregateQuery, isDashboardMeta, isDashboardWidgetType, isEffortDiscipline, isFindQuery, isPipelineQuery, isProposedMetric, migrateLegacyDashboardBodies, moveWidget, normalizeSummaryFacts, normalizeWql, parseDashboardNote, parseDocument, parseFlatProperties, parseFrontmatter, parseFrontmatterBody, parseFrontmatterCategories, parseFrontmatterProps, parseQuery, parseQueryWidgetSuffix, parseWqlSuffixes, projectEventToFacts, referencedTokens, removeWidget, renderWidgetGroup, resizeWidget, resolveCanonicalMetricKey, resolveOutputUnit, resolveWidgetType, resolveWindowRange, rowsParseError, serialize, serializeDocument, serializeFrontmatter, setDashboardTokenValue, sourceMatches, splitAtWhere, stripFrontmatter, substituteTokens, substituteTokens$1 as substituteTokensRaw, supportsWqlFilterKey, systemTimeZone, toEventRows, toSummaryEventRows, unknownTokensMessage, unknownWidgetTypeMessage, updateWidget, widgetBodyLine, widgetFenceTag, wql, wqlCompletion, wqlCompletionSource, wqlFilterKeys, wqlGroupingDimensions, wqlHighlightStyle, wqlLanguage, parser as wqlParser, wql_parser_terms as wqlTerms, zonedNoon, zonedStartOfDay };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { LRParser } from '@lezer/lr';
|
|
|
2
2
|
import { LanguageSupport, HighlightStyle, LRLanguage } from '@codemirror/language';
|
|
3
3
|
import { Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete';
|
|
4
4
|
import { Extension } from '@codemirror/state';
|
|
5
|
-
import { SummaryCoverage, BlockIndexRow, Note, EventRecord, PageNote, Page, AnalyticsDataPoint, ResultOrigin, StoredOutputStatement } from '@bitcobblers/wod-wiki-core';
|
|
5
|
+
import { SummaryCoverage, BlockIndexRow, Note, EventRecord, PageNote, Page, AnalyticsDataPoint, ResultOrigin, StoredOutputStatement, NoteBlockChange } from '@bitcobblers/wod-wiki-core';
|
|
6
6
|
export { SYSTEM_DEFAULT_OUTPUT_UNIT, UnitConversionError, convertViaCatalog, dimensionKeyOf, lookupUnit, systemDefaultUnit } from '@bitcobblers/wod-wiki-core';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -981,6 +981,8 @@ interface EventStore {
|
|
|
981
981
|
/** Store surface for content queries (`:note`). */
|
|
982
982
|
interface NoteQueryStore {
|
|
983
983
|
getAllNotes(): Promise<Note[]>;
|
|
984
|
+
/** Scoped hydration of actionable block parents. */
|
|
985
|
+
getNotesByIds?(noteIds: readonly string[]): Promise<Note[]>;
|
|
984
986
|
getNoteIdsForTag(label: string): Promise<Set<string>>;
|
|
985
987
|
/** Note-tags label set of one note (moved here from FactQueryStore — it
|
|
986
988
|
* reads note tags, not facts). */
|
|
@@ -1099,9 +1101,11 @@ interface EffortQueryStore {
|
|
|
1099
1101
|
* domain parser's 64-value limit) straight through without mapping. WQL
|
|
1100
1102
|
* reads only `label` off each tag record and never imports storage. */
|
|
1101
1103
|
interface NoteRelationBundle {
|
|
1102
|
-
/** The note's junction tag records
|
|
1104
|
+
/** The note's junction tag records — label plus its configured tag type
|
|
1105
|
+
* (domain, equipment, custom types), the property grouping resolves by. */
|
|
1103
1106
|
tags: ReadonlyArray<{
|
|
1104
1107
|
label: string;
|
|
1108
|
+
type?: string;
|
|
1105
1109
|
}>;
|
|
1106
1110
|
/** page_notes junction rows for the note; first by position is the
|
|
1107
1111
|
* parent page. */
|
|
@@ -1116,8 +1120,6 @@ interface QueryServiceStores {
|
|
|
1116
1120
|
* seed importer materializes corpus rows into the same store). */
|
|
1117
1121
|
blockStore?: BlockQueryStore;
|
|
1118
1122
|
effortStore?: EffortQueryStore;
|
|
1119
|
-
/** Derived corpus-note projections (catalog/tag planes). */
|
|
1120
|
-
staticNoteStore?: NoteQueryStore;
|
|
1121
1123
|
/** Serves exercise containment rows (`block_efforts` store). */
|
|
1122
1124
|
blockEffortsStore?: {
|
|
1123
1125
|
getAllFromIndex(index: string, key: string): Promise<any[]>;
|
|
@@ -1364,14 +1366,13 @@ declare class QueryService {
|
|
|
1364
1366
|
private readonly noteStore;
|
|
1365
1367
|
private readonly blockStore;
|
|
1366
1368
|
private readonly effortStore;
|
|
1367
|
-
private readonly staticNoteStore?;
|
|
1368
1369
|
private readonly pageStore?;
|
|
1369
1370
|
private readonly relationStore?;
|
|
1370
1371
|
private readonly datasetStore?;
|
|
1371
1372
|
private blockEffortsStore;
|
|
1372
1373
|
private tagsStore;
|
|
1373
1374
|
private noteTagsStore;
|
|
1374
|
-
constructor(storesOrEventStore?: QueryServiceStores | EventStore, noteStore?: NoteQueryStore, blockStore?: BlockQueryStore, effortStore?: EffortQueryStore
|
|
1375
|
+
constructor(storesOrEventStore?: QueryServiceStores | EventStore, noteStore?: NoteQueryStore, blockStore?: BlockQueryStore, effortStore?: EffortQueryStore);
|
|
1375
1376
|
/** Windowed flat-fact fetch — the projected view over the event store. */
|
|
1376
1377
|
getFactsByTimeRange(start: number, end: number): Promise<AnalyticsDataPoint[]>;
|
|
1377
1378
|
runQuery(raw: string, options?: QueryOptions): Promise<QueryResult>;
|
|
@@ -1404,6 +1405,7 @@ declare class QueryService {
|
|
|
1404
1405
|
* is injected — one bundle read per run instead of a link/page read per
|
|
1405
1406
|
* matched note. */
|
|
1406
1407
|
private containersForNotes;
|
|
1408
|
+
private hydrateBlocks;
|
|
1407
1409
|
/**
|
|
1408
1410
|
* Execute a :block query against the derived block_index store.
|
|
1409
1411
|
*/
|
|
@@ -1725,10 +1727,9 @@ declare function resolveCanonicalMetricKey(projectionName: string): string;
|
|
|
1725
1727
|
interface SummaryFactIdentity {
|
|
1726
1728
|
noteId: string;
|
|
1727
1729
|
resultId: string;
|
|
1728
|
-
/**
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
segmentVersion?: number;
|
|
1730
|
+
/** Actionable occurrence and saved revision that produced the result. */
|
|
1731
|
+
blockId?: string;
|
|
1732
|
+
blockVersion?: number;
|
|
1732
1733
|
/** Content-stable cross-note join key. */
|
|
1733
1734
|
blockContentId?: string;
|
|
1734
1735
|
/** Which surface produced the result; trend queries exclude 'playground' by default. */
|
|
@@ -1800,36 +1801,6 @@ declare function projectEventToFacts(record: EventRecord): AnalyticsDataPoint[];
|
|
|
1800
1801
|
*/
|
|
1801
1802
|
declare function eventsToStoredLogs(events: readonly EventRecord[]): StoredOutputStatement[];
|
|
1802
1803
|
|
|
1803
|
-
/**
|
|
1804
|
-
* Landing/catalog projection for a block row, derived from its sourceId route
|
|
1805
|
-
* (`collection:<catalog>/<item>`, `page:collection:<catalog>`,
|
|
1806
|
-
* `feed:feeds/<catalog>/…`) — never from `noteId`, which is a UUID for
|
|
1807
|
-
* imported notes. Legacy path-keyed rows keep deriving from the noteId stem
|
|
1808
|
-
* through `catalogOfItem` (undefined for UUID or no path); a bare
|
|
1809
|
-
* `collection:<catalog>` route is the legacy landing and gets its canonical
|
|
1810
|
-
* `page:collection:` sourceId.
|
|
1811
|
-
*/
|
|
1812
|
-
declare function staticCatalogRoute(block: Pick<BlockIndexRow, 'noteId' | 'sourceId'>): {
|
|
1813
|
-
landing: boolean;
|
|
1814
|
-
catalog?: string;
|
|
1815
|
-
sourceId?: string;
|
|
1816
|
-
};
|
|
1817
|
-
/**
|
|
1818
|
-
* Pure projection of a block_index into static Notes — one Note per distinct
|
|
1819
|
-
* noteId. `id` stays the canonical storage identity (UUID for imported rows);
|
|
1820
|
-
* `catalog` and feed-landing status come from the sourceId route, not
|
|
1821
|
-
* the noteId path. The catalog (e.g. `crossfit-girls`) is what the Library's
|
|
1822
|
-
* panel uses to target the `+ Filter → Catalog` menu.
|
|
1823
|
-
*/
|
|
1824
|
-
declare function staticNotesFromBlocks(blocks: BlockIndexRow[]): Note[];
|
|
1825
|
-
/**
|
|
1826
|
-
* Tag → noteIds index over a block index's frontmatter rows. Static-corpus
|
|
1827
|
-
* notes declare tags only in frontmatter `tags:`; this recovers the mapping
|
|
1828
|
-
* the note store needs to answer `tags:` clauses (issue #853 — the store
|
|
1829
|
-
* previously returned an empty set for every tag).
|
|
1830
|
-
*/
|
|
1831
|
-
declare function staticTagIndexFromBlocks(blocks: BlockIndexRow[]): Map<string, Set<string>>;
|
|
1832
|
-
|
|
1833
1804
|
/**
|
|
1834
1805
|
* Dashboard Note model (#898 map, format locked in #899).
|
|
1835
1806
|
*
|
|
@@ -2064,6 +2035,7 @@ declare function parseFrontmatterProps(lines: string[]): Record<string, string>;
|
|
|
2064
2035
|
* itself. Move/duplicate/remove operate on the whole group so the rendered
|
|
2065
2036
|
* card — title, question, chart — travels together.
|
|
2066
2037
|
*/
|
|
2038
|
+
|
|
2067
2039
|
interface WidgetSpec {
|
|
2068
2040
|
/** Card title — renders as a `## ` heading above the block. */
|
|
2069
2041
|
title?: string;
|
|
@@ -2099,6 +2071,13 @@ declare function appendWidget(raw: string, spec: WidgetSpec): string;
|
|
|
2099
2071
|
type WidgetOpResult = {
|
|
2100
2072
|
ok: true;
|
|
2101
2073
|
note: string;
|
|
2074
|
+
changes: NoteBlockChange[];
|
|
2075
|
+
retainedBlocks: Array<{
|
|
2076
|
+
from: number;
|
|
2077
|
+
to: number;
|
|
2078
|
+
nextFrom: number;
|
|
2079
|
+
nextTo: number;
|
|
2080
|
+
}>;
|
|
2102
2081
|
} | {
|
|
2103
2082
|
ok: false;
|
|
2104
2083
|
reason: 'not-found' | 'stale-body';
|
|
@@ -2142,13 +2121,13 @@ declare function migrateLegacyDashboardBodies(raw: string): string;
|
|
|
2142
2121
|
* Auto-generated build version metadata.
|
|
2143
2122
|
* Do not edit directly; updated by scripts/stamp-version.ts
|
|
2144
2123
|
*/
|
|
2145
|
-
declare const VERSION = "0.35.
|
|
2146
|
-
declare const GIT_SHA = "
|
|
2147
|
-
declare const BUILD_TIME = "2026-10-
|
|
2124
|
+
declare const VERSION = "0.35.2119";
|
|
2125
|
+
declare const GIT_SHA = "e0eb840";
|
|
2126
|
+
declare const BUILD_TIME = "2026-10-13T06:24:52.520Z";
|
|
2148
2127
|
declare const SEMVER: {
|
|
2149
|
-
readonly version: "0.35.
|
|
2150
|
-
readonly gitSha: "
|
|
2151
|
-
readonly buildTime: "2026-10-
|
|
2128
|
+
readonly version: "0.35.2119";
|
|
2129
|
+
readonly gitSha: "e0eb840";
|
|
2130
|
+
readonly buildTime: "2026-10-13T06:24:52.520Z";
|
|
2152
2131
|
};
|
|
2153
2132
|
|
|
2154
|
-
export { type Aggregator, type AnyParsedQuery, BUILD_TIME, type BlockQueryStore, CONTENT_GROUPING_DIMENSIONS, type CatalogFieldSuggestion, type CatalogValueSuggestion, type ComparisonOp, DASHBOARD_GRID_MAX_COLS, DASHBOARD_WIDGET_TYPES, DEFAULT_DASHBOARD_TITLE, DISCIPLINE_FACTORS, type DashboardDocument, type DashboardMeta, type DashboardParsedSection, type DashboardSectionInput, type DashboardToken, type DashboardWidget, type DashboardWidgetType, type DocumentAssignment, type DocumentDefaults, type DocumentFormula, type DocumentOutput, type DocumentResult, EFFORT_DISCIPLINES, type EffortDiscipline, type EffortQueryStore, type EventRowIdentity, type EventStore, type ExecutionContext, type FamilyRunPayload, type FindOptions, type FindPredicate, type FindQueryResult, type FormulaEvaluation, type FormulaEvaluator, GIT_SHA, type IEffort, type IFieldCatalog, type LinkWidget, type MetricPredicate, type NoteContainer, type NoteQueryStore, type NoteRelationBundle, type OperandValue, type OutputUnitResolution, PLANNED_WIDGET_TYPES, type PageSourceEntry, PageSourceRegistry, type ParsedAggregateQuery, type ParsedDocument, type ParsedFindQuery, type ParsedFrontmatter, type ParsedPipelineQuery, type ParsedRowsQuery, type ParsedWqlRollupSuffix, type ParsedWqlSuffixes, type ParsedWqlWindowSuffix, type PipelineOptions, type PipelineResult, type PipelineSink, type PipelineSource, type PointwiseInputs, type QueryDocument, QueryDocumentRunner$1 as QueryDocumentRunner, type QueryDocumentRunnerHost, type QueryDocumentRunnerOptions, type QueryOptions, type QueryResult, QueryService, type QueryServiceStores, type QueryWidgetSuffix, type QueryWindow, type ResolvedRange, type RowsPipes, type RowsQueryResult, type RowsRun, SEMVER, type Series, type SeriesPoint, QueryDocumentRunner as SharedQueryDocumentRunner, type SharedRunnerOptions, type SummaryFactIdentity, type SummaryFactSourceOutput, type TabularColumn, type TabularGroup, type TabularResult, type TagFilter, type TagValue, UNASSIGNED, type UnitBearingFact, type UnitFamily, VERSION, WQL_AGGREGATORS, WQL_CALC_TARGETS, WQL_CHART_HEADS, WQL_COMPARISON_OPS, WQL_CONTENT_FILTER_KEYS, WQL_CONTENT_ONLY_KEYS, WQL_DISPLAY_UNITS, WQL_EFFORT_FILTER_KEYS, WQL_FIND_TARGETS, WQL_FUNCTION_HEADS, WQL_GRAINS, WQL_INTENSITY_TIERS, WQL_KEYWORDS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_NOTE_DEFAULT_SOURCES, WQL_RESULT_PLANES, WQL_ROLLUP_PERIODS, WQL_SOURCES, WQL_SOURCE_HEADS, WQL_SOURCE_HEAD_SCOPES, WQL_SOURCE_VALUES, WQL_STANDARD_DATASETS, WQL_TAG_KEYS, WQL_TYPED_TAG_KEYS, WQL_TYPE_HEADS, WQL_VIRTUAL_DIMS, type WidgetOpResult, type WidgetSpan, type WidgetSpec, type WqlAggregator, type WqlCalcTarget, type WqlChartHead, type WqlComparisonOp, type WqlCompletionOptions, type WqlContentFilterKey, type WqlDisplayUnit, type WqlDomainOrder, type WqlDomainPredicate, type WqlDomainReadResult, type WqlFindTarget, type WqlFunctionHead, type WqlGrain, type WqlIntensityTier, type WqlKeyword, type WqlMetricAggregate, type WqlMetricFamily, type WqlResultPlane, type WqlRollupPeriod, type WqlSource, type WqlSourceHead, type WqlSourceValue, type WqlStandardDataset, type WqlTagKey, type WqlTypedTagKey, type WqlVirtualDim, allowedFilterTypesForTarget, appendSuffixes, appendWidget, buildDashboardDocument, buildDashboardScaffold, buildDrillDownQuery, captureContext, catalogOfItem, civilDateAdd, civilDateDiff, civilDateOf, civilDatesCoveredByRange, civilMonday, consumesRollupFacts, convertDisplay, createBuiltinFormulaEvaluator, dashboardSlug, defaultTokenValues, disciplineFactorFor, duplicateWidget, eventsToStoredLogs, extractDashboardTokens, extractFrontmatterTags, findTargetAdvisories, getList, getScalar, getUnitFamily, inRange, isAggregateQuery, isDashboardMeta, isDashboardWidgetType, isEffortDiscipline, isFindQuery, isPipelineQuery, isProposedMetric, migrateLegacyDashboardBodies, moveWidget, normalizeSummaryFacts, normalizeWql, parseDashboardNote, parseDocument, parseFlatProperties, parseFrontmatter, parseFrontmatterBody, parseFrontmatterCategories, parseFrontmatterProps, parseQuery, parseQueryWidgetSuffix, parseWqlSuffixes, projectEventToFacts, referencedTokens, removeWidget, renderWidgetGroup, resizeWidget, resolveCanonicalMetricKey, resolveOutputUnit, resolveWidgetType, resolveWindowRange, rowsParseError, serialize, serializeDocument, serializeFrontmatter, setDashboardTokenValue, sourceMatches, splitAtWhere,
|
|
2133
|
+
export { type Aggregator, type AnyParsedQuery, BUILD_TIME, type BlockQueryStore, CONTENT_GROUPING_DIMENSIONS, type CatalogFieldSuggestion, type CatalogValueSuggestion, type ComparisonOp, DASHBOARD_GRID_MAX_COLS, DASHBOARD_WIDGET_TYPES, DEFAULT_DASHBOARD_TITLE, DISCIPLINE_FACTORS, type DashboardDocument, type DashboardMeta, type DashboardParsedSection, type DashboardSectionInput, type DashboardToken, type DashboardWidget, type DashboardWidgetType, type DocumentAssignment, type DocumentDefaults, type DocumentFormula, type DocumentOutput, type DocumentResult, EFFORT_DISCIPLINES, type EffortDiscipline, type EffortQueryStore, type EventRowIdentity, type EventStore, type ExecutionContext, type FamilyRunPayload, type FindOptions, type FindPredicate, type FindQueryResult, type FormulaEvaluation, type FormulaEvaluator, GIT_SHA, type IEffort, type IFieldCatalog, type LinkWidget, type MetricPredicate, type NoteContainer, type NoteQueryStore, type NoteRelationBundle, type OperandValue, type OutputUnitResolution, PLANNED_WIDGET_TYPES, type PageSourceEntry, PageSourceRegistry, type ParsedAggregateQuery, type ParsedDocument, type ParsedFindQuery, type ParsedFrontmatter, type ParsedPipelineQuery, type ParsedRowsQuery, type ParsedWqlRollupSuffix, type ParsedWqlSuffixes, type ParsedWqlWindowSuffix, type PipelineOptions, type PipelineResult, type PipelineSink, type PipelineSource, type PointwiseInputs, type QueryDocument, QueryDocumentRunner$1 as QueryDocumentRunner, type QueryDocumentRunnerHost, type QueryDocumentRunnerOptions, type QueryOptions, type QueryResult, QueryService, type QueryServiceStores, type QueryWidgetSuffix, type QueryWindow, type ResolvedRange, type RowsPipes, type RowsQueryResult, type RowsRun, SEMVER, type Series, type SeriesPoint, QueryDocumentRunner as SharedQueryDocumentRunner, type SharedRunnerOptions, type SummaryFactIdentity, type SummaryFactSourceOutput, type TabularColumn, type TabularGroup, type TabularResult, type TagFilter, type TagValue, UNASSIGNED, type UnitBearingFact, type UnitFamily, VERSION, WQL_AGGREGATORS, WQL_CALC_TARGETS, WQL_CHART_HEADS, WQL_COMPARISON_OPS, WQL_CONTENT_FILTER_KEYS, WQL_CONTENT_ONLY_KEYS, WQL_DISPLAY_UNITS, WQL_EFFORT_FILTER_KEYS, WQL_FIND_TARGETS, WQL_FUNCTION_HEADS, WQL_GRAINS, WQL_INTENSITY_TIERS, WQL_KEYWORDS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_NOTE_DEFAULT_SOURCES, WQL_RESULT_PLANES, WQL_ROLLUP_PERIODS, WQL_SOURCES, WQL_SOURCE_HEADS, WQL_SOURCE_HEAD_SCOPES, WQL_SOURCE_VALUES, WQL_STANDARD_DATASETS, WQL_TAG_KEYS, WQL_TYPED_TAG_KEYS, WQL_TYPE_HEADS, WQL_VIRTUAL_DIMS, type WidgetOpResult, type WidgetSpan, type WidgetSpec, type WqlAggregator, type WqlCalcTarget, type WqlChartHead, type WqlComparisonOp, type WqlCompletionOptions, type WqlContentFilterKey, type WqlDisplayUnit, type WqlDomainOrder, type WqlDomainPredicate, type WqlDomainReadResult, type WqlFindTarget, type WqlFunctionHead, type WqlGrain, type WqlIntensityTier, type WqlKeyword, type WqlMetricAggregate, type WqlMetricFamily, type WqlResultPlane, type WqlRollupPeriod, type WqlSource, type WqlSourceHead, type WqlSourceValue, type WqlStandardDataset, type WqlTagKey, type WqlTypedTagKey, type WqlVirtualDim, allowedFilterTypesForTarget, appendSuffixes, appendWidget, buildDashboardDocument, buildDashboardScaffold, buildDrillDownQuery, captureContext, catalogOfItem, civilDateAdd, civilDateDiff, civilDateOf, civilDatesCoveredByRange, civilMonday, consumesRollupFacts, convertDisplay, createBuiltinFormulaEvaluator, dashboardSlug, defaultTokenValues, disciplineFactorFor, duplicateWidget, eventsToStoredLogs, extractDashboardTokens, extractFrontmatterTags, findTargetAdvisories, getList, getScalar, getUnitFamily, inRange, isAggregateQuery, isDashboardMeta, isDashboardWidgetType, isEffortDiscipline, isFindQuery, isPipelineQuery, isProposedMetric, migrateLegacyDashboardBodies, moveWidget, normalizeSummaryFacts, normalizeWql, parseDashboardNote, parseDocument, parseFlatProperties, parseFrontmatter, parseFrontmatterBody, parseFrontmatterCategories, parseFrontmatterProps, parseQuery, parseQueryWidgetSuffix, parseWqlSuffixes, projectEventToFacts, referencedTokens, removeWidget, renderWidgetGroup, resizeWidget, resolveCanonicalMetricKey, resolveOutputUnit, resolveWidgetType, resolveWindowRange, rowsParseError, serialize, serializeDocument, serializeFrontmatter, setDashboardTokenValue, sourceMatches, splitAtWhere, stripFrontmatter, substituteTokens, substituteTokens$1 as substituteTokensRaw, supportsWqlFilterKey, systemTimeZone, toEventRows, toSummaryEventRows, unknownTokensMessage, unknownWidgetTypeMessage, updateWidget, widgetBodyLine, widgetFenceTag, wql, wqlCompletion, wqlCompletionSource, wqlFilterKeys, wqlGroupingDimensions, wqlHighlightStyle, wqlLanguage, parser as wqlParser, wql_parser_terms as wqlTerms, zonedNoon, zonedStartOfDay };
|