@bitcobblers/wod-wiki-wql 0.7.38 → 0.8.39
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 +79 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -11
- package/dist/index.d.ts +29 -11
- package/dist/index.mjs +77 -59
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -61,6 +61,23 @@ type WqlFindTarget = (typeof WQL_FIND_TARGETS)[number];
|
|
|
61
61
|
/** Content query scopes (in <scope>). */
|
|
62
62
|
declare const WQL_SCOPES: readonly ["journal", "collections", "feeds", "all"];
|
|
63
63
|
type WqlScope = (typeof WQL_SCOPES)[number];
|
|
64
|
+
/** Result planes — `rows:<plane>` narrows raw output-statement rows by the
|
|
65
|
+
* unified store's promoted `outputType` column. The STORE vocabulary is
|
|
66
|
+
* open (core KNOWN_OUTPUT_TYPES, ticket 002: unknowns are stored and
|
|
67
|
+
* returned); the QUERY surface is a closed enum at parse (prototype C7) —
|
|
68
|
+
* reopening toward a registry is a later, separate decision. Custom types
|
|
69
|
+
* stay addressable programmatically via hand-built ASTs. */
|
|
70
|
+
declare const WQL_RESULT_PLANES: readonly ["segment", "system", "load", "event", "compiler", "completion", "analytics", "wellness"];
|
|
71
|
+
type WqlResultPlane = (typeof WQL_RESULT_PLANES)[number];
|
|
72
|
+
/** All `rows:` targets — content planes plus result planes (rows model
|
|
73
|
+
* §1.0: every query selects rows from a target) plus `all`, the explicit
|
|
74
|
+
* no-narrowing pseudo-target (spec v2 decision 1: the bare `rows:{…}`
|
|
75
|
+
* alias retires). Content-plane targets scope by content, not outputType
|
|
76
|
+
* (C4). */
|
|
77
|
+
declare const WQL_ROWS_TARGETS: readonly ["note", "block", "effort", "segment", "system", "load", "event", "compiler", "completion", "analytics", "wellness", "all"];
|
|
78
|
+
type WqlRowsTarget = (typeof WQL_ROWS_TARGETS)[number];
|
|
79
|
+
/** Rows scope filter keys (C4): the exact-match keys a rows query filters by. */
|
|
80
|
+
declare const WQL_ROWS_SCOPE_KEYS: readonly ["result", "block", "note"];
|
|
64
81
|
/** Content-specific filter keys (beyond the analytics tag keys). */
|
|
65
82
|
declare const WQL_CONTENT_FILTER_KEYS: readonly ["type", "text", "has", "source", "catalog", "effort", "discipline", "intensity", "note", "page", "origin", "grain", "metric", "block", "result", "tags"];
|
|
66
83
|
type WqlContentFilterKey = (typeof WQL_CONTENT_FILTER_KEYS)[number];
|
|
@@ -265,7 +282,7 @@ interface ParsedAggregateQuery {
|
|
|
265
282
|
interface ParsedFindQuery {
|
|
266
283
|
family: 'find';
|
|
267
284
|
raw: string;
|
|
268
|
-
/** Content target
|
|
285
|
+
/** Content target — a WQL_FIND_TARGETS value (C7 closed enum). */
|
|
269
286
|
target: string;
|
|
270
287
|
filters: TagFilter[];
|
|
271
288
|
/** Where to look: journal | collections | feeds | all. */
|
|
@@ -681,9 +698,10 @@ declare class QueryService {
|
|
|
681
698
|
getFactsByTimeRange(start: number, end: number): Promise<AnalyticsDataPoint[]>;
|
|
682
699
|
runQuery(raw: string, options?: QueryOptions): Promise<QueryResult>;
|
|
683
700
|
/**
|
|
684
|
-
* Execute a rows query (rows
|
|
685
|
-
*
|
|
686
|
-
*
|
|
701
|
+
* Execute a rows query (rows:<target>{…}, #949/C4) — the session results
|
|
702
|
+
* table plane. Filter rules are validated at parse; this executes only.
|
|
703
|
+
* Reads event rows directly over the unified store: outputType narrowing
|
|
704
|
+
* hits the promoted column; content-plane targets scope by content.
|
|
687
705
|
*/
|
|
688
706
|
runRows(parsed: ParsedRowsQuery, options?: {
|
|
689
707
|
anchorNow?: number;
|
|
@@ -956,13 +974,13 @@ declare function parseFrontmatterProps(lines: string[]): Record<string, string>;
|
|
|
956
974
|
* Auto-generated build version metadata.
|
|
957
975
|
* Do not edit directly; updated by scripts/stamp-version.ts
|
|
958
976
|
*/
|
|
959
|
-
declare const VERSION = "0.
|
|
960
|
-
declare const GIT_SHA = "
|
|
961
|
-
declare const BUILD_TIME = "2026-08-
|
|
977
|
+
declare const VERSION = "0.8.39";
|
|
978
|
+
declare const GIT_SHA = "3c19185";
|
|
979
|
+
declare const BUILD_TIME = "2026-08-26T00:07:31.934Z";
|
|
962
980
|
declare const SEMVER: {
|
|
963
|
-
readonly version: "0.
|
|
964
|
-
readonly gitSha: "
|
|
965
|
-
readonly buildTime: "2026-08-
|
|
981
|
+
readonly version: "0.8.39";
|
|
982
|
+
readonly gitSha: "3c19185";
|
|
983
|
+
readonly buildTime: "2026-08-26T00:07:31.934Z";
|
|
966
984
|
};
|
|
967
985
|
|
|
968
|
-
export { type Aggregator, type AnyParsedQuery, BUILD_TIME, type BlockQueryStore, 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, EFFORT_DISCIPLINES, type EffortDiscipline, type EffortQueryStore, type EventRowIdentity, type FindOptions, type FindPredicate, type FindQueryResult, GIT_SHA, type IEffort, KG_PER_LB, type LinkWidget, type MetricPredicate, type NoteQueryStore, PLANNED_WIDGET_TYPES, type ParsedAggregateQuery, type ParsedFindQuery, type ParsedFrontmatter, type ParsedRowsQuery, type ParsedWqlLastSuffix, type ParsedWqlRollupSuffix, type ParsedWqlSuffixes, type QueryOptions, type QueryResult, QueryService, type QueryServiceStores, type QueryWidgetSuffix, type RowsQueryResult, type RowsRun, SEMVER, type Series, type SeriesPoint, type SummaryFactIdentity, type SummaryFactSourceOutput, type TagFilter, type TagValue, UNIT_FAMILIES, type UnifiedEventStore, type UnitFamily, type UnitFamilyDef, VERSION, WQL_AGGREGATORS, WQL_CALC_TARGETS, WQL_COMPARISON_OPS, WQL_CONTENT_FILTER_KEYS, WQL_DISPLAY_UNITS, WQL_FIND_TARGETS, WQL_GRAINS, WQL_INTENSITY_TIERS, WQL_KEYWORDS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_ROLLUP_PERIODS, WQL_SCOPES, WQL_SOURCES, WQL_TAG_KEYS, WQL_VIRTUAL_DIMS, type WqlAggregator, type WqlCalcTarget, type WqlComparisonOp, type WqlCompletionOptions, type WqlContentFilterKey, type WqlDisplayUnit, type WqlFindTarget, type WqlGrain, type WqlIntensityTier, type WqlKeyword, type WqlMetricAggregate, type WqlMetricFamily, type WqlRollupPeriod, type WqlScope, type WqlSource, type WqlTagKey, type WqlVirtualDim, buildDashboardDocument, buildDashboardScaffold, convert, dashboardSlug, defaultTokenValues, disciplineFactorFor, extractDashboardTokens, extractFrontmatterTags, getList, getScalar, getUnitFamily, isAggregateQuery, isDashboardMeta, isDashboardWidgetType, isEffortDiscipline, isFindQuery, isProposedMetric, isRowsQuery, normalizeSummaryFacts, parseDashboardNote, parseFlatProperties, parseFrontmatter, parseFrontmatterBody, parseFrontmatterCategories, parseFrontmatterProps, parseQuery, parseQueryWidgetSuffix, parseWqlSuffixes, projectEventToFacts, referencedTokens, resolveCanonicalMetricKey, resolveDisplayUnit, resolveWidgetType, serializeFrontmatter, setDashboardTokenValue, splitAtWhere, splitWidgetBody, staticNotesFromBlocks, staticTagIndexFromBlocks, stripFrontmatter, substituteTokens, toEventRows, toSummaryEventRows, unknownTokensMessage, unknownWidgetTypeMessage, wql, wqlCompletion, wqlCompletionSource, wqlHighlightStyle, wqlLanguage, parser as wqlParser, wql_parser_terms as wqlTerms };
|
|
986
|
+
export { type Aggregator, type AnyParsedQuery, BUILD_TIME, type BlockQueryStore, 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, EFFORT_DISCIPLINES, type EffortDiscipline, type EffortQueryStore, type EventRowIdentity, type FindOptions, type FindPredicate, type FindQueryResult, GIT_SHA, type IEffort, KG_PER_LB, type LinkWidget, type MetricPredicate, type NoteQueryStore, PLANNED_WIDGET_TYPES, type ParsedAggregateQuery, type ParsedFindQuery, type ParsedFrontmatter, type ParsedRowsQuery, type ParsedWqlLastSuffix, type ParsedWqlRollupSuffix, type ParsedWqlSuffixes, type QueryOptions, type QueryResult, QueryService, type QueryServiceStores, type QueryWidgetSuffix, type RowsQueryResult, type RowsRun, SEMVER, type Series, type SeriesPoint, type SummaryFactIdentity, type SummaryFactSourceOutput, type TagFilter, type TagValue, UNIT_FAMILIES, type UnifiedEventStore, type UnitFamily, type UnitFamilyDef, VERSION, WQL_AGGREGATORS, WQL_CALC_TARGETS, WQL_COMPARISON_OPS, WQL_CONTENT_FILTER_KEYS, WQL_DISPLAY_UNITS, WQL_FIND_TARGETS, WQL_GRAINS, WQL_INTENSITY_TIERS, WQL_KEYWORDS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_RESULT_PLANES, WQL_ROLLUP_PERIODS, WQL_ROWS_SCOPE_KEYS, WQL_ROWS_TARGETS, WQL_SCOPES, WQL_SOURCES, WQL_TAG_KEYS, WQL_VIRTUAL_DIMS, type WqlAggregator, type WqlCalcTarget, type WqlComparisonOp, type WqlCompletionOptions, type WqlContentFilterKey, type WqlDisplayUnit, type WqlFindTarget, type WqlGrain, type WqlIntensityTier, type WqlKeyword, type WqlMetricAggregate, type WqlMetricFamily, type WqlResultPlane, type WqlRollupPeriod, type WqlRowsTarget, type WqlScope, type WqlSource, type WqlTagKey, type WqlVirtualDim, buildDashboardDocument, buildDashboardScaffold, convert, dashboardSlug, defaultTokenValues, disciplineFactorFor, extractDashboardTokens, extractFrontmatterTags, getList, getScalar, getUnitFamily, isAggregateQuery, isDashboardMeta, isDashboardWidgetType, isEffortDiscipline, isFindQuery, isProposedMetric, isRowsQuery, normalizeSummaryFacts, parseDashboardNote, parseFlatProperties, parseFrontmatter, parseFrontmatterBody, parseFrontmatterCategories, parseFrontmatterProps, parseQuery, parseQueryWidgetSuffix, parseWqlSuffixes, projectEventToFacts, referencedTokens, resolveCanonicalMetricKey, resolveDisplayUnit, resolveWidgetType, serializeFrontmatter, setDashboardTokenValue, splitAtWhere, splitWidgetBody, staticNotesFromBlocks, staticTagIndexFromBlocks, stripFrontmatter, substituteTokens, toEventRows, toSummaryEventRows, unknownTokensMessage, unknownWidgetTypeMessage, wql, wqlCompletion, wqlCompletionSource, wqlHighlightStyle, wqlLanguage, parser as wqlParser, wql_parser_terms as wqlTerms };
|
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,23 @@ type WqlFindTarget = (typeof WQL_FIND_TARGETS)[number];
|
|
|
61
61
|
/** Content query scopes (in <scope>). */
|
|
62
62
|
declare const WQL_SCOPES: readonly ["journal", "collections", "feeds", "all"];
|
|
63
63
|
type WqlScope = (typeof WQL_SCOPES)[number];
|
|
64
|
+
/** Result planes — `rows:<plane>` narrows raw output-statement rows by the
|
|
65
|
+
* unified store's promoted `outputType` column. The STORE vocabulary is
|
|
66
|
+
* open (core KNOWN_OUTPUT_TYPES, ticket 002: unknowns are stored and
|
|
67
|
+
* returned); the QUERY surface is a closed enum at parse (prototype C7) —
|
|
68
|
+
* reopening toward a registry is a later, separate decision. Custom types
|
|
69
|
+
* stay addressable programmatically via hand-built ASTs. */
|
|
70
|
+
declare const WQL_RESULT_PLANES: readonly ["segment", "system", "load", "event", "compiler", "completion", "analytics", "wellness"];
|
|
71
|
+
type WqlResultPlane = (typeof WQL_RESULT_PLANES)[number];
|
|
72
|
+
/** All `rows:` targets — content planes plus result planes (rows model
|
|
73
|
+
* §1.0: every query selects rows from a target) plus `all`, the explicit
|
|
74
|
+
* no-narrowing pseudo-target (spec v2 decision 1: the bare `rows:{…}`
|
|
75
|
+
* alias retires). Content-plane targets scope by content, not outputType
|
|
76
|
+
* (C4). */
|
|
77
|
+
declare const WQL_ROWS_TARGETS: readonly ["note", "block", "effort", "segment", "system", "load", "event", "compiler", "completion", "analytics", "wellness", "all"];
|
|
78
|
+
type WqlRowsTarget = (typeof WQL_ROWS_TARGETS)[number];
|
|
79
|
+
/** Rows scope filter keys (C4): the exact-match keys a rows query filters by. */
|
|
80
|
+
declare const WQL_ROWS_SCOPE_KEYS: readonly ["result", "block", "note"];
|
|
64
81
|
/** Content-specific filter keys (beyond the analytics tag keys). */
|
|
65
82
|
declare const WQL_CONTENT_FILTER_KEYS: readonly ["type", "text", "has", "source", "catalog", "effort", "discipline", "intensity", "note", "page", "origin", "grain", "metric", "block", "result", "tags"];
|
|
66
83
|
type WqlContentFilterKey = (typeof WQL_CONTENT_FILTER_KEYS)[number];
|
|
@@ -265,7 +282,7 @@ interface ParsedAggregateQuery {
|
|
|
265
282
|
interface ParsedFindQuery {
|
|
266
283
|
family: 'find';
|
|
267
284
|
raw: string;
|
|
268
|
-
/** Content target
|
|
285
|
+
/** Content target — a WQL_FIND_TARGETS value (C7 closed enum). */
|
|
269
286
|
target: string;
|
|
270
287
|
filters: TagFilter[];
|
|
271
288
|
/** Where to look: journal | collections | feeds | all. */
|
|
@@ -681,9 +698,10 @@ declare class QueryService {
|
|
|
681
698
|
getFactsByTimeRange(start: number, end: number): Promise<AnalyticsDataPoint[]>;
|
|
682
699
|
runQuery(raw: string, options?: QueryOptions): Promise<QueryResult>;
|
|
683
700
|
/**
|
|
684
|
-
* Execute a rows query (rows
|
|
685
|
-
*
|
|
686
|
-
*
|
|
701
|
+
* Execute a rows query (rows:<target>{…}, #949/C4) — the session results
|
|
702
|
+
* table plane. Filter rules are validated at parse; this executes only.
|
|
703
|
+
* Reads event rows directly over the unified store: outputType narrowing
|
|
704
|
+
* hits the promoted column; content-plane targets scope by content.
|
|
687
705
|
*/
|
|
688
706
|
runRows(parsed: ParsedRowsQuery, options?: {
|
|
689
707
|
anchorNow?: number;
|
|
@@ -956,13 +974,13 @@ declare function parseFrontmatterProps(lines: string[]): Record<string, string>;
|
|
|
956
974
|
* Auto-generated build version metadata.
|
|
957
975
|
* Do not edit directly; updated by scripts/stamp-version.ts
|
|
958
976
|
*/
|
|
959
|
-
declare const VERSION = "0.
|
|
960
|
-
declare const GIT_SHA = "
|
|
961
|
-
declare const BUILD_TIME = "2026-08-
|
|
977
|
+
declare const VERSION = "0.8.39";
|
|
978
|
+
declare const GIT_SHA = "3c19185";
|
|
979
|
+
declare const BUILD_TIME = "2026-08-26T00:07:31.934Z";
|
|
962
980
|
declare const SEMVER: {
|
|
963
|
-
readonly version: "0.
|
|
964
|
-
readonly gitSha: "
|
|
965
|
-
readonly buildTime: "2026-08-
|
|
981
|
+
readonly version: "0.8.39";
|
|
982
|
+
readonly gitSha: "3c19185";
|
|
983
|
+
readonly buildTime: "2026-08-26T00:07:31.934Z";
|
|
966
984
|
};
|
|
967
985
|
|
|
968
|
-
export { type Aggregator, type AnyParsedQuery, BUILD_TIME, type BlockQueryStore, 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, EFFORT_DISCIPLINES, type EffortDiscipline, type EffortQueryStore, type EventRowIdentity, type FindOptions, type FindPredicate, type FindQueryResult, GIT_SHA, type IEffort, KG_PER_LB, type LinkWidget, type MetricPredicate, type NoteQueryStore, PLANNED_WIDGET_TYPES, type ParsedAggregateQuery, type ParsedFindQuery, type ParsedFrontmatter, type ParsedRowsQuery, type ParsedWqlLastSuffix, type ParsedWqlRollupSuffix, type ParsedWqlSuffixes, type QueryOptions, type QueryResult, QueryService, type QueryServiceStores, type QueryWidgetSuffix, type RowsQueryResult, type RowsRun, SEMVER, type Series, type SeriesPoint, type SummaryFactIdentity, type SummaryFactSourceOutput, type TagFilter, type TagValue, UNIT_FAMILIES, type UnifiedEventStore, type UnitFamily, type UnitFamilyDef, VERSION, WQL_AGGREGATORS, WQL_CALC_TARGETS, WQL_COMPARISON_OPS, WQL_CONTENT_FILTER_KEYS, WQL_DISPLAY_UNITS, WQL_FIND_TARGETS, WQL_GRAINS, WQL_INTENSITY_TIERS, WQL_KEYWORDS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_ROLLUP_PERIODS, WQL_SCOPES, WQL_SOURCES, WQL_TAG_KEYS, WQL_VIRTUAL_DIMS, type WqlAggregator, type WqlCalcTarget, type WqlComparisonOp, type WqlCompletionOptions, type WqlContentFilterKey, type WqlDisplayUnit, type WqlFindTarget, type WqlGrain, type WqlIntensityTier, type WqlKeyword, type WqlMetricAggregate, type WqlMetricFamily, type WqlRollupPeriod, type WqlScope, type WqlSource, type WqlTagKey, type WqlVirtualDim, buildDashboardDocument, buildDashboardScaffold, convert, dashboardSlug, defaultTokenValues, disciplineFactorFor, extractDashboardTokens, extractFrontmatterTags, getList, getScalar, getUnitFamily, isAggregateQuery, isDashboardMeta, isDashboardWidgetType, isEffortDiscipline, isFindQuery, isProposedMetric, isRowsQuery, normalizeSummaryFacts, parseDashboardNote, parseFlatProperties, parseFrontmatter, parseFrontmatterBody, parseFrontmatterCategories, parseFrontmatterProps, parseQuery, parseQueryWidgetSuffix, parseWqlSuffixes, projectEventToFacts, referencedTokens, resolveCanonicalMetricKey, resolveDisplayUnit, resolveWidgetType, serializeFrontmatter, setDashboardTokenValue, splitAtWhere, splitWidgetBody, staticNotesFromBlocks, staticTagIndexFromBlocks, stripFrontmatter, substituteTokens, toEventRows, toSummaryEventRows, unknownTokensMessage, unknownWidgetTypeMessage, wql, wqlCompletion, wqlCompletionSource, wqlHighlightStyle, wqlLanguage, parser as wqlParser, wql_parser_terms as wqlTerms };
|
|
986
|
+
export { type Aggregator, type AnyParsedQuery, BUILD_TIME, type BlockQueryStore, 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, EFFORT_DISCIPLINES, type EffortDiscipline, type EffortQueryStore, type EventRowIdentity, type FindOptions, type FindPredicate, type FindQueryResult, GIT_SHA, type IEffort, KG_PER_LB, type LinkWidget, type MetricPredicate, type NoteQueryStore, PLANNED_WIDGET_TYPES, type ParsedAggregateQuery, type ParsedFindQuery, type ParsedFrontmatter, type ParsedRowsQuery, type ParsedWqlLastSuffix, type ParsedWqlRollupSuffix, type ParsedWqlSuffixes, type QueryOptions, type QueryResult, QueryService, type QueryServiceStores, type QueryWidgetSuffix, type RowsQueryResult, type RowsRun, SEMVER, type Series, type SeriesPoint, type SummaryFactIdentity, type SummaryFactSourceOutput, type TagFilter, type TagValue, UNIT_FAMILIES, type UnifiedEventStore, type UnitFamily, type UnitFamilyDef, VERSION, WQL_AGGREGATORS, WQL_CALC_TARGETS, WQL_COMPARISON_OPS, WQL_CONTENT_FILTER_KEYS, WQL_DISPLAY_UNITS, WQL_FIND_TARGETS, WQL_GRAINS, WQL_INTENSITY_TIERS, WQL_KEYWORDS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_RESULT_PLANES, WQL_ROLLUP_PERIODS, WQL_ROWS_SCOPE_KEYS, WQL_ROWS_TARGETS, WQL_SCOPES, WQL_SOURCES, WQL_TAG_KEYS, WQL_VIRTUAL_DIMS, type WqlAggregator, type WqlCalcTarget, type WqlComparisonOp, type WqlCompletionOptions, type WqlContentFilterKey, type WqlDisplayUnit, type WqlFindTarget, type WqlGrain, type WqlIntensityTier, type WqlKeyword, type WqlMetricAggregate, type WqlMetricFamily, type WqlResultPlane, type WqlRollupPeriod, type WqlRowsTarget, type WqlScope, type WqlSource, type WqlTagKey, type WqlVirtualDim, buildDashboardDocument, buildDashboardScaffold, convert, dashboardSlug, defaultTokenValues, disciplineFactorFor, extractDashboardTokens, extractFrontmatterTags, getList, getScalar, getUnitFamily, isAggregateQuery, isDashboardMeta, isDashboardWidgetType, isEffortDiscipline, isFindQuery, isProposedMetric, isRowsQuery, normalizeSummaryFacts, parseDashboardNote, parseFlatProperties, parseFrontmatter, parseFrontmatterBody, parseFrontmatterCategories, parseFrontmatterProps, parseQuery, parseQueryWidgetSuffix, parseWqlSuffixes, projectEventToFacts, referencedTokens, resolveCanonicalMetricKey, resolveDisplayUnit, resolveWidgetType, serializeFrontmatter, setDashboardTokenValue, splitAtWhere, splitWidgetBody, staticNotesFromBlocks, staticTagIndexFromBlocks, stripFrontmatter, substituteTokens, toEventRows, toSummaryEventRows, unknownTokensMessage, unknownWidgetTypeMessage, wql, wqlCompletion, wqlCompletionSource, wqlHighlightStyle, wqlLanguage, parser as wqlParser, wql_parser_terms as wqlTerms };
|
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
+
import { KNOWN_OUTPUT_TYPES, MetricType } from '@bitcobblers/wod-wiki-core';
|
|
1
2
|
import { LRParser } from '@lezer/lr';
|
|
2
3
|
import { LRLanguage, HighlightStyle, LanguageSupport, syntaxHighlighting, syntaxTree } from '@codemirror/language';
|
|
3
4
|
import { autocompletion, snippetCompletion } from '@codemirror/autocomplete';
|
|
4
5
|
import { styleTags, tags } from '@lezer/highlight';
|
|
5
|
-
import { MetricType } from '@bitcobblers/wod-wiki-core';
|
|
6
6
|
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __export = (target, all) => {
|
|
9
9
|
for (var name in all)
|
|
10
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
// src/vocabulary.ts
|
|
14
12
|
var WQL_METRIC_FAMILIES = ["reps", "distance", "resistance", "elapsed", "power", "pace"];
|
|
15
13
|
var WQL_METRIC_AGGREGATES = ["totalVolume", "totalDistance", "tis", "sessionLoad"];
|
|
16
14
|
var WQL_AGGREGATORS = ["sum", "avg", "min", "max", "count", "last", "delta"];
|
|
@@ -56,6 +54,9 @@ var WQL_INTENSITY_TIERS = ["low", "moderate", "high"];
|
|
|
56
54
|
var WQL_GRAINS = ["summary", "event"];
|
|
57
55
|
var WQL_FIND_TARGETS = ["note", "block", "effort"];
|
|
58
56
|
var WQL_SCOPES = ["journal", "collections", "feeds", "all"];
|
|
57
|
+
var WQL_RESULT_PLANES = KNOWN_OUTPUT_TYPES;
|
|
58
|
+
var WQL_ROWS_TARGETS = [...WQL_FIND_TARGETS, ...WQL_RESULT_PLANES, "all"];
|
|
59
|
+
var WQL_ROWS_SCOPE_KEYS = ["result", "block", "note"];
|
|
59
60
|
var WQL_CONTENT_FILTER_KEYS = ["type", "text", "has", "source", "catalog", ...WQL_TAG_KEYS];
|
|
60
61
|
var WQL_SOURCES = ["journal", "collections", "feeds", "notes", "blocks", "efforts", "metrics"];
|
|
61
62
|
var WQL_ROLLUP_PERIODS = ["1d", "1w"];
|
|
@@ -279,14 +280,28 @@ function parseQuery(raw) {
|
|
|
279
280
|
return parseAnalyticsQuery(raw);
|
|
280
281
|
}
|
|
281
282
|
function cannotParseRows(text) {
|
|
282
|
-
return `Cannot parse "${text}". Expected rows:{result:\u2026|block:\u2026|note:\u2026} or rows:segment{\u2026} last 8w`;
|
|
283
|
+
return `Cannot parse "${text}". Expected rows:all{result:\u2026|block:\u2026|note:\u2026}, rows:<plane>{\u2026}, or rows:segment{\u2026} last 8w`;
|
|
283
284
|
}
|
|
285
|
+
function validateRowsFilters(filters) {
|
|
286
|
+
const scopeKeys = new Set(WQL_ROWS_SCOPE_KEYS);
|
|
287
|
+
const unsupported = filters.filter(
|
|
288
|
+
(f) => !scopeKeys.has(f.key) || f.negate || f.values.some((v) => v.wildcard)
|
|
289
|
+
);
|
|
290
|
+
if (unsupported.length > 0) {
|
|
291
|
+
return `Unsupported rows filter(s): ${unsupported.map((f) => (f.negate ? "!" : "") + f.key).join(", ")}. Rows queries support exact ${WQL_ROWS_SCOPE_KEYS.map((k) => `${k}:`).join(", ")} values.`;
|
|
292
|
+
}
|
|
293
|
+
if (!filters.some((f) => scopeKeys.has(f.key))) {
|
|
294
|
+
return `Rows query needs a scope: ${WQL_ROWS_SCOPE_KEYS.map((k) => `${k}:`).join(", ")}.`;
|
|
295
|
+
}
|
|
296
|
+
return void 0;
|
|
297
|
+
}
|
|
298
|
+
var BARE_ROWS_RETIRED = 'Bare "rows:" is retired \u2014 name a target: rows:all{\u2026} for every output type, or a plane like rows:segment{\u2026}.';
|
|
284
299
|
function parseRowsQuery(raw) {
|
|
285
300
|
const suffixes = parseWqlSuffixes(raw);
|
|
286
301
|
const { where: whereText, last, groupBy, rollup, primaryText } = suffixes;
|
|
287
302
|
const result = {
|
|
288
|
-
raw,
|
|
289
303
|
family: "rows",
|
|
304
|
+
raw,
|
|
290
305
|
filters: [],
|
|
291
306
|
last: last ? { size: last.size, unit: last.unit } : void 0
|
|
292
307
|
};
|
|
@@ -299,41 +314,48 @@ function parseRowsQuery(raw) {
|
|
|
299
314
|
return result;
|
|
300
315
|
}
|
|
301
316
|
const text = primaryText.trim();
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
} else {
|
|
317
|
+
if (/^rows:?\s*[{]?$/.test(text) || /^rows:?\s*[{]/.test(text)) {
|
|
318
|
+
result.error = BARE_ROWS_RETIRED;
|
|
319
|
+
return result;
|
|
320
|
+
}
|
|
321
|
+
const tree = parser.parse(text);
|
|
322
|
+
let syntaxError = false;
|
|
323
|
+
tree.iterate({ enter(node) {
|
|
324
|
+
if (node.type.isError) syntaxError = true;
|
|
325
|
+
} });
|
|
326
|
+
if (syntaxError) {
|
|
313
327
|
result.error = cannotParseRows(text);
|
|
314
328
|
return result;
|
|
315
329
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
result.
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
330
|
+
const query = tree.topNode;
|
|
331
|
+
const head = query.getChild(Head);
|
|
332
|
+
const aggNode = head?.getChild(Aggregator);
|
|
333
|
+
const metricNode = head?.getChild(Metric);
|
|
334
|
+
if (!head || !aggNode || !metricNode) {
|
|
335
|
+
result.error = BARE_ROWS_RETIRED;
|
|
336
|
+
return result;
|
|
337
|
+
}
|
|
338
|
+
const aggText = text.slice(aggNode.from, aggNode.to);
|
|
339
|
+
if (aggText !== "rows") {
|
|
340
|
+
result.error = cannotParseRows(text);
|
|
341
|
+
return result;
|
|
342
|
+
}
|
|
343
|
+
const target = text.slice(metricNode.from, metricNode.to);
|
|
344
|
+
if (!WQL_ROWS_TARGETS.includes(target)) {
|
|
345
|
+
result.error = `Unknown rows target "${target}". Try: ${WQL_ROWS_TARGETS.join(", ")}`;
|
|
346
|
+
return result;
|
|
347
|
+
}
|
|
348
|
+
if (target !== "all") result.outputType = target;
|
|
349
|
+
result.filters = extractFilters(query, text);
|
|
350
|
+
const grainError = retiredGrainRollup(result.filters);
|
|
351
|
+
if (grainError) {
|
|
352
|
+
result.error = grainError;
|
|
353
|
+
return result;
|
|
354
|
+
}
|
|
355
|
+
const filterError = validateRowsFilters(result.filters);
|
|
356
|
+
if (filterError) {
|
|
357
|
+
result.error = filterError;
|
|
358
|
+
return result;
|
|
337
359
|
}
|
|
338
360
|
return result;
|
|
339
361
|
}
|
|
@@ -476,6 +498,10 @@ function parseFindQuery(raw) {
|
|
|
476
498
|
return result;
|
|
477
499
|
}
|
|
478
500
|
result.target = text.slice(metricNode.from, metricNode.to);
|
|
501
|
+
if (!WQL_FIND_TARGETS.includes(result.target)) {
|
|
502
|
+
result.error = `Unknown find target "${result.target}". Try: ${WQL_FIND_TARGETS.join(", ")}`;
|
|
503
|
+
return result;
|
|
504
|
+
}
|
|
479
505
|
result.filters = extractFilters(query, text);
|
|
480
506
|
const findGrainError = retiredGrainRollup(result.filters);
|
|
481
507
|
if (findGrainError) {
|
|
@@ -1093,6 +1119,7 @@ function staticTagIndexFromBlocks(blocks) {
|
|
|
1093
1119
|
|
|
1094
1120
|
// src/QueryService.ts
|
|
1095
1121
|
var DAY = 864e5;
|
|
1122
|
+
var ROWS_CONTENT_PLANES = new Set(WQL_FIND_TARGETS);
|
|
1096
1123
|
function localDateString(ts) {
|
|
1097
1124
|
return new Date(ts).toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
1098
1125
|
}
|
|
@@ -1318,29 +1345,20 @@ var QueryService = class {
|
|
|
1318
1345
|
return this.run(parsed, options2);
|
|
1319
1346
|
}
|
|
1320
1347
|
/**
|
|
1321
|
-
* Execute a rows query (rows
|
|
1322
|
-
*
|
|
1323
|
-
*
|
|
1348
|
+
* Execute a rows query (rows:<target>{…}, #949/C4) — the session results
|
|
1349
|
+
* table plane. Filter rules are validated at parse; this executes only.
|
|
1350
|
+
* Reads event rows directly over the unified store: outputType narrowing
|
|
1351
|
+
* hits the promoted column; content-plane targets scope by content.
|
|
1324
1352
|
*/
|
|
1325
1353
|
async runRows(parsed, options2 = {}) {
|
|
1326
1354
|
const empty = { parsed, runs: [] };
|
|
1327
1355
|
if (parsed.error) return { ...empty, error: parsed.error };
|
|
1328
|
-
const ROWS_SCOPE_KEYS = /* @__PURE__ */ new Set(["result", "block", "note"]);
|
|
1329
|
-
const unsupported = parsed.filters.filter(
|
|
1330
|
-
(f) => !ROWS_SCOPE_KEYS.has(f.key) || f.negate || f.values.some((v) => v.wildcard)
|
|
1331
|
-
);
|
|
1332
|
-
if (unsupported.length > 0) {
|
|
1333
|
-
return {
|
|
1334
|
-
...empty,
|
|
1335
|
-
error: `Unsupported rows filter(s): ${unsupported.map((f) => (f.negate ? "!" : "") + f.key).join(", ")}. Rows queries support exact result:, block:, note: values.`
|
|
1336
|
-
};
|
|
1337
|
-
}
|
|
1338
1356
|
const scopeValues = (key) => parsed.filters.filter((f) => f.key === key).flatMap((f) => f.values.map((v) => v.value));
|
|
1339
1357
|
const resultIds = scopeValues("result");
|
|
1340
1358
|
const blockIds = scopeValues("block");
|
|
1341
1359
|
const noteIds = scopeValues("note");
|
|
1342
1360
|
if (resultIds.length + blockIds.length + noteIds.length === 0) {
|
|
1343
|
-
return { ...empty,
|
|
1361
|
+
return { ...empty, runs: [] };
|
|
1344
1362
|
}
|
|
1345
1363
|
const byResult = /* @__PURE__ */ new Map();
|
|
1346
1364
|
const collect = (rows) => {
|
|
@@ -1364,7 +1382,7 @@ var QueryService = class {
|
|
|
1364
1382
|
resultId,
|
|
1365
1383
|
noteId: rows[0].noteId,
|
|
1366
1384
|
timestamp: rows[0].timestamp,
|
|
1367
|
-
events: parsed.outputType ? rows.filter((row) => row.outputType === parsed.outputType) : rows
|
|
1385
|
+
events: parsed.outputType && !ROWS_CONTENT_PLANES.has(parsed.outputType) ? rows.filter((row) => row.outputType === parsed.outputType) : rows
|
|
1368
1386
|
})).filter((run) => run.events.length > 0);
|
|
1369
1387
|
return { parsed, runs };
|
|
1370
1388
|
}
|
|
@@ -2050,15 +2068,15 @@ sum:$metric{} rollup:1w
|
|
|
2050
2068
|
}
|
|
2051
2069
|
|
|
2052
2070
|
// src/version.ts
|
|
2053
|
-
var VERSION = "0.
|
|
2054
|
-
var GIT_SHA = "
|
|
2055
|
-
var BUILD_TIME = "2026-08-
|
|
2071
|
+
var VERSION = "0.8.39";
|
|
2072
|
+
var GIT_SHA = "3c19185";
|
|
2073
|
+
var BUILD_TIME = "2026-08-26T00:07:31.934Z";
|
|
2056
2074
|
var SEMVER = {
|
|
2057
|
-
version: "0.
|
|
2058
|
-
gitSha: "
|
|
2059
|
-
buildTime: "2026-08-
|
|
2075
|
+
version: "0.8.39",
|
|
2076
|
+
gitSha: "3c19185",
|
|
2077
|
+
buildTime: "2026-08-26T00:07:31.934Z"
|
|
2060
2078
|
};
|
|
2061
2079
|
|
|
2062
|
-
export { BUILD_TIME, DASHBOARD_GRID_MAX_COLS, DASHBOARD_WIDGET_TYPES, DEFAULT_DASHBOARD_TITLE, DISCIPLINE_FACTORS, EFFORT_DISCIPLINES, GIT_SHA, KG_PER_LB, PLANNED_WIDGET_TYPES, QueryService, SEMVER, UNIT_FAMILIES, VERSION, WQL_AGGREGATORS, WQL_CALC_TARGETS, WQL_COMPARISON_OPS, WQL_CONTENT_FILTER_KEYS, WQL_DISPLAY_UNITS, WQL_FIND_TARGETS, WQL_GRAINS, WQL_INTENSITY_TIERS, WQL_KEYWORDS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_ROLLUP_PERIODS, WQL_SCOPES, WQL_SOURCES, WQL_TAG_KEYS, WQL_VIRTUAL_DIMS, buildDashboardDocument, buildDashboardScaffold, convert, dashboardSlug, defaultTokenValues, disciplineFactorFor, extractDashboardTokens, extractFrontmatterTags, getList, getScalar, getUnitFamily, isAggregateQuery, isDashboardMeta, isDashboardWidgetType, isEffortDiscipline, isFindQuery, isProposedMetric, isRowsQuery, normalizeSummaryFacts, parseDashboardNote, parseFlatProperties, parseFrontmatter, parseFrontmatterBody, parseFrontmatterCategories, parseFrontmatterProps, parseQuery, parseQueryWidgetSuffix, parseWqlSuffixes, projectEventToFacts, referencedTokens, resolveCanonicalMetricKey, resolveDisplayUnit, resolveWidgetType, serializeFrontmatter, setDashboardTokenValue, splitAtWhere, splitWidgetBody, staticNotesFromBlocks, staticTagIndexFromBlocks, stripFrontmatter, substituteTokens, toEventRows, toSummaryEventRows, unknownTokensMessage, unknownWidgetTypeMessage, wql, wqlCompletion, wqlCompletionSource, wqlHighlightStyle, wqlLanguage, parser as wqlParser, wql_parser_terms_exports as wqlTerms };
|
|
2080
|
+
export { BUILD_TIME, DASHBOARD_GRID_MAX_COLS, DASHBOARD_WIDGET_TYPES, DEFAULT_DASHBOARD_TITLE, DISCIPLINE_FACTORS, EFFORT_DISCIPLINES, GIT_SHA, KG_PER_LB, PLANNED_WIDGET_TYPES, QueryService, SEMVER, UNIT_FAMILIES, VERSION, WQL_AGGREGATORS, WQL_CALC_TARGETS, WQL_COMPARISON_OPS, WQL_CONTENT_FILTER_KEYS, WQL_DISPLAY_UNITS, WQL_FIND_TARGETS, WQL_GRAINS, WQL_INTENSITY_TIERS, WQL_KEYWORDS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_RESULT_PLANES, WQL_ROLLUP_PERIODS, WQL_ROWS_SCOPE_KEYS, WQL_ROWS_TARGETS, WQL_SCOPES, WQL_SOURCES, WQL_TAG_KEYS, WQL_VIRTUAL_DIMS, buildDashboardDocument, buildDashboardScaffold, convert, dashboardSlug, defaultTokenValues, disciplineFactorFor, extractDashboardTokens, extractFrontmatterTags, getList, getScalar, getUnitFamily, isAggregateQuery, isDashboardMeta, isDashboardWidgetType, isEffortDiscipline, isFindQuery, isProposedMetric, isRowsQuery, normalizeSummaryFacts, parseDashboardNote, parseFlatProperties, parseFrontmatter, parseFrontmatterBody, parseFrontmatterCategories, parseFrontmatterProps, parseQuery, parseQueryWidgetSuffix, parseWqlSuffixes, projectEventToFacts, referencedTokens, resolveCanonicalMetricKey, resolveDisplayUnit, resolveWidgetType, serializeFrontmatter, setDashboardTokenValue, splitAtWhere, splitWidgetBody, staticNotesFromBlocks, staticTagIndexFromBlocks, stripFrontmatter, substituteTokens, toEventRows, toSummaryEventRows, unknownTokensMessage, unknownWidgetTypeMessage, wql, wqlCompletion, wqlCompletionSource, wqlHighlightStyle, wqlLanguage, parser as wqlParser, wql_parser_terms_exports as wqlTerms };
|
|
2063
2081
|
//# sourceMappingURL=index.mjs.map
|
|
2064
2082
|
//# sourceMappingURL=index.mjs.map
|