@bitcobblers/wod-wiki-ui 0.51.2196 → 0.52.2198

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,17 +1,17 @@
1
- import { Q as QueryExecutor } from './index-Bo1KHv-b.cjs';
2
- export { B as ButtonAction, C as CursorFocusState, a as CustomCompletionSource, D as DefaultFrontmatterWidget, E as EditorDialect, b as EditorPresetOptions, c as EditorSection, d as EditorSectionSubtype, e as EditorSectionType, f as EmbedType, F as FrontmatterCatalogEntry, g as FrontmatterRefDiagnostic, h as FrontmatterReferenceProvider, i as FrontmatterReferenceRef, j as FrontmatterReferenceResolution, k as FrontmatterSuggestionCatalog, G as GeometryListener, I as INTERNAL_FRONTMATTER_KEYS, N as NavigationHook, l as NestedCompletionOptions, O as OverlayAction, m as QueryBlockPreviewOptions, R as RuntimePanelEntry, S as SectionIdentity, n as SectionRect, o as SectionState, W as WidgetConfig, p as WidgetProps, q as WidgetRegistry, r as activeCursorSection, s as addRuntimePanel, t as autocompleteTooltipTheme, u as configureOverlayActions, v as cursorFocusExtension, w as customCompletionSources, x as dispatchAddRuntimePanel, y as dispatchExpandRuntimePanel, z as dispatchGutterHighlights, A as dispatchRemoveRuntimePanel, H as editingWidgetsField, J as editorPreset, K as editorTheme, L as embedPreviewDecorations, M as expandRuntimePanel, P as fenceCompletion, T as findQueryBlockSection, U as findWorkoutErrors, V as forceSectionParse, X as frontmatterDebugMode, Y as frontmatterDetailed, Z as frontmatterKeymap, _ as frontmatterPreview, $ as frontmatterPreviewField, a0 as frontmatterReferenceIndex, a1 as frontmatterSource, a2 as frontmatterSuggestions, a3 as frontmatterVisibility, a4 as getCursorFocusState, a5 as getOverlayActions, a6 as gutterHighlightsField, a7 as gutterUnified, a8 as handleFenceAutoWrap, a9 as inlineButtonDecoration, aa as isInternalFrontmatterKey, ab as lineIdsExtension, ac as linkOpen, ad as linkPreview, ae as markdownSyntaxHiding, af as markdownTablePreview, ag as navigationFacet, ah as nestedCompletion, ai as nestedCompletionOptions, aj as previewDecorations, ak as queryBlockPreview, al as referenceIndexReload, am as registeredSectionWidgets, an as removeRuntimePanel, ao as resolveCodeLanguage, ap as runtimePanelField, aq as saveBlockQuerySource, ar as sectionAtPos, as as sectionField, at as sectionGeometry, au as sectionIdentity, av as sectionIdentityHistory, aw as sectionMove, ax as sectionRestore, ay as sectionSaved, az as sessionQueryInsert, aA as sessionQueryWql, aB as setFrontmatterDetailed, aC as setFrontmatterSource, aD as setGutterHighlights, aE as smartIncrement, aF as toggleWidgetEdit, aG as urlAtPos, aH as widgetBlockPreview, aI as wodAutoWrap, aJ as wodAutocompletion, aK as wodCompletionSource, aL as wodEditorKeymap, aM as wodLinter, aN as wodOverlayPanel, aO as workoutLintSource, aP as wrapInTimeFence } from './index-Bo1KHv-b.cjs';
1
+ import { Q as QueryExecutor, O as OutputFilterInput, S as SessionTableSortSpec, I as InlineMetricEditPayload, R as RowPrHighlight } from './index-CfljPEK3.cjs';
2
+ export { A as AttachmentUrlResolver, B as ButtonAction, C as CategorizedMetrics, a as CursorFocusState, b as CustomCompletionSource, D as DEFAULT_OUTPUT_FILTERS, c as DEFAULT_PRIMARY_FILTER, d as DefaultFrontmatterWidget, E as EditorDialect, e as EditorPresetOptions, f as EditorSection, g as EditorSectionSubtype, h as EditorSectionType, i as EmbedType, F as FrontmatterCatalogEntry, j as FrontmatterRefDiagnostic, k as FrontmatterReferenceProvider, l as FrontmatterReferenceRef, m as FrontmatterReferenceResolution, n as FrontmatterSuggestionCatalog, G as GeometryListener, o as INTERNAL_FRONTMATTER_KEYS, M as MetricBadge, N as NavigationHook, p as NestedCompletionOptions, q as OUTPUT_TYPE_CLASS, r as OUTPUT_TYPE_DOT, s as OutputFilterPills, t as OutputFilterPreset, u as OutputStatementRow, v as OutputStatementsTable, w as OutputStatementsTableProps, x as OverlayAction, y as QueryBlockPreviewOptions, z as RuntimePanelEntry, H as SectionIdentity, J as SectionRect, K as SectionState, T as TONE_CLASS, W as WidgetConfig, L as WidgetProps, P as WidgetRegistry, U as activeCursorSection, V as addRuntimePanel, X as attachmentUrlFacet, Y as autocompleteTooltipTheme, Z as configureOverlayActions, _ as cursorFocusExtension, $ as customCompletionSources, a0 as dispatchAddRuntimePanel, a1 as dispatchExpandRuntimePanel, a2 as dispatchGutterHighlights, a3 as dispatchRemoveRuntimePanel, a4 as editingQuerySectionsField, a5 as editingWidgetsField, a6 as editorFocusField, a7 as editorFocusTracker, a8 as editorPreset, a9 as editorTheme, aa as embedPreviewDecorations, ab as expandRuntimePanel, ac as extractMetricsByCategory, ad as fenceCompletion, ae as findQueryBlockSection, af as findWorkoutErrors, ag as forceSectionParse, ah as formatClockTime, ai as formatMMSS, aj as frontmatterDebugMode, ak as frontmatterDetailed, al as frontmatterKeymap, am as frontmatterPreview, an as frontmatterPreviewField, ao as frontmatterReferenceIndex, ap as frontmatterSource, aq as frontmatterSuggestions, ar as frontmatterVisibility, as as getCursorFocusState, at as getOverlayActions, au as gutterHighlightsField, av as gutterUnified, aw as handleFenceAutoWrap, ax as handleSmartUrlPaste, ay as inlineButtonDecoration, az as insertMarkdownLinkCommand, aA as isEditorFocused, aB as isInternalFrontmatterKey, aC as isNavigableUrl, aD as lineIdsExtension, aE as linkOpen, aF as linkPreview, aG as markdownSyntaxHiding, aH as markdownTablePreview, aI as navigationFacet, aJ as nestedCompletion, aK as nestedCompletionOptions, aL as normalizeOutputFilter, aM as presentBadges, aN as previewDecorations, aO as queryBlockPreview, aP as referenceIndexReload, aQ as registeredSectionWidgets, aR as removeRuntimePanel, aS as resolveCodeLanguage, aT as runtimePanelField, aU as saveBlockQuerySource, aV as sectionAtPos, aW as sectionField, aX as sectionGeometry, aY as sectionIdentity, aZ as sectionIdentityHistory, a_ as sectionMove, a$ as sectionRestore, b0 as sectionSaved, b1 as sessionQueryFence, b2 as sessionQueryInsert, b3 as sessionQueryWql, b4 as setEditorFocused, b5 as setFrontmatterDetailed, b6 as setFrontmatterSource, b7 as setGutterHighlights, b8 as setQuerySourceEditing, b9 as slashBlockCompletion, ba as smartIncrement, bb as toggleInlineMarkdown, bc as toggleWidgetEdit, bd as urlAtPos, be as widgetBlockPreview, bf as wodAutoWrap, bg as wodAutocompletion, bh as wodCompletionSource, bi as wodEditorKeymap, bj as wodLinter, bk as wodOverlayPanel, bl as workoutLintSource, bm as wrapInTimeFence } from './index-CfljPEK3.cjs';
3
3
  import * as react from 'react';
4
4
  import react__default, { ReactNode, ComponentType } from 'react';
5
- import { QueryResult, RowsRun, NoteContainer, TabularResult, PipelineSink, QueryDocumentRunnerHost, Series, AnyParsedQuery, DocumentOutput, DashboardToken, DashboardDocument, DashboardWidget, RowsQueryResult, FindQueryResult, ParsedAggregateQuery, ParsedFindQuery, ParsedPipelineQuery } from '@bitcobblers/wod-wiki-wql';
5
+ import { QueryResult, RowsRun, NoteContainer, TabularResult, PipelineSink, QueryDocumentRunnerHost, Series, AnyParsedQuery, DocumentOutput, DocumentResult, DashboardToken, DashboardDocument, DashboardWidget, RowsQueryResult, FindQueryResult, ParsedAggregateQuery, ParsedFindQuery, ParsedPipelineQuery, WqlCursorStageInfo, QueryBlockObject } from '@bitcobblers/wod-wiki-wql';
6
6
  export { CONTENT_GROUPING_DIMENSIONS, FindOptions, FindQueryResult, ParsedAggregateQuery, ParsedFindQuery, ParsedPipelineQuery, ParsedRowsQuery, PipelineResult, QueryOptions, QueryResult, RowsQueryResult, RowsRun } from '@bitcobblers/wod-wiki-wql';
7
- import { IMetric, EventRecord, BlockIndexRow } from '@bitcobblers/wod-wiki-core';
7
+ import { EventRecord, BlockIndexRow } from '@bitcobblers/wod-wiki-core';
8
8
  export { blockContentId } from '@bitcobblers/wod-wiki-core';
9
- import { MetricPresentationToken } from '@bitcobblers/wod-wiki-lang';
10
9
  import { ClassValue } from 'clsx';
11
10
  import '@codemirror/state';
12
11
  import '@codemirror/view';
13
12
  import '@codemirror/lint';
14
13
  import '@codemirror/autocomplete';
14
+ import '@bitcobblers/wod-wiki-lang';
15
15
  import '@codemirror/language';
16
16
 
17
17
  interface StorageLike {
@@ -137,6 +137,16 @@ declare function toChartResult(input: {
137
137
  }): QueryResult;
138
138
  /** Convert a `DocumentOutput` from `SharedQueryDocumentRunner` into `WidgetRunResult`. */
139
139
  declare function outputToRunResult(parsed: AnyParsedQuery, out: DocumentOutput): WidgetRunResult;
140
+ /**
141
+ * Merge EVERY shown output of a document run into one widget result.
142
+ *
143
+ * A Query Document can show several bindings (`show kb, bb | :stacked-bar{}`).
144
+ * Taking only `outputs[0]` silently dropped every series after the first —
145
+ * the chart rendered a single band for a stacked-bar that declared two.
146
+ * This merges all shown series, keeps the first sink/unit, and surfaces the
147
+ * first error so a failed stage is never swallowed by a healthy sibling.
148
+ */
149
+ declare function outputsToRunResult(parsed: AnyParsedQuery, res: DocumentResult, attributes?: Record<string, string>): WidgetRunResult;
140
150
  declare function mergeSeries(series: Series[]): MergedPoint[];
141
151
  declare function compactNumber(value: number): string;
142
152
  declare function formatTimestamp(ts: number): string;
@@ -368,68 +378,14 @@ interface AnalyticsUnitPreferenceProps {
368
378
  }
369
379
  declare function AnalyticsUnitPreference({ className, unit: unitProp, forced, storage }: AnalyticsUnitPreferenceProps): react.JSX.Element;
370
380
 
371
- declare function formatMMSS(ms: number): string;
372
- declare function formatClockTime(d: Date): string;
373
- declare const TONE_CLASS: Record<string, string>;
374
- declare function MetricBadge({ token }: {
375
- token: MetricPresentationToken;
376
- }): react.JSX.Element | null;
377
- /** Metric badges for a statement/output metric group. */
378
- declare function presentBadges(metrics: Iterable<IMetric>): ReactNode;
379
- declare const OUTPUT_TYPE_CLASS: Record<string, string>;
380
- declare const OUTPUT_TYPE_DOT: Record<string, string>;
381
- interface CategorizedMetrics {
382
- efforts: IMetric[];
383
- reps: IMetric[];
384
- loads: IMetric[];
385
- rounds: IMetric[];
386
- durations: IMetric[];
387
- distances: IMetric[];
388
- hints: IMetric[];
389
- }
390
- declare function extractMetricsByCategory(metrics?: Iterable<IMetric>): CategorizedMetrics;
391
- interface OutputFilterPreset {
392
- label: string;
393
- query: string;
381
+ interface PRBadgeProps {
382
+ isPR?: boolean;
383
+ label?: string;
384
+ improvement?: number;
385
+ unit?: string;
386
+ className?: string;
394
387
  }
395
- type OutputFilterInput = string | OutputFilterPreset;
396
- /** Default row filter — segment statements only (the Workbench default). */
397
- declare const DEFAULT_PRIMARY_FILTER = "type:segment";
398
- declare const DEFAULT_OUTPUT_FILTERS: OutputFilterPreset[];
399
- declare function normalizeOutputFilter(filter: OutputFilterInput): OutputFilterPreset;
400
- /** Structural subset satisfied by live `IOutputStatement`s, stored statements,
401
- * and `EventRecord` event rows alike. */
402
- interface OutputStatementRow {
403
- readonly id?: number | string;
404
- readonly outputType?: string;
405
- readonly timeSpan?: {
406
- started: number;
407
- ended?: number;
408
- };
409
- readonly metrics?: Iterable<IMetric>;
410
- readonly sourceBlockKey?: string;
411
- readonly completionReason?: string;
412
- }
413
- declare function OutputFilterPills({ presets, filter, onChange, }: {
414
- presets: OutputFilterPreset[];
415
- filter: string;
416
- onChange: (next: string) => void;
417
- }): react.JSX.Element;
418
- interface OutputStatementsTableProps {
419
- outputs: readonly OutputStatementRow[];
420
- /** Filter expression (`type:segment`, free text). Empty shows all. */
421
- filter?: string;
422
- /** Epoch ms the +offset column is relative to. Defaults to first statement start. */
423
- timeOrigin?: number;
424
- /** Clears the active filter — enables the Card List's Clear-filter
425
- * affordance on the filtered-empty state. Optional; hosts without a
426
- * clearable filter omit it. */
427
- onClearFilter?: () => void;
428
- }
429
- /** The Session Results surface — Card List below `sm`, the 9-column table at
430
- * `sm` and above. One component: same props, same filtering; hosts (analytics
431
- * explorer, editor query blocks, workbench) inherit the phone path. */
432
- declare function OutputStatementsTable({ outputs, filter, timeOrigin, onClearFilter, }: OutputStatementsTableProps): react.JSX.Element;
388
+ declare function PRBadge({ isPR, label, improvement, unit, className, }: PRBadgeProps): react.JSX.Element | null;
433
389
 
434
390
  interface RowsTableProps {
435
391
  result: RowsQueryResult;
@@ -440,10 +396,21 @@ interface RowsTableProps {
440
396
  /** Controlled filter expression — omit to let the table own its filter state. */
441
397
  filter?: string;
442
398
  onFilterChange?: (filter: string) => void;
399
+ /** Optional explicit column whitelist & order (from YAML `columns: [...]`). */
400
+ columns?: readonly string[];
401
+ /** Optional initial or controlled sort specs (from YAML `sort: [...]`). */
402
+ sort?: readonly SessionTableSortSpec[];
403
+ onSortChange?: (next: SessionTableSortSpec[]) => void;
404
+ /** Optional row cap after filtering and sorting. */
405
+ limit?: number;
406
+ /** Optional inline actuals editor (`captureMetricCorrection`), scoped per run `resultId`. */
407
+ onEditMetric?: (resultId: string, payload: InlineMetricEditPayload) => void | Promise<void>;
408
+ /** Optional PR highlights keyed by row `id` or `sourceBlockKey`. */
409
+ prHighlights?: ReadonlyMap<string | number, RowPrHighlight> | Record<string, RowPrHighlight>;
443
410
  }
444
411
  /** The Session Results Table — renders a Rows Query result: one section per
445
412
  * run, filter pills on top, and the shared statement table as the body. */
446
- declare function RowsTable({ result, renderRunHeaderExtra, presets, filter, onFilterChange, }: RowsTableProps): react.JSX.Element;
413
+ declare function RowsTable({ result, renderRunHeaderExtra, presets, filter, onFilterChange, columns, sort, onSortChange, limit, onEditMetric, prHighlights, }: RowsTableProps): react.JSX.Element;
447
414
 
448
415
  interface QueryBlockViewProps {
449
416
  /** Raw text between the ```query fences — the WQL query string or Query Document body. */
@@ -470,6 +437,8 @@ interface QueryBlockViewProps {
470
437
  onAddToDashboard?: () => void;
471
438
  /** Optional RPE capture handler. */
472
439
  onCaptureRpe?: (resultId: string, rpe: number) => Promise<void>;
440
+ /** Optional inline metric actuals editor (`captureMetricCorrection`). */
441
+ onEditMetric?: (resultId: string, payload: InlineMetricEditPayload) => void | Promise<void>;
473
442
  /** Optional click handler for opening a note from :note results. */
474
443
  onOpenNote?: (item: {
475
444
  id: string;
@@ -482,30 +451,49 @@ interface QueryBlockViewProps {
482
451
  title?: string;
483
452
  blockContentId?: string;
484
453
  }) => string;
454
+ /** Optional handler to reveal the raw fenced WQL source in the host editor. */
455
+ onEditSource?: () => void;
485
456
  }
486
- declare function QueryBlockView({ query, executor, onResultSaved, onSaveQuery, queryIndex: _queryIndex, readOnly, widgetType, widgetError, tokenValues, attributes, onAddToDashboard, onCaptureRpe, onOpenNote, noteHref, }: QueryBlockViewProps): react.JSX.Element;
457
+ declare function QueryBlockView({ query, executor, onResultSaved, onSaveQuery, queryIndex: _queryIndex, readOnly, widgetType, widgetError, tokenValues, attributes, onAddToDashboard, onCaptureRpe, onEditMetric, onOpenNote, noteHref, onEditSource, }: QueryBlockViewProps): react.JSX.Element;
487
458
 
488
459
  declare function readSessionRpe(events: EventRecord[] | undefined): number | undefined;
460
+ /**
461
+ * Compute per-row PR highlights by comparing `sessionRun` against prior runs
462
+ * of the same workout block. For each effort slug with a numeric `calc.e1rm`
463
+ * or `resistance` metric, flags the row that beats the best prior run.
464
+ */
465
+ declare function computeSessionPrHighlights(sessionRun: RowsRun | undefined, allRuns: readonly RowsRun[] | undefined): Map<string | number, RowPrHighlight>;
489
466
  interface RowsResultsChromeProps {
490
- /** The session result id from the written `rows:{result:…}` query. */
467
+ /** The session result id from the written `:session{result:…}` query. */
491
468
  resultId: string;
492
469
  /** The session-scoped rows result (one run). */
493
470
  sessionResult: RowsQueryResult;
494
- /** Injected QueryExecutor for widened query execution. */
471
+ /** Injected QueryExecutor for widened query execution and PR lookup. */
495
472
  executor?: QueryExecutor;
496
473
  /** Optional RPE capture handler. */
497
474
  onCaptureRpe?: (resultId: string, rpe: number) => Promise<void>;
498
- /** Re-run the parent query after a capture so the grid reflects the RPE. */
475
+ /** Optional inline metric actuals editor (`captureMetricCorrection`). */
476
+ onEditMetric?: (resultId: string, payload: InlineMetricEditPayload) => void | Promise<void>;
477
+ /** Re-run the parent query after a capture so the grid reflects the update. */
499
478
  onCaptured?: () => void;
479
+ /** Optional column whitelist/order from YAML `columns: [...]`. */
480
+ columns?: readonly string[];
481
+ /** Optional sort specs from YAML `sort: [...]`. */
482
+ sort?: readonly SessionTableSortSpec[];
483
+ /** Optional row limit from YAML `limit: N`. */
484
+ limit?: number;
485
+ /** Enable/disable historical PR badge comparison (defaults to true). */
486
+ comparePr?: boolean;
500
487
  }
501
- declare function RowsResultsChrome({ resultId, sessionResult, executor, onCaptureRpe, onCaptured, }: RowsResultsChromeProps): react.JSX.Element;
488
+ declare function RowsResultsChrome({ resultId, sessionResult, executor, onCaptureRpe, onEditMetric, onCaptured, columns, sort, limit, comparePr, }: RowsResultsChromeProps): react.JSX.Element;
502
489
 
503
490
  interface WqlQueryInspectorModalProps {
504
491
  isOpen: boolean;
505
492
  onClose: () => void;
506
493
  initialQuery: string;
507
- /** Persist the applied query. A returned Promise gates the button until
508
- * it settles; a rejection keeps the dialog open with the error visible. */
494
+ initialWidgetType?: string;
495
+ initialAttributes?: Record<string, string>;
496
+ /** Persist the applied query block body (1-line WQL or YAML). */
509
497
  onApply: (newQuery: string) => void | Promise<void>;
510
498
  title?: string;
511
499
  subtitle?: string;
@@ -513,7 +501,7 @@ interface WqlQueryInspectorModalProps {
513
501
  applyLabel?: string;
514
502
  executor?: QueryExecutor;
515
503
  }
516
- declare function WqlQueryInspectorModal({ isOpen, onClose, initialQuery, onApply, title, subtitle, applyLabel, executor, }: WqlQueryInspectorModalProps): react.JSX.Element;
504
+ declare function WqlQueryInspectorModal({ isOpen, onClose, initialQuery, initialWidgetType, initialAttributes, onApply, title, subtitle, applyLabel, executor, }: WqlQueryInspectorModalProps): react.JSX.Element;
517
505
 
518
506
  type WqlExecutor = (ast: AnyParsedQuery) => Promise<FindQueryResult | QueryResult>;
519
507
  type WqlStageCounts = {
@@ -549,7 +537,7 @@ declare function useWqlStageCounts(ast: AnyParsedQuery, valid: boolean, execute:
549
537
  * Supports freeform token slots, placeholder guidance, and keyboard navigation.
550
538
  */
551
539
 
552
- type ClauseType = 'kind' | 'target' | 'source' | 'text' | 'notebook' | 'tag' | 'contributes' | 'effort' | 'domain' | 'format' | 'equipment' | 'quality' | 'intent' | 'discipline' | 'intensity' | 'origin' | 'type' | 'time' | 'where' | 'agg' | 'metric' | 'groupby' | 'rollup' | 'unit' | 'result' | 'block' | 'note' | 'page' | 'plane' | 'pipes' | 'feed' | 'subscribed';
540
+ type ClauseType = 'kind' | 'target' | 'source' | 'text' | 'notebook' | 'tag' | 'contributes' | 'effort' | 'domain' | 'format' | 'equipment' | 'quality' | 'intent' | 'discipline' | 'intensity' | 'origin' | 'type' | 'time' | 'where' | 'agg' | 'metric' | 'groupby' | 'rollup' | 'unit' | 'result' | 'block' | 'note' | 'page' | 'plane' | 'pipes' | 'feed' | 'subscribed' | 'scope';
553
541
  interface QueryClause {
554
542
  id: string;
555
543
  /** Built-in ClauseType or a custom slot type id from the ComposerRegistry. */
@@ -576,7 +564,7 @@ declare const KIND_OPTIONS: {
576
564
  }[];
577
565
  /** Singular find targets — the colon `<target>` head (C7 closed enum). */
578
566
  declare const TARGET_OPTIONS: {
579
- value: "page" | "note" | "block" | "effort" | "segment" | "event" | "session" | "notebook" | "tag" | "equipment";
567
+ value: "page" | "note" | "block" | "feed" | "effort" | "segment" | "event" | "session" | "notebook" | "tag" | "equipment";
580
568
  label: string;
581
569
  description: string;
582
570
  }[];
@@ -615,8 +603,8 @@ declare const GROUPBY_OPTIONS: {
615
603
  label: "format" | "origin" | "result" | "day" | "page" | "domain" | "round" | "metric" | "note" | "block" | "week" | "effort" | "intensity" | "session" | "equipment" | "quality" | "intent" | "discipline" | "grade" | "grain" | "tags";
616
604
  }[];
617
605
  declare const METRIC_OPTIONS: {
618
- value: "distance" | "resistance" | "power" | "tis" | "elapsed" | "totalVolume" | "totalDistance" | "sessionLoad" | "reps" | "pace" | "calc.metMinutes" | "calc.acwr" | "calc.monotony" | "calc.strain" | "calc.e1rm" | "calc.ctl" | "calc.atl" | "calc.tsb" | "calc.soreness" | "calc.sleep" | "calc.hrv" | "calc.readiness" | "calc.mvcBw" | "calc.ef" | "calc.adherence" | "calc.pct1rm" | "calc.sends";
619
- label: "distance" | "resistance" | "power" | "tis" | "elapsed" | "totalVolume" | "totalDistance" | "sessionLoad" | "reps" | "pace" | "calc.metMinutes" | "calc.acwr" | "calc.monotony" | "calc.strain" | "calc.e1rm" | "calc.ctl" | "calc.atl" | "calc.tsb" | "calc.soreness" | "calc.sleep" | "calc.hrv" | "calc.readiness" | "calc.mvcBw" | "calc.ef" | "calc.adherence" | "calc.pct1rm" | "calc.sends";
606
+ value: "distance" | "resistance" | "tis" | "elapsed" | "reps" | "calc.e1rm" | "totalVolume" | "totalDistance" | "sessionLoad" | "power" | "pace" | "calc.metMinutes" | "calc.acwr" | "calc.monotony" | "calc.strain" | "calc.ctl" | "calc.atl" | "calc.tsb" | "calc.soreness" | "calc.sleep" | "calc.hrv" | "calc.readiness" | "calc.mvcBw" | "calc.ef" | "calc.adherence" | "calc.pct1rm" | "calc.sends";
607
+ label: "distance" | "resistance" | "tis" | "elapsed" | "reps" | "calc.e1rm" | "totalVolume" | "totalDistance" | "sessionLoad" | "power" | "pace" | "calc.metMinutes" | "calc.acwr" | "calc.monotony" | "calc.strain" | "calc.ctl" | "calc.atl" | "calc.tsb" | "calc.soreness" | "calc.sleep" | "calc.hrv" | "calc.readiness" | "calc.mvcBw" | "calc.ef" | "calc.adherence" | "calc.pct1rm" | "calc.sends";
620
608
  }[];
621
609
  declare const UNIT_OPTIONS: {
622
610
  value: "kg" | "lb";
@@ -870,9 +858,10 @@ interface WqlDiagnosticsStripProps {
870
858
  * a flat header section separated from the composer by an accent line. */
871
859
  variant?: 'card' | 'header';
872
860
  actions?: ReactNode;
861
+ activeStage?: WqlCursorStageInfo;
873
862
  className?: string;
874
863
  }
875
- declare function WqlDiagnosticsStrip({ diagnostics, offendingLabel, stages, hideSummary, variant, actions, className, }: WqlDiagnosticsStripProps): react.JSX.Element;
864
+ declare function WqlDiagnosticsStrip({ diagnostics, offendingLabel, stages, hideSummary, variant, actions, activeStage, className, }: WqlDiagnosticsStripProps): react.JSX.Element;
876
865
 
877
866
  interface QueryDraft {
878
867
  wql: string;
@@ -880,10 +869,56 @@ interface QueryDraft {
880
869
  valid: boolean;
881
870
  error?: string;
882
871
  }
872
+ /**
873
+ * Normalize a simple 2-stage `:segment{...} | :agg{metric:...} [by {...}]`
874
+ * pipeline (no sink, no source join/groupBy/pipes) into its equivalent
875
+ * `ParsedAggregateQuery` so UI builders can inspect and edit structured pills.
876
+ */
877
+ declare function normalizeSimplePipelineToAggregate(ast: AnyParsedQuery): ParsedAggregateQuery | null;
883
878
  declare function wqlToPills(wql: string): QueryClause[] | null;
884
879
  declare function editQueryClause(query: string, edited: QueryClause, value: string | null): QueryDraft;
880
+ /**
881
+ * Bind a `$token` parameter into a WQL query expression via pure AST mutation
882
+ * (replaces brittle regex brace surgery).
883
+ */
884
+ declare function bindTokenParamIntoWql(query: string, tokenName: string): string;
885
885
  declare function resolveQueryDraft(query: string, pendingText?: string): QueryDraft;
886
886
 
887
+ type QueryObjectBuilderDensity = 'bar' | 'inline' | 'studio';
888
+ interface QueryObjectValidationState {
889
+ valid: boolean;
890
+ error?: string;
891
+ }
892
+ interface QueryObjectBuilderProps {
893
+ value: QueryBlockObject;
894
+ onChange: (next: QueryBlockObject) => void;
895
+ density: QueryObjectBuilderDensity;
896
+ readOnly?: boolean;
897
+ executor?: QueryExecutor;
898
+ tokenValues?: Record<string, string>;
899
+ preferredUnit?: string;
900
+ rangeStart?: number;
901
+ rangeEnd?: number;
902
+ preferredChoices?: readonly string[];
903
+ /** Optional read-only dataset subset banner for studio mode (Explorer -> Dashboard). */
904
+ subsetQuery?: string | null;
905
+ /** Optional destination slot rendered between dataset and query in studio mode. */
906
+ destination?: ReactNode;
907
+ onValidationChange?: (state: QueryObjectValidationState) => void;
908
+ onSubmit?: (next: QueryBlockObject) => void;
909
+ actionLabel?: string;
910
+ className?: string;
911
+ }
912
+ declare function primaryQueryOf(obj: QueryBlockObject): string;
913
+ declare function setPrimaryQueryOnObject(obj: QueryBlockObject, nextQuery: string): QueryBlockObject;
914
+ declare function promoteFindToChartObject(obj: QueryBlockObject, metric?: string): QueryBlockObject;
915
+ declare function bindTokenToQueryObject(obj: QueryBlockObject, tokenName: string): QueryBlockObject;
916
+ declare function toggleGoalLayer(obj: QueryBlockObject, defaultTarget?: number): QueryBlockObject;
917
+ declare function cycleBaselineLayer(obj: QueryBlockObject): QueryBlockObject;
918
+ declare function toggleCompareLayer(obj: QueryBlockObject): QueryBlockObject;
919
+ declare function removeSeriesLayer(obj: QueryBlockObject, id: string): QueryBlockObject;
920
+ declare function QueryObjectBuilder({ value, onChange, density, readOnly, executor, tokenValues, preferredUnit, rangeStart, rangeEnd, preferredChoices, subsetQuery, destination, onValidationChange, onSubmit, actionLabel, className, }: QueryObjectBuilderProps): react.JSX.Element;
921
+
887
922
  interface EditorDialogProps {
888
923
  /** Controls visibility; the dialog unmounts its portal when closed. */
889
924
  open: boolean;
@@ -969,13 +1004,13 @@ declare function patchBlockQuery(blockContent: string, newQuery: string, queryIn
969
1004
  * Auto-generated build version metadata.
970
1005
  * Do not edit directly; updated by scripts/stamp-version.ts
971
1006
  */
972
- declare const VERSION = "0.51.2196";
973
- declare const GIT_SHA = "817bc28";
974
- declare const BUILD_TIME = "2026-11-05T23:36:56.914Z";
1007
+ declare const VERSION = "0.52.2198";
1008
+ declare const GIT_SHA = "15e2fcb";
1009
+ declare const BUILD_TIME = "2026-11-11T15:07:53.492Z";
975
1010
  declare const SEMVER: {
976
- readonly version: "0.51.2196";
977
- readonly gitSha: "817bc28";
978
- readonly buildTime: "2026-11-05T23:36:56.914Z";
1011
+ readonly version: "0.52.2198";
1012
+ readonly gitSha: "15e2fcb";
1013
+ readonly buildTime: "2026-11-11T15:07:53.492Z";
979
1014
  };
980
1015
 
981
- export { AGG_OPTIONS, ANALYTICS_UNIT_STORAGE_KEY, type AnalyticsQueriesState, type AnalyticsQueryDef, type AnalyticsRangeWeeks, type AnalyticsUnit, AnalyticsUnitPreference, type AnalyticsUnitPreferenceProps, BUILD_TIME, CANONICAL_BLOCK_TYPES, CLAUSE_META, CODEMIRROR_SINGLETON_DEPS, type CategorizedMetrics, type ChartShape, type ClauseMeta, type ClauseSuggestions, type ClauseType, ComposerRegistry, type CustomSlotDefinition, type CustomSlotEditorProps, DEFAULT_ANALYTICS_UNIT, DEFAULT_DIAGNOSTICS_DEBOUNCE_MS, DEFAULT_OUTPUT_FILTERS, DEFAULT_PRIMARY_FILTER, type DashboardHeadingAnchor, DashboardTokenControls, type DashboardTokenControlsProps, DashboardView, type DashboardViewProps, type DateRange, EditorDialog, type EditorDialogProps, type ExecutorDocumentHostOptions, type ExtractedQuery, type FilterTypeaheadCandidate, type FilterTypeaheadMatch, GIT_SHA, GROUPBY_OPTIONS, GoalRings, type GoalRingsProps, KIND_OPTIONS, METRIC_OPTIONS, MULTI_VALUE_TYPES, type MergedPoint, MetricBadge, OUTPUT_TYPE_CLASS, OUTPUT_TYPE_DOT, type OutputFilterInput, OutputFilterPills, type OutputFilterPreset, type OutputStatementRow, OutputStatementsTable, type OutputStatementsTableProps, PLANE_OPTIONS, ProposedMetricBadge, QueryBlockView, type QueryBlockViewProps, type QueryClause, type QueryDraft, QueryExecutor, QueryValue, type QueryValueProps, ROLLUP_OPTIONS, RangeSelector, type RangeSelectorProps, RowsResultsChrome, type RowsResultsChromeProps, RowsTable, type RowsTableProps, SEMVER, SERIES_COLORS, SOURCE_OPTIONS, SUGGESTION_BINDINGS, StackedBar, type StackedBarProps, type StorageLike, type SuggestionBinding, type SuggestionCachePolicy, type SuggestionItem, TARGET_OPTIONS, TIME_OPTIONS, TONE_CLASS, TokenSlotPill, type TokenSlotPillProps, TopList, type TopListProps, UNIT_OPTIONS, VERSION, type VisualViewportRect, WHERE_AGGREGATORS, WHERE_METRICS, WidgetChart, type WidgetChartProps, WidgetEditButton, WidgetFrame, type WidgetFrameProps, WidgetProblemBadge, type WidgetRunResult, type WidgetSpanOption, WidgetToolButton, type WqlAggregateSummary, WqlBars, type WqlBarsProps, WqlComposer, type WqlComposerProps, type WqlDiagnostics, WqlDiagnosticsStrip, type WqlDiagnosticsStripProps, WqlEmptyState, type WqlEmptyStateProps, type WqlExecutor, type WqlFindSummary, type WqlPipelineSummary, WqlQueryInspectorModal, type WqlQueryInspectorModalProps, type WqlSegmentEditRequest, type WqlStageCounts, WqlTable, type WqlTableProps, WqlTimeseries, type WqlTimeseriesProps, type WqlValidationState, ZoneDistribution, type ZoneDistributionProps, blockTypesFromBlocks, canonicalSuggestionItems, cn, compactNumber, composerRegistry, createExecutorDocumentHost, dateRangeSlot, editQueryClause, extractBlockQueries, extractMetricsByCategory, formatClockTime, formatMMSS, formatTimestamp, getClauseMeta, getDashboardEffectiveUnit, getEffectiveAnalyticsUnit, getSuggestionBinding, hashCode, invalidateSuggestions, loadSuggestions, matchFilterTypeahead, mergeSeries, mergeSuggestionItems, mergeTagSuggestions, normalizeOutputFilter, notebookSlugsFromBlocks, outputToRunResult, patchBlockQuery, presentBadges, readSessionRpe, readStoredUnit, resolveQueryDraft, setSuggestionBinding, summarizeAggregate, summarizeFind, summarizePipeline, tagsFromStaticBlocks, toChartResult, tooltipTimestamp, useAnalyticsQueries, useAnalyticsUnitPreference, useChartShape, useComposerSlots, useSuggestions, useVisualViewportRect, useWqlStageCounts, wqlToPills };
1016
+ export { AGG_OPTIONS, ANALYTICS_UNIT_STORAGE_KEY, type AnalyticsQueriesState, type AnalyticsQueryDef, type AnalyticsRangeWeeks, type AnalyticsUnit, AnalyticsUnitPreference, type AnalyticsUnitPreferenceProps, BUILD_TIME, CANONICAL_BLOCK_TYPES, CLAUSE_META, CODEMIRROR_SINGLETON_DEPS, type ChartShape, type ClauseMeta, type ClauseSuggestions, type ClauseType, ComposerRegistry, type CustomSlotDefinition, type CustomSlotEditorProps, DEFAULT_ANALYTICS_UNIT, DEFAULT_DIAGNOSTICS_DEBOUNCE_MS, type DashboardHeadingAnchor, DashboardTokenControls, type DashboardTokenControlsProps, DashboardView, type DashboardViewProps, type DateRange, EditorDialog, type EditorDialogProps, type ExecutorDocumentHostOptions, type ExtractedQuery, type FilterTypeaheadCandidate, type FilterTypeaheadMatch, GIT_SHA, GROUPBY_OPTIONS, GoalRings, type GoalRingsProps, InlineMetricEditPayload, KIND_OPTIONS, METRIC_OPTIONS, MULTI_VALUE_TYPES, type MergedPoint, OutputFilterInput, PLANE_OPTIONS, PRBadge, type PRBadgeProps, ProposedMetricBadge, QueryBlockView, type QueryBlockViewProps, type QueryClause, type QueryDraft, QueryExecutor, QueryObjectBuilder, type QueryObjectBuilderDensity, type QueryObjectBuilderProps, type QueryObjectValidationState, QueryValue, type QueryValueProps, ROLLUP_OPTIONS, RangeSelector, type RangeSelectorProps, RowPrHighlight, RowsResultsChrome, type RowsResultsChromeProps, RowsTable, type RowsTableProps, SEMVER, SERIES_COLORS, SOURCE_OPTIONS, SUGGESTION_BINDINGS, SessionTableSortSpec, StackedBar, type StackedBarProps, type StorageLike, type SuggestionBinding, type SuggestionCachePolicy, type SuggestionItem, TARGET_OPTIONS, TIME_OPTIONS, TokenSlotPill, type TokenSlotPillProps, TopList, type TopListProps, UNIT_OPTIONS, VERSION, type VisualViewportRect, WHERE_AGGREGATORS, WHERE_METRICS, WidgetChart, type WidgetChartProps, WidgetEditButton, WidgetFrame, type WidgetFrameProps, WidgetProblemBadge, type WidgetRunResult, type WidgetSpanOption, WidgetToolButton, type WqlAggregateSummary, WqlBars, type WqlBarsProps, WqlComposer, type WqlComposerProps, type WqlDiagnostics, WqlDiagnosticsStrip, type WqlDiagnosticsStripProps, WqlEmptyState, type WqlEmptyStateProps, type WqlExecutor, type WqlFindSummary, type WqlPipelineSummary, WqlQueryInspectorModal, type WqlQueryInspectorModalProps, type WqlSegmentEditRequest, type WqlStageCounts, WqlTable, type WqlTableProps, WqlTimeseries, type WqlTimeseriesProps, type WqlValidationState, ZoneDistribution, type ZoneDistributionProps, bindTokenParamIntoWql, bindTokenToQueryObject, blockTypesFromBlocks, canonicalSuggestionItems, cn, compactNumber, composerRegistry, computeSessionPrHighlights, createExecutorDocumentHost, cycleBaselineLayer, dateRangeSlot, editQueryClause, extractBlockQueries, formatTimestamp, getClauseMeta, getDashboardEffectiveUnit, getEffectiveAnalyticsUnit, getSuggestionBinding, hashCode, invalidateSuggestions, loadSuggestions, matchFilterTypeahead, mergeSeries, mergeSuggestionItems, mergeTagSuggestions, normalizeSimplePipelineToAggregate, notebookSlugsFromBlocks, outputToRunResult, outputsToRunResult, patchBlockQuery, primaryQueryOf, promoteFindToChartObject, readSessionRpe, readStoredUnit, removeSeriesLayer, resolveQueryDraft, setPrimaryQueryOnObject, setSuggestionBinding, summarizeAggregate, summarizeFind, summarizePipeline, tagsFromStaticBlocks, toChartResult, toggleCompareLayer, toggleGoalLayer, tooltipTimestamp, useAnalyticsQueries, useAnalyticsUnitPreference, useChartShape, useComposerSlots, useSuggestions, useVisualViewportRect, useWqlStageCounts, wqlToPills };