@bitcobblers/wod-wiki-wql 0.7.37 → 0.7.38

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
@@ -238,7 +238,12 @@ interface FindPredicate {
238
238
  unit: 'd' | 'w';
239
239
  };
240
240
  }
241
- interface ParsedQuery {
241
+ /**
242
+ * Result of parsing an analytics (aggregate) query — `agg:metric{filters} …`.
243
+ * Discriminated union member: `family === 'aggregate'` (C5).
244
+ */
245
+ interface ParsedAggregateQuery {
246
+ family: 'aggregate';
242
247
  raw: string;
243
248
  agg: Aggregator;
244
249
  /** Canonical Metric Key (fact row `metricKey`). */
@@ -258,6 +263,7 @@ interface ParsedQuery {
258
263
  }
259
264
  /** Result of parsing a content-discovery query (`find:target{filters} in scope`). */
260
265
  interface ParsedFindQuery {
266
+ family: 'find';
261
267
  raw: string;
262
268
  /** Content target: 'note' or 'block'. */
263
269
  target: string;
@@ -273,11 +279,13 @@ interface ParsedFindQuery {
273
279
  join?: MetricPredicate;
274
280
  error?: string;
275
281
  }
276
- type AnyParsedQuery = ParsedQuery | ParsedFindQuery | ParsedRowsQuery;
282
+ type AnyParsedQuery = ParsedAggregateQuery | ParsedFindQuery | ParsedRowsQuery;
277
283
  /** Type guard: true for content-discovery queries. */
278
284
  declare function isFindQuery(parsed: AnyParsedQuery): parsed is ParsedFindQuery;
279
285
  /** Type guard: true for rows queries. */
280
286
  declare function isRowsQuery(parsed: AnyParsedQuery): parsed is ParsedRowsQuery;
287
+ /** Type guard: true for analytics (aggregate) queries. */
288
+ declare function isAggregateQuery(parsed: AnyParsedQuery): parsed is ParsedAggregateQuery;
281
289
  interface SeriesPoint {
282
290
  ts: number;
283
291
  value: number;
@@ -290,7 +298,7 @@ interface SeriesPoint {
290
298
  */
291
299
  interface ParsedRowsQuery {
292
300
  raw: string;
293
- /** Family discriminator (the other families are told apart by 'target'/'agg'). */
301
+ /** Family discriminator shared by all three query ASTs (C5). */
294
302
  family: 'rows';
295
303
  /** Output-statement type narrowing from the optional target (`rows:segment{…}`); undefined = all types. */
296
304
  outputType?: string;
@@ -309,9 +317,10 @@ interface Series {
309
317
  unit?: string;
310
318
  }
311
319
  /**
312
- * Parse a WQL query string into either an analytics ParsedQuery or a content
313
- * ParsedFindQuery. Dispatch is textual: a leading `find:` routes to the
314
- * content path, everything else to analytics.
320
+ * Parse a WQL query string into one of the three query families —
321
+ * analytics aggregate, content find, or rows — discriminated by `family`
322
+ * (C5). Dispatch is textual: a leading `find:` routes to the content path,
323
+ * `rows` to the rows path, everything else to analytics.
315
324
  */
316
325
  declare function parseQuery(raw: string): AnyParsedQuery;
317
326
 
@@ -632,7 +641,7 @@ interface FindOptions {
632
641
  anchorNow?: number;
633
642
  }
634
643
  interface QueryResult {
635
- parsed: ParsedQuery;
644
+ parsed: ParsedAggregateQuery;
636
645
  series: Series[];
637
646
  stages: {
638
647
  selected: number;
@@ -693,7 +702,7 @@ declare class QueryService {
693
702
  * Execute a find:effort query against the effort registry.
694
703
  */
695
704
  runFindEffort(parsed: ParsedFindQuery): Promise<FindQueryResult>;
696
- run(parsed: ParsedQuery, options?: QueryOptions): Promise<QueryResult>;
705
+ run(parsed: ParsedAggregateQuery, options?: QueryOptions): Promise<QueryResult>;
697
706
  /**
698
707
  * Stages 2–4 — BUCKET → GROUP → AGGREGATE over an already-selected +
699
708
  * filtered `matched` set.
@@ -947,13 +956,13 @@ declare function parseFrontmatterProps(lines: string[]): Record<string, string>;
947
956
  * Auto-generated build version metadata.
948
957
  * Do not edit directly; updated by scripts/stamp-version.ts
949
958
  */
950
- declare const VERSION = "0.7.37";
951
- declare const GIT_SHA = "713c593";
952
- declare const BUILD_TIME = "2026-08-25T00:18:25.714Z";
959
+ declare const VERSION = "0.7.38";
960
+ declare const GIT_SHA = "172cc75";
961
+ declare const BUILD_TIME = "2026-08-25T23:00:14.937Z";
953
962
  declare const SEMVER: {
954
- readonly version: "0.7.37";
955
- readonly gitSha: "713c593";
956
- readonly buildTime: "2026-08-25T00:18:25.714Z";
963
+ readonly version: "0.7.38";
964
+ readonly gitSha: "172cc75";
965
+ readonly buildTime: "2026-08-25T23:00:14.937Z";
957
966
  };
958
967
 
959
- 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 ParsedFindQuery, type ParsedFrontmatter, type ParsedQuery, 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, 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -238,7 +238,12 @@ interface FindPredicate {
238
238
  unit: 'd' | 'w';
239
239
  };
240
240
  }
241
- interface ParsedQuery {
241
+ /**
242
+ * Result of parsing an analytics (aggregate) query — `agg:metric{filters} …`.
243
+ * Discriminated union member: `family === 'aggregate'` (C5).
244
+ */
245
+ interface ParsedAggregateQuery {
246
+ family: 'aggregate';
242
247
  raw: string;
243
248
  agg: Aggregator;
244
249
  /** Canonical Metric Key (fact row `metricKey`). */
@@ -258,6 +263,7 @@ interface ParsedQuery {
258
263
  }
259
264
  /** Result of parsing a content-discovery query (`find:target{filters} in scope`). */
260
265
  interface ParsedFindQuery {
266
+ family: 'find';
261
267
  raw: string;
262
268
  /** Content target: 'note' or 'block'. */
263
269
  target: string;
@@ -273,11 +279,13 @@ interface ParsedFindQuery {
273
279
  join?: MetricPredicate;
274
280
  error?: string;
275
281
  }
276
- type AnyParsedQuery = ParsedQuery | ParsedFindQuery | ParsedRowsQuery;
282
+ type AnyParsedQuery = ParsedAggregateQuery | ParsedFindQuery | ParsedRowsQuery;
277
283
  /** Type guard: true for content-discovery queries. */
278
284
  declare function isFindQuery(parsed: AnyParsedQuery): parsed is ParsedFindQuery;
279
285
  /** Type guard: true for rows queries. */
280
286
  declare function isRowsQuery(parsed: AnyParsedQuery): parsed is ParsedRowsQuery;
287
+ /** Type guard: true for analytics (aggregate) queries. */
288
+ declare function isAggregateQuery(parsed: AnyParsedQuery): parsed is ParsedAggregateQuery;
281
289
  interface SeriesPoint {
282
290
  ts: number;
283
291
  value: number;
@@ -290,7 +298,7 @@ interface SeriesPoint {
290
298
  */
291
299
  interface ParsedRowsQuery {
292
300
  raw: string;
293
- /** Family discriminator (the other families are told apart by 'target'/'agg'). */
301
+ /** Family discriminator shared by all three query ASTs (C5). */
294
302
  family: 'rows';
295
303
  /** Output-statement type narrowing from the optional target (`rows:segment{…}`); undefined = all types. */
296
304
  outputType?: string;
@@ -309,9 +317,10 @@ interface Series {
309
317
  unit?: string;
310
318
  }
311
319
  /**
312
- * Parse a WQL query string into either an analytics ParsedQuery or a content
313
- * ParsedFindQuery. Dispatch is textual: a leading `find:` routes to the
314
- * content path, everything else to analytics.
320
+ * Parse a WQL query string into one of the three query families —
321
+ * analytics aggregate, content find, or rows — discriminated by `family`
322
+ * (C5). Dispatch is textual: a leading `find:` routes to the content path,
323
+ * `rows` to the rows path, everything else to analytics.
315
324
  */
316
325
  declare function parseQuery(raw: string): AnyParsedQuery;
317
326
 
@@ -632,7 +641,7 @@ interface FindOptions {
632
641
  anchorNow?: number;
633
642
  }
634
643
  interface QueryResult {
635
- parsed: ParsedQuery;
644
+ parsed: ParsedAggregateQuery;
636
645
  series: Series[];
637
646
  stages: {
638
647
  selected: number;
@@ -693,7 +702,7 @@ declare class QueryService {
693
702
  * Execute a find:effort query against the effort registry.
694
703
  */
695
704
  runFindEffort(parsed: ParsedFindQuery): Promise<FindQueryResult>;
696
- run(parsed: ParsedQuery, options?: QueryOptions): Promise<QueryResult>;
705
+ run(parsed: ParsedAggregateQuery, options?: QueryOptions): Promise<QueryResult>;
697
706
  /**
698
707
  * Stages 2–4 — BUCKET → GROUP → AGGREGATE over an already-selected +
699
708
  * filtered `matched` set.
@@ -947,13 +956,13 @@ declare function parseFrontmatterProps(lines: string[]): Record<string, string>;
947
956
  * Auto-generated build version metadata.
948
957
  * Do not edit directly; updated by scripts/stamp-version.ts
949
958
  */
950
- declare const VERSION = "0.7.37";
951
- declare const GIT_SHA = "713c593";
952
- declare const BUILD_TIME = "2026-08-25T00:18:25.714Z";
959
+ declare const VERSION = "0.7.38";
960
+ declare const GIT_SHA = "172cc75";
961
+ declare const BUILD_TIME = "2026-08-25T23:00:14.937Z";
953
962
  declare const SEMVER: {
954
- readonly version: "0.7.37";
955
- readonly gitSha: "713c593";
956
- readonly buildTime: "2026-08-25T00:18:25.714Z";
963
+ readonly version: "0.7.38";
964
+ readonly gitSha: "172cc75";
965
+ readonly buildTime: "2026-08-25T23:00:14.937Z";
957
966
  };
958
967
 
959
- 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 ParsedFindQuery, type ParsedFrontmatter, type ParsedQuery, 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, 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 };
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 };
package/dist/index.mjs CHANGED
@@ -232,11 +232,14 @@ function parseWqlSuffixes(raw) {
232
232
 
233
233
  // src/wql.ts
234
234
  function isFindQuery(parsed) {
235
- return "target" in parsed;
235
+ return parsed.family === "find";
236
236
  }
237
237
  function isRowsQuery(parsed) {
238
238
  return parsed.family === "rows";
239
239
  }
240
+ function isAggregateQuery(parsed) {
241
+ return parsed.family === "aggregate";
242
+ }
240
243
  var AGGS = WQL_AGGREGATORS;
241
244
  function cannotParse(text) {
242
245
  return `Cannot parse "${text}". Expected agg:metric{filters} by {dims} .rollup(period)`;
@@ -371,6 +374,7 @@ function parseAnalyticsQuery(raw) {
371
374
  const suffixes = parseWqlSuffixes(raw);
372
375
  const { where: whereText, displayUnit, groupBy, rollup, primaryText: text } = suffixes;
373
376
  const base = {
377
+ family: "aggregate",
374
378
  raw,
375
379
  agg: "sum",
376
380
  metric: "",
@@ -438,6 +442,7 @@ function parseFindQuery(raw) {
438
442
  const suffixes = parseWqlSuffixes(raw);
439
443
  const { where: whereText, last, scope, primaryText: text } = suffixes;
440
444
  const result = {
445
+ family: "find",
441
446
  raw,
442
447
  target: "",
443
448
  filters: [],
@@ -1296,7 +1301,7 @@ var QueryService = class {
1296
1301
  const parsed = parseQuery(raw);
1297
1302
  if (isFindQuery(parsed)) {
1298
1303
  return {
1299
- parsed: { raw, agg: "count", metric: parsed.target, filters: [], groupBy: [] },
1304
+ parsed: { family: "aggregate", raw, agg: "count", metric: parsed.target, filters: [], groupBy: [] },
1300
1305
  series: [],
1301
1306
  stages: { selected: 0, buckets: 0, aggregated: 0, groups: 0 },
1302
1307
  matched: []
@@ -1304,7 +1309,7 @@ var QueryService = class {
1304
1309
  }
1305
1310
  if (isRowsQuery(parsed)) {
1306
1311
  return {
1307
- parsed: { raw, agg: "count", metric: "rows", filters: [], groupBy: [] },
1312
+ parsed: { family: "aggregate", raw, agg: "count", metric: "rows", filters: [], groupBy: [] },
1308
1313
  series: [],
1309
1314
  stages: { selected: 0, buckets: 0, aggregated: 0, groups: 0 },
1310
1315
  matched: []
@@ -1626,6 +1631,7 @@ var QueryService = class {
1626
1631
  };
1627
1632
  const join = parsed.join;
1628
1633
  const findResult = await this.runFind({
1634
+ family: "find",
1629
1635
  raw: "",
1630
1636
  target: join.target,
1631
1637
  filters: join.filters,
@@ -2044,15 +2050,15 @@ sum:$metric{} rollup:1w
2044
2050
  }
2045
2051
 
2046
2052
  // src/version.ts
2047
- var VERSION = "0.7.37";
2048
- var GIT_SHA = "713c593";
2049
- var BUILD_TIME = "2026-08-25T00:18:25.714Z";
2053
+ var VERSION = "0.7.38";
2054
+ var GIT_SHA = "172cc75";
2055
+ var BUILD_TIME = "2026-08-25T23:00:14.937Z";
2050
2056
  var SEMVER = {
2051
- version: "0.7.37",
2052
- gitSha: "713c593",
2053
- buildTime: "2026-08-25T00:18:25.714Z"
2057
+ version: "0.7.38",
2058
+ gitSha: "172cc75",
2059
+ buildTime: "2026-08-25T23:00:14.937Z"
2054
2060
  };
2055
2061
 
2056
- 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, 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 };
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 };
2057
2063
  //# sourceMappingURL=index.mjs.map
2058
2064
  //# sourceMappingURL=index.mjs.map