@bitcobblers/wod-wiki-lang 0.43.2153 → 0.44.2156
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/{browserRuntimeNow-M4hQ_DTl.d.cts → browserRuntimeNow-_zhhbzoE.d.cts} +294 -2
- package/dist/{browserRuntimeNow-M4hQ_DTl.d.ts → browserRuntimeNow-_zhhbzoE.d.ts} +294 -2
- package/dist/index.cjs +1497 -1116
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +246 -325
- package/dist/index.d.ts +246 -325
- package/dist/index.mjs +1483 -1115
- package/dist/index.mjs.map +1 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IMetric, MetricContainer, MetricOrigin, MetricType, IDialect, ICodeStatement, DialectAnalysis, ParsedCodeStatement, IOutputStatement, OutputStatementType, BlockKey, ScriptBlock, FenceDialect, Segment, AnalyticsGroup, StoredOutputStatement, OutputStatement } from '@bitcobblers/wod-wiki-core';
|
|
1
|
+
import { IMetric, MetricContainer, MetricOrigin, MetricType, IDialect, ICodeStatement, DialectAnalysis, TagIndex, ParsedCodeStatement, TagMetricContribution, IOutputStatement, OutputStatementType, BlockKey, TagReferenceMetadata, ScriptBlock, FenceDialect, Segment, AnalyticsGroup, StoredOutputStatement, OutputStatement } from '@bitcobblers/wod-wiki-core';
|
|
2
2
|
export { ParseError } from '@bitcobblers/wod-wiki-core';
|
|
3
|
-
import { R as ReferenceIndex, a as ReferenceResolutionDefaults, W as WhiteboardScript, I as IEquipment, b as IEffort, c as IEffortResolver, d as IEffortRegistry, E as EffortResolverOptions, e as EffortResolutionOptions, f as ResolvedEffort, g as EffortRegistrySource, h as EffortStorageAdapter, i as IRuntimeActionable, j as IEventBus, k as IRuntimeStack, l as IRuntimeClock, m as IJitCompiler, n as INowProvider, o as RuntimeStackOptions, p as RuntimeError, A as AnalyticsContext, q as IEvent, r as IRuntimeAction, O as OutputListener, U as Unsubscribe, s as IAnalyticsEngine, t as IRuntimeBlock, u as IBehaviorContext, B as BehaviorEventType, v as BehaviorEventListener, S as SubscribeOptions, w as Unsubscribe$1, x as OutputOptions, M as MemoryTag, y as IMemoryLocation, z as IRuntimeBehavior, C as IBlockContext, D as MetricVisibility, F as BlockLifecycleOptions, G as CompletionDecision, T as TimeSpan, H as IRuntimeMemory, J as TypedMemoryReference, K as MemorySearchCriteria, L as IMemoryReference, N as RuntimeStackLogger, P as StackObserver, Q as StackSnapshot, V as StackListener, X as MemoryTypeEnum, Y as IAnchorValue, Z as
|
|
4
|
-
export {
|
|
3
|
+
import { R as ReferenceIndex, a as ReferenceResolutionDefaults, W as WhiteboardScript, I as IEquipment, b as IEffort, c as IEffortResolver, d as IEffortRegistry, E as EffortResolverOptions, e as EffortResolutionOptions, f as ResolvedEffort, g as EffortRegistrySource, h as EffortStorageAdapter, i as IRuntimeActionable, j as IEventBus, k as IRuntimeStack, l as IRuntimeClock, m as IJitCompiler, n as INowProvider, o as RuntimeStackOptions, p as RuntimeError, A as AnalyticsContext, q as IEvent, r as IRuntimeAction, O as OutputListener, U as Unsubscribe, s as IAnalyticsEngine, t as IRuntimeBlock, u as IBehaviorContext, B as BehaviorEventType, v as BehaviorEventListener, S as SubscribeOptions, w as Unsubscribe$1, x as OutputOptions, M as MemoryTag, y as IMemoryLocation, z as IRuntimeBehavior, C as IBlockContext, D as MetricVisibility, F as BlockLifecycleOptions, G as CompletionDecision, T as TimeSpan, H as IRuntimeMemory, J as TypedMemoryReference, K as MemorySearchCriteria, L as IMemoryReference, N as RuntimeStackLogger, P as StackObserver, Q as StackSnapshot, V as StackListener, X as MemoryTypeEnum, Y as IAnchorValue, Z as SoundProfile, _ as ButtonConfig, $ as IEventHandler, a0 as HandlerScope, a1 as IScriptRuntime, a2 as TestableBlockConfig, a3 as IRuntimeOptions, a4 as ScriptRuntime, a5 as EventHandlerOptions, a6 as EventCallback, a7 as TimerState, a8 as CalculationDefinition$1, a9 as IRealtimeProcessor, aa as ISummaryProcessor, ab as ProjectionResult, ac as DimVector, ad as CalcLine, ae as ExprNode, af as CalcScope } from './browserRuntimeNow-_zhhbzoE.cjs';
|
|
4
|
+
export { ag as BinaryOp, ah as ButtonVariant, ai as ButtonsState, aj as CATALOG_PRECEDENCE_RANK, ak as CalcNode, al as CalcOrigin, am as CalcVariant, an as CatalogPrecedenceTier, ao as ChildrenStatusState, ap as CompletionState, aq as DEFAULT_RESOLVER_OPTIONS, ar as DEFAULT_RUNTIME_OPTIONS, as as DEFAULT_SOUND_PROFILE, at as DIM_COUNT, au as DIM_ENERGY, av as DIM_LENGTH, aw as DIM_MASS, ax as DIM_TIME, ay as DIM_ZERO, az as DISCIPLINE_FACTORS, aA as DisplayState, aB as EFFORT_DISCIPLINES, aC as EFFORT_REGISTRY_ORIGINS, aD as EffortBaseAttributes, aE as EffortDerivation, aF as EffortDiscipline, aG as EffortMaterializer, aH as EffortResolvedFrom, aI as EquipmentStorageAdapter, aJ as FenceDialect, aK as FragmentDisplayState, aL as FragmentState, aM as IAnalyticsProcessorDescriptor, aN as IEquipmentRegistry, aO as INTENSITY_TIERS, aP as IScript, aQ as IntensityTier, aR as InterceptMode, aS as MemoryLocation, aT as MemoryType, aU as MemoryTypeMap, aV as MemoryValueOf, aW as NAMED_COMPOUNDS, aX as ReferenceCatalog, aY as ResolvedReferences, aZ as RoundState, a_ as RuntimeState, a$ as ScriptRuntimeDependencies, b0 as SoundRule, b1 as SoundTriggerAnchor, b2 as SoundTriggerPoint, b3 as StackEvent, b4 as TimerDirection, b5 as VISIBILITY_ICONS, b6 as VISIBILITY_LABELS, b7 as addDim, b8 as compoundName, b9 as createBrowserRuntimeNow, ba as createReferenceIndex, bb as dedupeEntitiesByPrecedence, bc as dimEquals, bd as disciplineFactorFor, be as extractStatementRefs, bf as filterTagsByVisibility, bg as formatDim, bh as formatSoundTrigger, bi as frozenNow, bj as getMetricVisibility, bk as getRuntimeNowMs, bl as isDimensionless, bm as isEffortDiscipline, bn as isFragmentTag, bo as parseSoundTrigger, bp as resolveEntityRank, bq as resolveEntityTier, br as resolveProfileRules, bs as resolveSourceRank, bt as resolveSourceTier, bu as slugifyRefLabel, bv as subDim, bw as wallClockNow } from './browserRuntimeNow-_zhhbzoE.cjs';
|
|
5
5
|
import { Tree } from '@lezer/common';
|
|
6
6
|
import { LanguageSupport, LRLanguage } from '@codemirror/language';
|
|
7
7
|
import { LRParser } from '@lezer/lr';
|
|
@@ -587,7 +587,7 @@ interface SyntaxMeta {
|
|
|
587
587
|
raw: string;
|
|
588
588
|
}
|
|
589
589
|
interface BasePrimitive {
|
|
590
|
-
kind: 'lap' | 'duration' | 'rounds' | 'round_scheme' | 'action' | 'text' | 'heading' | 'quantity' | 'effort' | 'property' | 'metric_object';
|
|
590
|
+
kind: 'lap' | 'duration' | 'rounds' | 'round_scheme' | 'action' | 'text' | 'heading' | 'quantity' | 'effort' | 'property' | 'metric_object' | 'tag_ref';
|
|
591
591
|
raw: string;
|
|
592
592
|
meta: SyntaxMeta;
|
|
593
593
|
}
|
|
@@ -653,8 +653,28 @@ interface PropertyPrimitive extends BasePrimitive {
|
|
|
653
653
|
key: string;
|
|
654
654
|
valueRaw: string;
|
|
655
655
|
value: string | number | boolean | null;
|
|
656
|
+
/**
|
|
657
|
+
* The tag slugs when the value is one or more tag references
|
|
658
|
+
* (`#tag-slug`). Several can be stacked on one line.
|
|
659
|
+
*
|
|
660
|
+
* A tag reference names a tag rather than repeating what the tag means.
|
|
661
|
+
* The parser records the references; resolving them to metrics is the
|
|
662
|
+
* classifier's job, since only it knows the tag catalog.
|
|
663
|
+
*/
|
|
664
|
+
tagRefs?: string[];
|
|
656
665
|
}
|
|
657
|
-
|
|
666
|
+
/**
|
|
667
|
+
* A tag reference standing on its own — `5 reps @ 100 kg #heavy`.
|
|
668
|
+
*
|
|
669
|
+
* The reference names a tag rather than repeating what the tag means, so
|
|
670
|
+
* the tag applies to the line it sits on.
|
|
671
|
+
*/
|
|
672
|
+
interface TagRefPrimitive extends BasePrimitive {
|
|
673
|
+
kind: 'tag_ref';
|
|
674
|
+
/** The slug the reference names. */
|
|
675
|
+
slug: string;
|
|
676
|
+
}
|
|
677
|
+
type SyntaxPrimitive = LapPrimitive | DurationPrimitive | RoundsPrimitive | RoundSchemePrimitive | ActionPrimitive | TextPrimitive | HeadingPrimitive | QuantityPrimitive | EffortPrimitive | PropertyPrimitive | MetricObjectPrimitive | TagRefPrimitive;
|
|
658
678
|
interface SyntaxStatement {
|
|
659
679
|
id: number;
|
|
660
680
|
line: number;
|
|
@@ -672,6 +692,8 @@ interface SyntaxFacts {
|
|
|
672
692
|
interface ParseReferences {
|
|
673
693
|
index: ReferenceIndex;
|
|
674
694
|
defaults?: ReferenceResolutionDefaults;
|
|
695
|
+
/** Tags a script can reference with `#tag-slug`. */
|
|
696
|
+
tags?: TagIndex;
|
|
675
697
|
}
|
|
676
698
|
declare function classifyStatements(facts: SyntaxFacts, references?: ParseReferences): ParsedCodeStatement[];
|
|
677
699
|
|
|
@@ -732,6 +754,8 @@ interface ParseOptions {
|
|
|
732
754
|
references?: ReferenceIndex;
|
|
733
755
|
/** Note-level `metrics.*` defaults applied by the resolver. */
|
|
734
756
|
defaults?: ReferenceResolutionDefaults;
|
|
757
|
+
/** Tags a script can reference with `#tag-slug`. */
|
|
758
|
+
tags?: TagIndex;
|
|
735
759
|
}
|
|
736
760
|
/**
|
|
737
761
|
* Parses Whiteboard Script source directly into a WhiteboardScript AST
|
|
@@ -746,6 +770,8 @@ declare function parseScript(inputText: string, options?: ParseOptions): Whitebo
|
|
|
746
770
|
interface ParserConfig {
|
|
747
771
|
references?: ReferenceIndex;
|
|
748
772
|
defaults?: ReferenceResolutionDefaults;
|
|
773
|
+
/** Tags a script can reference with `#tag-slug`. */
|
|
774
|
+
tags?: TagIndex;
|
|
749
775
|
}
|
|
750
776
|
/**
|
|
751
777
|
* Headless parser facade using the Lezer parser with 0 DOM / EditorState overhead.
|
|
@@ -1040,6 +1066,69 @@ declare const BUNDLED_EFFORT_COUNT: number;
|
|
|
1040
1066
|
*/
|
|
1041
1067
|
declare function addAliasToEffort(registry: IEffortRegistry, targetSlug: string, newAlias: string): Promise<IEffort>;
|
|
1042
1068
|
|
|
1069
|
+
/**
|
|
1070
|
+
* Tag contributions — what a `#slug` reference resolves to.
|
|
1071
|
+
*
|
|
1072
|
+
* A tag contributes metrics (a typed value with a unit), other tags, and
|
|
1073
|
+
* functions (named calculations). Resolving a reference flattens that
|
|
1074
|
+
* structure: nested tags are walked, functions are collected by name, and
|
|
1075
|
+
* metric contributions keep the order the tags declare them in.
|
|
1076
|
+
*
|
|
1077
|
+
* The resolver is defensive about cycles — a tag that applies itself, directly
|
|
1078
|
+
* or through other tags, contributes nothing further rather than looping.
|
|
1079
|
+
*/
|
|
1080
|
+
|
|
1081
|
+
/**
|
|
1082
|
+
* The metric type prefix that marks a statement as carrying a tag.
|
|
1083
|
+
*
|
|
1084
|
+
* A marker is how tag activation survives into the runtime: the statement's
|
|
1085
|
+
* metrics travel with the segment, so a marker on the statement is a marker
|
|
1086
|
+
* on the segment — and on the stored log.
|
|
1087
|
+
*/
|
|
1088
|
+
declare const TAG_MARKER_PREFIX = "tag.";
|
|
1089
|
+
/** How deep nested tag references may go. */
|
|
1090
|
+
declare const MAX_TAG_CONTRIBUTION_DEPTH = 8;
|
|
1091
|
+
/** What a tag reference resolves to. */
|
|
1092
|
+
interface ResolvedTagContributions {
|
|
1093
|
+
/** Metric contributions, in the order the tags declare them. */
|
|
1094
|
+
readonly metrics: readonly TagMetricContribution[];
|
|
1095
|
+
/** Names of the functions the tags carry, without duplicates. */
|
|
1096
|
+
readonly functions: readonly string[];
|
|
1097
|
+
/** Every tag involved — the referenced tag and the tags it applies. */
|
|
1098
|
+
readonly tags: readonly string[];
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
* Resolve what a tag reference contributes.
|
|
1102
|
+
*
|
|
1103
|
+
* A reference to a tag the catalogue does not know contributes nothing — the
|
|
1104
|
+
* line keeps whatever else it says.
|
|
1105
|
+
*/
|
|
1106
|
+
declare function resolveTagContributions(tagIndex: TagIndex | undefined, slug: string): ResolvedTagContributions;
|
|
1107
|
+
/**
|
|
1108
|
+
* The cycles in a catalogue's tag graph.
|
|
1109
|
+
*
|
|
1110
|
+
* Each cycle is the slugs that form it, with the entry slug repeated at the
|
|
1111
|
+
* end. A catalogue with no cycles returns an empty list.
|
|
1112
|
+
*/
|
|
1113
|
+
declare function findTagContributionCycles(tagIndex: TagIndex | undefined): string[][];
|
|
1114
|
+
/**
|
|
1115
|
+
* The metric type that marks a statement as carrying a tag.
|
|
1116
|
+
*/
|
|
1117
|
+
declare function tagMarkerType(slug: string): string;
|
|
1118
|
+
/**
|
|
1119
|
+
* The tag slug a marker metric type refers to, or `undefined` when the type
|
|
1120
|
+
* is not a marker.
|
|
1121
|
+
*/
|
|
1122
|
+
declare function tagMarkerSlug(type: string): string | undefined;
|
|
1123
|
+
/**
|
|
1124
|
+
* The tag slugs a set of metrics marks.
|
|
1125
|
+
*/
|
|
1126
|
+
declare function tagMarkerSlugs(metrics: Iterable<IMetric>): string[];
|
|
1127
|
+
/**
|
|
1128
|
+
* The metric a tag's metric contributions produce.
|
|
1129
|
+
*/
|
|
1130
|
+
declare function tagContributionMetrics(contributions: readonly TagMetricContribution[], origin?: MetricOrigin): IMetric[];
|
|
1131
|
+
|
|
1043
1132
|
/**
|
|
1044
1133
|
* IRuntimeContext — what the execution world (actions, blocks, behaviors)
|
|
1045
1134
|
* receives. The runtime's collaborators (the "bag") plus the verbs to enqueue
|
|
@@ -1376,6 +1465,8 @@ interface RuntimeBlockOptions {
|
|
|
1376
1465
|
label?: string;
|
|
1377
1466
|
/** Optional display metric groups, each stored as a `metric:display` location. */
|
|
1378
1467
|
metrics?: MetricContainer[] | IMetric[][];
|
|
1468
|
+
/** The tags this block's statements referenced, resolved at compile time. */
|
|
1469
|
+
tagComposition?: readonly TagReferenceMetadata[];
|
|
1379
1470
|
}
|
|
1380
1471
|
/**
|
|
1381
1472
|
* RuntimeBlock represents an executable unit in the workout runtime.
|
|
@@ -1397,6 +1488,8 @@ declare class RuntimeBlock implements IRuntimeBlock {
|
|
|
1397
1488
|
readonly blockType?: string;
|
|
1398
1489
|
readonly context: IBlockContext;
|
|
1399
1490
|
readonly sourceIds: number[];
|
|
1491
|
+
/** The tags this block's statements referenced, resolved at compile time. */
|
|
1492
|
+
readonly tagComposition?: readonly TagReferenceMetadata[];
|
|
1400
1493
|
private _memory;
|
|
1401
1494
|
/**
|
|
1402
1495
|
* Computed label derived from the block's Label metrics.
|
|
@@ -2350,59 +2443,65 @@ declare class ReportOutputBehavior implements IRuntimeBehavior {
|
|
|
2350
2443
|
}
|
|
2351
2444
|
|
|
2352
2445
|
/**
|
|
2353
|
-
*
|
|
2446
|
+
* The runtime event a sound cue is published on.
|
|
2447
|
+
*
|
|
2448
|
+
* Listeners (the app's audio layer) subscribe to this to play the sound.
|
|
2449
|
+
* The event carries the sound's **name** — the profile decides the name,
|
|
2450
|
+
* the app decides what it sounds like.
|
|
2354
2451
|
*/
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
sound: string;
|
|
2360
|
-
/** When to play: 'mount' | 'unmount' | 'countdown' | 'complete' */
|
|
2361
|
-
trigger: SoundTrigger;
|
|
2362
|
-
/** Countdown seconds (only for trigger: 'countdown') */
|
|
2363
|
-
atSeconds?: number[];
|
|
2364
|
-
}
|
|
2365
|
-
interface SoundCueConfig {
|
|
2366
|
-
/** Sound cues to play */
|
|
2367
|
-
cues: SoundCue$1[];
|
|
2452
|
+
declare const SOUND_PLAY_EVENT = "sound:play";
|
|
2453
|
+
interface SoundProfileBehaviorConfig {
|
|
2454
|
+
/** The profile whose rules drive this block's cues. */
|
|
2455
|
+
profile: SoundProfile;
|
|
2368
2456
|
}
|
|
2369
2457
|
/**
|
|
2370
|
-
*
|
|
2371
|
-
*
|
|
2372
|
-
* ## Aspect: Output (Audio)
|
|
2373
|
-
*
|
|
2374
|
-
* Emits 'system' outputs with SoundMetric that audio systems can observe.
|
|
2375
|
-
* Sound outputs are tracked as system events so they do not appear in the
|
|
2376
|
-
* user-facing review/logs page — only in the debug view.
|
|
2377
|
-
* This follows the principle that behaviors emit outputs, not events.
|
|
2378
|
-
*
|
|
2379
|
-
* ## Output Contract
|
|
2380
|
-
*
|
|
2381
|
-
* - **Mount**: Emits system output for 'mount' trigger sounds
|
|
2382
|
-
* - **Tick**: Emits system output for 'countdown' trigger sounds at specified seconds
|
|
2383
|
-
* - **Unmount**: Emits system output for 'unmount' and 'complete' trigger sounds
|
|
2458
|
+
* SoundProfileBehavior — plays a profile's rules at their trigger points.
|
|
2384
2459
|
*
|
|
2385
|
-
*
|
|
2460
|
+
* This is the generic replacement for the per-strategy hardcoded cues. Every
|
|
2461
|
+
* profile rule is expressed as an offset relative to the block's own duration,
|
|
2462
|
+
* so one profile applies to any block length:
|
|
2386
2463
|
*
|
|
2387
|
-
*
|
|
2388
|
-
*
|
|
2464
|
+
* - `anchor: 'start'`, offset 0 → fires on mount.
|
|
2465
|
+
* - `anchor: 'end'`, offset 0 → fires on unmount.
|
|
2466
|
+
* - `anchor: 'end'`, offset N → fires when N ms remain (a countdown).
|
|
2467
|
+
* - `anchor: 'start'`, offset N → fires when N ms have elapsed.
|
|
2389
2468
|
*
|
|
2390
|
-
*
|
|
2391
|
-
*
|
|
2392
|
-
*
|
|
2393
|
-
*
|
|
2394
|
-
*
|
|
2395
|
-
* }
|
|
2396
|
-
* });
|
|
2397
|
-
* ```
|
|
2469
|
+
* Each firing does two things: it records a {@link SoundMetric} output (so
|
|
2470
|
+
* history and analytics know a sound happened) and it emits a
|
|
2471
|
+
* {@link SOUND_PLAY_EVENT} event (so the app plays it). Recording and
|
|
2472
|
+
* playing are deliberately separate — the metric is a fact, the event is a
|
|
2473
|
+
* command.
|
|
2398
2474
|
*/
|
|
2399
|
-
declare class
|
|
2475
|
+
declare class SoundProfileBehavior implements IRuntimeBehavior {
|
|
2400
2476
|
private config;
|
|
2401
|
-
|
|
2477
|
+
private rules;
|
|
2478
|
+
/** Rule indices already fired, so each rule fires exactly once. */
|
|
2479
|
+
private readonly fired;
|
|
2480
|
+
private durationMs;
|
|
2481
|
+
constructor(config: SoundProfileBehaviorConfig);
|
|
2402
2482
|
onMount(ctx: IBehaviorContext): IRuntimeAction[];
|
|
2403
2483
|
onNext(_ctx: IBehaviorContext): IRuntimeAction[];
|
|
2404
2484
|
onUnmount(ctx: IBehaviorContext): IRuntimeAction[];
|
|
2405
2485
|
onDispose(_ctx: IBehaviorContext): void;
|
|
2486
|
+
/**
|
|
2487
|
+
* Elapsed milliseconds for the block's own timer, or `undefined` when the
|
|
2488
|
+
* block has no timer to measure against.
|
|
2489
|
+
*/
|
|
2490
|
+
private elapsedMs;
|
|
2491
|
+
/**
|
|
2492
|
+
* Fire every rule whose trigger point has been reached.
|
|
2493
|
+
*
|
|
2494
|
+
* @param elapsed milliseconds elapsed on the block's timer
|
|
2495
|
+
* @param durationMs the block's total duration
|
|
2496
|
+
* @param ending whether the block is ending — a rule anchored to the end
|
|
2497
|
+
* with no offset fires then, even when the block has no duration to
|
|
2498
|
+
* count down from
|
|
2499
|
+
*/
|
|
2500
|
+
private fireDue;
|
|
2501
|
+
/**
|
|
2502
|
+
* Record the cue and command its playback.
|
|
2503
|
+
*/
|
|
2504
|
+
private play;
|
|
2406
2505
|
}
|
|
2407
2506
|
|
|
2408
2507
|
interface ControlsConfig {
|
|
@@ -2514,6 +2613,8 @@ declare class BlockBuilder {
|
|
|
2514
2613
|
private blockType;
|
|
2515
2614
|
private metrics;
|
|
2516
2615
|
private sourceIds;
|
|
2616
|
+
/** The tags the block's statements referenced, resolved at compile time. */
|
|
2617
|
+
private tagComposition;
|
|
2517
2618
|
/** Pending round config stored by asRepeater(), consumed by asContainer() */
|
|
2518
2619
|
private pendingRoundConfig;
|
|
2519
2620
|
/** Declared exit intent — resolved into a single ExitBehavior in build(). */
|
|
@@ -2564,6 +2665,8 @@ declare class BlockBuilder {
|
|
|
2564
2665
|
setBlockType(type: string): BlockBuilder;
|
|
2565
2666
|
setFragments(metrics: IMetric[][] | MetricContainer[]): BlockBuilder;
|
|
2566
2667
|
setSourceIds(ids: number[]): BlockBuilder;
|
|
2668
|
+
/** The tags the block's statements referenced, and what each carried. */
|
|
2669
|
+
setTagComposition(composition: readonly TagReferenceMetadata[]): BlockBuilder;
|
|
2567
2670
|
getLabel(): string;
|
|
2568
2671
|
getBlockType(): string;
|
|
2569
2672
|
getFragments(): MetricContainer[] | undefined;
|
|
@@ -3101,56 +3204,6 @@ declare class UnregisterEventHandlerAction implements IRuntimeAction {
|
|
|
3101
3204
|
do(runtime: IRuntimeContext): void;
|
|
3102
3205
|
}
|
|
3103
3206
|
|
|
3104
|
-
/**
|
|
3105
|
-
* Action for playing sounds during workout execution.
|
|
3106
|
-
*
|
|
3107
|
-
* This action emits a 'sound:play' event that can be consumed by UI components
|
|
3108
|
-
* to trigger audio playback. The runtime itself does not handle audio playback
|
|
3109
|
-
* directly - it delegates to registered sound handlers.
|
|
3110
|
-
*
|
|
3111
|
-
* @example
|
|
3112
|
-
* ```typescript
|
|
3113
|
-
* // Play a predefined beep sound
|
|
3114
|
-
* return [new PlaySoundAction('beep')];
|
|
3115
|
-
*
|
|
3116
|
-
* // Play a sound at 50% volume
|
|
3117
|
-
* return [new PlaySoundAction('buzzer', 0.5)];
|
|
3118
|
-
*
|
|
3119
|
-
* // Play a custom sound URL
|
|
3120
|
-
* return [new PlaySoundAction('https://example.com/sound.mp3')];
|
|
3121
|
-
* ```
|
|
3122
|
-
*/
|
|
3123
|
-
declare class PlaySoundAction implements IRuntimeAction {
|
|
3124
|
-
/**
|
|
3125
|
-
* Sound identifier. Can be:
|
|
3126
|
-
* - Predefined sound name: 'beep', 'buzzer', 'chime', 'tick'
|
|
3127
|
-
* - URL to audio file
|
|
3128
|
-
*/
|
|
3129
|
-
readonly sound: string;
|
|
3130
|
-
/** Volume level (0.0 to 1.0). Default is 1.0 */
|
|
3131
|
-
readonly volume: number;
|
|
3132
|
-
/** Optional cue ID for tracking which cue triggered this sound */
|
|
3133
|
-
readonly cueId?: string | undefined;
|
|
3134
|
-
private readonly now;
|
|
3135
|
-
readonly type = "play-sound";
|
|
3136
|
-
constructor(
|
|
3137
|
-
/**
|
|
3138
|
-
* Sound identifier. Can be:
|
|
3139
|
-
* - Predefined sound name: 'beep', 'buzzer', 'chime', 'tick'
|
|
3140
|
-
* - URL to audio file
|
|
3141
|
-
*/
|
|
3142
|
-
sound: string,
|
|
3143
|
-
/** Volume level (0.0 to 1.0). Default is 1.0 */
|
|
3144
|
-
volume?: number,
|
|
3145
|
-
/** Optional cue ID for tracking which cue triggered this sound */
|
|
3146
|
-
cueId?: string | undefined, now?: INowProvider);
|
|
3147
|
-
/**
|
|
3148
|
-
* Executes the sound playback by emitting a 'sound:play' event.
|
|
3149
|
-
* UI components should register handlers for this event to play audio.
|
|
3150
|
-
*/
|
|
3151
|
-
do(runtime: IRuntimeContext): IRuntimeAction[];
|
|
3152
|
-
}
|
|
3153
|
-
|
|
3154
3207
|
/**
|
|
3155
3208
|
* Action that registers a runtime error and transitions the workout to an error state.
|
|
3156
3209
|
*/
|
|
@@ -3789,19 +3842,25 @@ declare class ReportOutputStrategy implements IRuntimeBlockStrategy {
|
|
|
3789
3842
|
}
|
|
3790
3843
|
|
|
3791
3844
|
/**
|
|
3792
|
-
* SoundStrategy
|
|
3845
|
+
* SoundStrategy attaches the block's sound cues.
|
|
3793
3846
|
*
|
|
3794
|
-
*
|
|
3795
|
-
* -
|
|
3847
|
+
* Unlike the strategies it replaces, this one carries no hardcoded cues. The
|
|
3848
|
+
* cues come from a **sound profile** — a user-defined set of rules mapping
|
|
3849
|
+
* trigger points to sounds — resolved here at compile time:
|
|
3796
3850
|
*
|
|
3797
|
-
*
|
|
3798
|
-
*
|
|
3851
|
+
* 1. A `sound` metric on the block's own statements (the line-level
|
|
3852
|
+
* selection) wins.
|
|
3853
|
+
* 2. Otherwise the note-level selection, passed in by the host.
|
|
3854
|
+
* 3. Otherwise the default profile.
|
|
3855
|
+
*
|
|
3856
|
+
* The resolved profile's rules are handed to {@link SoundProfileBehavior},
|
|
3857
|
+
* which fires them at their trigger points.
|
|
3799
3858
|
*/
|
|
3800
3859
|
declare class SoundStrategy implements IRuntimeBlockStrategy {
|
|
3801
3860
|
priority: number;
|
|
3802
3861
|
readonly id = "sound";
|
|
3803
3862
|
match(statements: ICodeStatement[], _runtime: IRuntimeContext): boolean;
|
|
3804
|
-
apply(builder: BlockBuilder,
|
|
3863
|
+
apply(builder: BlockBuilder, statements: ICodeStatement[], runtime: IRuntimeContext): void;
|
|
3805
3864
|
}
|
|
3806
3865
|
|
|
3807
3866
|
declare class RoundsMetric implements IMetric {
|
|
@@ -3894,80 +3953,6 @@ interface RuntimeControls {
|
|
|
3894
3953
|
displayMode?: 'timer' | 'clock';
|
|
3895
3954
|
}
|
|
3896
3955
|
|
|
3897
|
-
/**
|
|
3898
|
-
* Sound-related type definitions for the runtime.
|
|
3899
|
-
*/
|
|
3900
|
-
/**
|
|
3901
|
-
* Configuration for a single sound cue.
|
|
3902
|
-
* Sound cues are triggered when a timer reaches a specific threshold.
|
|
3903
|
-
*/
|
|
3904
|
-
interface SoundCue {
|
|
3905
|
-
/** Unique identifier for this cue */
|
|
3906
|
-
id: string;
|
|
3907
|
-
/**
|
|
3908
|
-
* Time threshold in milliseconds when this cue should trigger.
|
|
3909
|
-
* For countdown timers: triggers when remainingMs <= threshold
|
|
3910
|
-
* For count-up timers: triggers when elapsedMs >= threshold
|
|
3911
|
-
*/
|
|
3912
|
-
threshold: number;
|
|
3913
|
-
/**
|
|
3914
|
-
* Sound to play. Can be:
|
|
3915
|
-
* - Predefined sound name: 'beep', 'buzzer', 'chime', 'tick'
|
|
3916
|
-
* - URL to audio file
|
|
3917
|
-
*/
|
|
3918
|
-
sound: string;
|
|
3919
|
-
/** Volume level (0.0 to 1.0). Default is 1.0 */
|
|
3920
|
-
volume?: number;
|
|
3921
|
-
}
|
|
3922
|
-
/**
|
|
3923
|
-
* State tracking for a single sound cue.
|
|
3924
|
-
* Used to prevent duplicate triggers.
|
|
3925
|
-
*/
|
|
3926
|
-
interface SoundCueState {
|
|
3927
|
-
/** Reference to the cue configuration ID */
|
|
3928
|
-
cueId: string;
|
|
3929
|
-
/** Whether this cue has been triggered */
|
|
3930
|
-
triggered: boolean;
|
|
3931
|
-
/** Timestamp when the cue was triggered (ms since epoch) */
|
|
3932
|
-
triggeredAt?: number;
|
|
3933
|
-
}
|
|
3934
|
-
/**
|
|
3935
|
-
* Configuration for SoundBehavior.
|
|
3936
|
-
*/
|
|
3937
|
-
interface SoundBehaviorConfig {
|
|
3938
|
-
/** Direction of the timer ('up' for count-up, 'down' for countdown) */
|
|
3939
|
-
direction: 'up' | 'down';
|
|
3940
|
-
/** Total duration for countdown timers (required for 'down' direction) */
|
|
3941
|
-
durationMs?: number;
|
|
3942
|
-
/** Array of sound cues to trigger at specific time thresholds */
|
|
3943
|
-
cues: SoundCue[];
|
|
3944
|
-
}
|
|
3945
|
-
/**
|
|
3946
|
-
* Runtime state for sound behavior stored in memory.
|
|
3947
|
-
*/
|
|
3948
|
-
interface SoundState {
|
|
3949
|
-
/** Block ID that owns this sound state */
|
|
3950
|
-
blockId: string;
|
|
3951
|
-
/** State of each configured cue */
|
|
3952
|
-
cues: SoundCueState[];
|
|
3953
|
-
}
|
|
3954
|
-
/**
|
|
3955
|
-
* Predefined sound names that can be used in SoundCue.sound
|
|
3956
|
-
*/
|
|
3957
|
-
declare const PREDEFINED_SOUNDS: {
|
|
3958
|
-
/** Short single beep - good for countdown ticks */
|
|
3959
|
-
readonly BEEP: "beep";
|
|
3960
|
-
/** Long buzz - good for timer completion */
|
|
3961
|
-
readonly BUZZER: "buzzer";
|
|
3962
|
-
/** Pleasant chime - good for milestones */
|
|
3963
|
-
readonly CHIME: "chime";
|
|
3964
|
-
/** Clock tick - good for second-by-second countdown */
|
|
3965
|
-
readonly TICK: "tick";
|
|
3966
|
-
/** Ascending sequence - good for timer start */
|
|
3967
|
-
readonly START: "start";
|
|
3968
|
-
};
|
|
3969
|
-
type PredefinedSoundName = typeof PREDEFINED_SOUNDS[keyof typeof PREDEFINED_SOUNDS];
|
|
3970
|
-
|
|
3971
3956
|
/**
|
|
3972
3957
|
* Calculates **Elapsed** time from timer spans.
|
|
3973
3958
|
*
|
|
@@ -4096,14 +4081,14 @@ interface RestBlockConfig {
|
|
|
4096
4081
|
* - ReportOutputBehavior (output on mount/unmount)
|
|
4097
4082
|
* - CountdownTimerBehavior (countdown timer + pause/resume + auto-complete)
|
|
4098
4083
|
* - LabelingBehavior (show rest countdown)
|
|
4099
|
-
* -
|
|
4084
|
+
* - SoundProfileBehavior (the block's sound profile)
|
|
4100
4085
|
*/
|
|
4101
4086
|
declare class RestBlock extends RuntimeBlock {
|
|
4102
4087
|
constructor(runtime: IRuntimeContext, config: RestBlockConfig);
|
|
4103
4088
|
/**
|
|
4104
4089
|
* Builds the behavior list for a rest block.
|
|
4105
4090
|
*/
|
|
4106
|
-
static buildBehaviors(config: RestBlockConfig): IRuntimeBehavior[];
|
|
4091
|
+
static buildBehaviors(config: RestBlockConfig, soundOptions?: RuntimeStackOptions['soundOptions']): IRuntimeBehavior[];
|
|
4107
4092
|
mount(runtime: IRuntimeContext, options?: BlockLifecycleOptions): IRuntimeAction[];
|
|
4108
4093
|
unmount(runtime: IRuntimeContext, options?: BlockLifecycleOptions): IRuntimeAction[];
|
|
4109
4094
|
dispose(runtime: IRuntimeContext): void;
|
|
@@ -4141,6 +4126,32 @@ declare class WaitingToStartBlock extends RuntimeBlock {
|
|
|
4141
4126
|
dispose(runtime: IRuntimeContext): void;
|
|
4142
4127
|
}
|
|
4143
4128
|
|
|
4129
|
+
/**
|
|
4130
|
+
* The metric type a block uses to name its own sound profile.
|
|
4131
|
+
*
|
|
4132
|
+
* A block-level selection is written as a `sound` metric — `sound: classic`
|
|
4133
|
+
* in script content, or contributed by a `#sound-classic` tag reference.
|
|
4134
|
+
*/
|
|
4135
|
+
declare const SOUND_PROFILE_METRIC = MetricType.Sound;
|
|
4136
|
+
/**
|
|
4137
|
+
* Resolve the sound profile for a block.
|
|
4138
|
+
*
|
|
4139
|
+
* Three levels, most specific wins:
|
|
4140
|
+
*
|
|
4141
|
+
* 1. **Block** — a `sound` metric on the block's own statements. This is the
|
|
4142
|
+
* line-level selection; it overrides everything below.
|
|
4143
|
+
* 2. **Note** — the profile selected by a note-level `sound-{profile}` tag,
|
|
4144
|
+
* resolved by the host and passed in as `noteProfileId`.
|
|
4145
|
+
* 3. **Default** — {@link DEFAULT_SOUND_PROFILE}, when nothing is selected.
|
|
4146
|
+
*
|
|
4147
|
+
* @param statements the block's statements, searched for a `sound` metric
|
|
4148
|
+
* @param options the runtime's sound options
|
|
4149
|
+
*/
|
|
4150
|
+
declare function resolveSoundProfile(statements: readonly ICodeStatement[], options?: {
|
|
4151
|
+
profiles?: readonly SoundProfile[];
|
|
4152
|
+
noteProfileId?: string;
|
|
4153
|
+
}): SoundProfile;
|
|
4154
|
+
|
|
4144
4155
|
/**
|
|
4145
4156
|
* Consumer-facing strategy registry, pre-seeded with the built-in strategies.
|
|
4146
4157
|
*
|
|
@@ -4419,152 +4430,6 @@ declare class SubscriptionManager {
|
|
|
4419
4430
|
dispose(): void;
|
|
4420
4431
|
}
|
|
4421
4432
|
|
|
4422
|
-
/**
|
|
4423
|
-
* AST for the composed-calculation expression language (spec §2).
|
|
4424
|
-
*
|
|
4425
|
-
* One expression language across all three scopes; scope only changes how
|
|
4426
|
-
* atoms resolve. `wql` atoms are legal in store scope only (executed by
|
|
4427
|
-
* QueryService); stream aggregates (`sum(reps)`) are builtin calls resolved
|
|
4428
|
-
* by the engine, not by this core.
|
|
4429
|
-
*/
|
|
4430
|
-
type BinaryOp = '+' | '-' | '*' | '/' | '==' | '!=' | '<' | '<=' | '>' | '>=' | 'and' | 'or';
|
|
4431
|
-
type ExprNode = {
|
|
4432
|
-
kind: 'literal';
|
|
4433
|
-
value: number;
|
|
4434
|
-
} | {
|
|
4435
|
-
kind: 'period';
|
|
4436
|
-
days: number;
|
|
4437
|
-
} | {
|
|
4438
|
-
kind: 'string';
|
|
4439
|
-
value: string;
|
|
4440
|
-
}
|
|
4441
|
-
/** Metric ref, context node (`session.duration`), or library node ref. */
|
|
4442
|
-
| {
|
|
4443
|
-
kind: 'ref';
|
|
4444
|
-
name: string;
|
|
4445
|
-
} | {
|
|
4446
|
-
kind: 'call';
|
|
4447
|
-
name: string;
|
|
4448
|
-
args: ExprNode[];
|
|
4449
|
-
}
|
|
4450
|
-
/** Effort-exclusion filter argument: `without: rest|pause|rest-*`. */
|
|
4451
|
-
| {
|
|
4452
|
-
kind: 'filter';
|
|
4453
|
-
value: string;
|
|
4454
|
-
} | {
|
|
4455
|
-
kind: 'unary';
|
|
4456
|
-
op: '-' | 'not';
|
|
4457
|
-
arg: ExprNode;
|
|
4458
|
-
} | {
|
|
4459
|
-
kind: 'binary';
|
|
4460
|
-
op: BinaryOp;
|
|
4461
|
-
left: ExprNode;
|
|
4462
|
-
right: ExprNode;
|
|
4463
|
-
}
|
|
4464
|
-
/** Store-scope WQL selection, e.g. `sum:sessionLoad{} by {day}`. */
|
|
4465
|
-
| {
|
|
4466
|
-
kind: 'wql';
|
|
4467
|
-
aggregator: string;
|
|
4468
|
-
metric: string;
|
|
4469
|
-
filters?: string;
|
|
4470
|
-
groupBy?: string[];
|
|
4471
|
-
};
|
|
4472
|
-
/** A parsed calc line: `name = expr -> unit when predicate`. */
|
|
4473
|
-
interface CalcLine {
|
|
4474
|
-
name: string;
|
|
4475
|
-
expr: ExprNode;
|
|
4476
|
-
unit?: string;
|
|
4477
|
-
when?: ExprNode;
|
|
4478
|
-
}
|
|
4479
|
-
|
|
4480
|
-
/**
|
|
4481
|
-
* Exponent-vector dimension model for the composed calculations layer.
|
|
4482
|
-
*
|
|
4483
|
-
* Dimensions are 5-element exponent vectors over base physical quantities:
|
|
4484
|
-
* [L, M, T, C, E] = [length, mass, time, count(reps), energy(cal)]
|
|
4485
|
-
*
|
|
4486
|
-
* Algebra (docs/composed-calculations-spec.md §5.1):
|
|
4487
|
-
* Dim(a * b) = Dim(a) + Dim(b)
|
|
4488
|
-
* Dim(a / b) = Dim(a) − Dim(b)
|
|
4489
|
-
* Dim(a ± b) requires Dim(a) = Dim(b) (static registration failure otherwise)
|
|
4490
|
-
*/
|
|
4491
|
-
type DimVector = readonly [number, number, number, number, number];
|
|
4492
|
-
declare const DIM_ZERO: DimVector;
|
|
4493
|
-
declare const DIM_LENGTH: DimVector;
|
|
4494
|
-
declare const DIM_MASS: DimVector;
|
|
4495
|
-
declare const DIM_TIME: DimVector;
|
|
4496
|
-
declare const DIM_COUNT: DimVector;
|
|
4497
|
-
declare const DIM_ENERGY: DimVector;
|
|
4498
|
-
declare function addDim(a: DimVector, b: DimVector): DimVector;
|
|
4499
|
-
declare function subDim(a: DimVector, b: DimVector): DimVector;
|
|
4500
|
-
declare function dimEquals(a: DimVector, b: DimVector): boolean;
|
|
4501
|
-
declare function isDimensionless(d: DimVector): boolean;
|
|
4502
|
-
/** Human-readable vector, e.g. "T·L⁻¹" for pace. */
|
|
4503
|
-
declare function formatDim(d: DimVector): string;
|
|
4504
|
-
/**
|
|
4505
|
-
* Named compound dimension registry (spec §5.2). Used for diagnostics and
|
|
4506
|
-
* dimension-filtered unit suggestions — not required for evaluation.
|
|
4507
|
-
*/
|
|
4508
|
-
declare const NAMED_COMPOUNDS: Record<string, {
|
|
4509
|
-
dim: DimVector;
|
|
4510
|
-
preferredUnits: string[];
|
|
4511
|
-
}>;
|
|
4512
|
-
/** Reverse lookup: find the compound name for a vector, if one exists. */
|
|
4513
|
-
declare function compoundName(d: DimVector): string | undefined;
|
|
4514
|
-
|
|
4515
|
-
/**
|
|
4516
|
-
* Canonical Node DAG records (spec §2.2) — the storage/registration form for
|
|
4517
|
-
* calculations. Seeds are TS object literals (#849); the line-form parser
|
|
4518
|
-
* (#863) must round-trip these losslessly.
|
|
4519
|
-
*/
|
|
4520
|
-
|
|
4521
|
-
type CalcOrigin = 'analyzed' | 'analyzed-estimated' | 'user';
|
|
4522
|
-
type CalcScope = 'segment' | 'workout' | 'store';
|
|
4523
|
-
interface CalcNode {
|
|
4524
|
-
id: string;
|
|
4525
|
-
kind: 'metric' | 'lookup' | 'builtin' | 'wql' | 'expr';
|
|
4526
|
-
expression?: string;
|
|
4527
|
-
ast?: ExprNode;
|
|
4528
|
-
/**
|
|
4529
|
-
* Declared node unit. Named zero-vector casts (AU, pts, MET-min, ratio)
|
|
4530
|
-
* override the computed vector (§5.3 applied to intermediate nodes —
|
|
4531
|
-
* required by TIS-shaped formulas that fold time into a score); any other
|
|
4532
|
-
* unit must match the computed vector.
|
|
4533
|
-
*/
|
|
4534
|
-
unit?: string;
|
|
4535
|
-
}
|
|
4536
|
-
interface CalcVariant {
|
|
4537
|
-
id: string;
|
|
4538
|
-
priority: number;
|
|
4539
|
-
when?: string;
|
|
4540
|
-
whenAst?: ExprNode;
|
|
4541
|
-
origin: CalcOrigin;
|
|
4542
|
-
nodes: Record<string, CalcNode>;
|
|
4543
|
-
/** Node dimensions computed at registration (static check output). */
|
|
4544
|
-
nodeDims?: Record<string, DimVector>;
|
|
4545
|
-
}
|
|
4546
|
-
interface CalculationDefinition$1 {
|
|
4547
|
-
id: string;
|
|
4548
|
-
kind: 'output' | 'library';
|
|
4549
|
-
scope: CalcScope;
|
|
4550
|
-
fences?: string[];
|
|
4551
|
-
when?: string;
|
|
4552
|
-
whenAst?: ExprNode;
|
|
4553
|
-
variants: CalcVariant[];
|
|
4554
|
-
output?: {
|
|
4555
|
-
nodeId: string | string[];
|
|
4556
|
-
key?: string;
|
|
4557
|
-
emitType?: string;
|
|
4558
|
-
unit?: string;
|
|
4559
|
-
isGrouped?: boolean;
|
|
4560
|
-
/** Group dimensions for grouped emission (e.g. ['effort']). */
|
|
4561
|
-
groupBy?: string[];
|
|
4562
|
-
publishMetadataNodes?: string[];
|
|
4563
|
-
/** Display label for published facts (store-scope rollups). */
|
|
4564
|
-
label?: string;
|
|
4565
|
-
};
|
|
4566
|
-
}
|
|
4567
|
-
|
|
4568
4433
|
/**
|
|
4569
4434
|
* Context used to select processors for a given workout.
|
|
4570
4435
|
*/
|
|
@@ -4590,6 +4455,16 @@ interface AnalyticsProfileContext {
|
|
|
4590
4455
|
* they override same-id built-ins and evaluate at high priority.
|
|
4591
4456
|
*/
|
|
4592
4457
|
calcs?: CalculationDefinition$1[];
|
|
4458
|
+
/**
|
|
4459
|
+
* The tag catalogue — the tags a script can reference and the functions
|
|
4460
|
+
* they carry. A function a tag carries runs where that tag applies.
|
|
4461
|
+
*/
|
|
4462
|
+
tags?: TagIndex;
|
|
4463
|
+
/**
|
|
4464
|
+
* Tags active for the whole run, whatever the segments say — the bundle a
|
|
4465
|
+
* profile applies.
|
|
4466
|
+
*/
|
|
4467
|
+
activeTags?: readonly string[];
|
|
4593
4468
|
}
|
|
4594
4469
|
/**
|
|
4595
4470
|
* Profile that assembles the realtime and summary processor lists
|
|
@@ -4759,6 +4634,13 @@ interface CreateAnalyticsEngineOptions {
|
|
|
4759
4634
|
};
|
|
4760
4635
|
/** User-authored composed calcs (#880), registered after the built-ins. */
|
|
4761
4636
|
calcs?: CalculationDefinition$1[];
|
|
4637
|
+
/**
|
|
4638
|
+
* The tag catalogue — the tags a script can reference and the functions
|
|
4639
|
+
* they carry.
|
|
4640
|
+
*/
|
|
4641
|
+
tags?: TagIndex;
|
|
4642
|
+
/** Tags active for the whole run, whatever the segments say. */
|
|
4643
|
+
activeTags?: readonly string[];
|
|
4762
4644
|
}
|
|
4763
4645
|
/**
|
|
4764
4646
|
* Creates a fully-configured AnalyticsEngine for a workout block.
|
|
@@ -5261,6 +5143,14 @@ interface CalcEngineDeps {
|
|
|
5261
5143
|
dialect: string;
|
|
5262
5144
|
lookups: LookupRegistry;
|
|
5263
5145
|
userProfile?: IProfileSource;
|
|
5146
|
+
/**
|
|
5147
|
+
* The tag catalogue. A function a tag carries runs where that tag applies —
|
|
5148
|
+
* on the segments the tag marked, and at the end of the workout when the
|
|
5149
|
+
* tag was applied anywhere in it.
|
|
5150
|
+
*/
|
|
5151
|
+
tags?: TagIndex;
|
|
5152
|
+
/** Tags active for the whole run, whatever the segments say. */
|
|
5153
|
+
activeTags?: readonly string[];
|
|
5264
5154
|
}
|
|
5265
5155
|
declare class CalcEngine implements IRealtimeProcessor, ISummaryProcessor {
|
|
5266
5156
|
private readonly registry;
|
|
@@ -5275,7 +5165,32 @@ declare class CalcEngine implements IRealtimeProcessor, ISummaryProcessor {
|
|
|
5275
5165
|
* calls (segments arrive in stream order, live and in replay).
|
|
5276
5166
|
*/
|
|
5277
5167
|
private lastSegmentEffort?;
|
|
5168
|
+
/**
|
|
5169
|
+
* The tags that carry each function: function name → the tags that carry
|
|
5170
|
+
* it. A function no tag carries runs everywhere, as it always did.
|
|
5171
|
+
*/
|
|
5172
|
+
private readonly tagCarriedFunctions;
|
|
5173
|
+
/** The tags applied anywhere in the run so far. */
|
|
5174
|
+
private readonly activatedTags;
|
|
5175
|
+
/** The tags the run activates — a note-level bundle of attachments. */
|
|
5176
|
+
private readonly runTags;
|
|
5278
5177
|
constructor(registry: CalculationRegistry, deps: CalcEngineDeps);
|
|
5178
|
+
/**
|
|
5179
|
+
* Whether a calculation runs here.
|
|
5180
|
+
*
|
|
5181
|
+
* A function a tag carries runs only where one of the tags that carry it
|
|
5182
|
+
* applies; every other function runs as it always did.
|
|
5183
|
+
*/
|
|
5184
|
+
private isActive;
|
|
5185
|
+
/**
|
|
5186
|
+
* The tags applied to a segment: the tags its statement marked, plus the
|
|
5187
|
+
* tags the run activates — a note-level tag applies to every segment of
|
|
5188
|
+
* the note it belongs to.
|
|
5189
|
+
*
|
|
5190
|
+
* The applied tags are recorded, so a workout-scope function the tag
|
|
5191
|
+
* carries runs at the end of the workout.
|
|
5192
|
+
*/
|
|
5193
|
+
private appliedTags;
|
|
5279
5194
|
process(output: IOutputStatement): IOutputStatement;
|
|
5280
5195
|
private appendAnnotation;
|
|
5281
5196
|
/** A frozen prediction of this type already rides the segment (replay). */
|
|
@@ -5327,6 +5242,12 @@ interface CalcStackOptions {
|
|
|
5327
5242
|
userProfile?: IProfileSource;
|
|
5328
5243
|
/** Extra/override calcs (dialect, user) registered after the built-ins. */
|
|
5329
5244
|
calcs?: CalculationDefinition$1[];
|
|
5245
|
+
/**
|
|
5246
|
+
* The tag catalogue. A function a tag carries runs where that tag applies.
|
|
5247
|
+
*/
|
|
5248
|
+
tags?: TagIndex;
|
|
5249
|
+
/** Tags active for the whole run, whatever the segments say. */
|
|
5250
|
+
activeTags?: readonly string[];
|
|
5330
5251
|
}
|
|
5331
5252
|
interface CalcStack {
|
|
5332
5253
|
lookups: LookupRegistry;
|
|
@@ -5474,4 +5395,4 @@ declare function diffStatement(expected: MetricLine[], actual: readonly IMetric[
|
|
|
5474
5395
|
*/
|
|
5475
5396
|
declare function compareStatement(expectations: MetricLine[], actual: readonly IMetric[], mode: MatchMode): string[];
|
|
5476
5397
|
|
|
5477
|
-
export { ABSENT, AGGREGATE_BUILTINS, AUTHORITATIVE_CASTS, AbortSessionAction, type ActionDescriptor, type ActionPrimitive, AmrapLogicStrategy, AnalyticsContext, AnalyticsEngine, type AnalyticsProfileContext, type AnalyticsResult, AnalyticsTransformer, BUILTIN_CALCS, BUNDLED_EFFORT_COUNT, BehaviorContext, BehaviorEventListener, BehaviorEventType,
|
|
5398
|
+
export { ABSENT, AGGREGATE_BUILTINS, AUTHORITATIVE_CASTS, AbortSessionAction, type ActionDescriptor, type ActionPrimitive, AmrapLogicStrategy, AnalyticsContext, AnalyticsEngine, type AnalyticsProfileContext, type AnalyticsResult, AnalyticsTransformer, BUILTIN_CALCS, BUNDLED_EFFORT_COUNT, BehaviorContext, BehaviorEventListener, BehaviorEventType, BlockBuilder, BlockContext, BlockLifecycleOptions, ButtonBehavior, ButtonConfig, CONSUMED_HINTS, CONSUMED_HINT_KEYS, CONTEXT_ATOMS, type CalcAnalysis, CalculationDefinition$1 as CalcDefinition, type CalcDiagnostic, CalcEngine, type CalcEngineDeps, CalcEvalError, CalcLine, CalcParseError, CalcRegistrationError, CalcScope, type CalcStack, type CalcStackOptions, type UnitDef as CalcUnitDef, CalcUnitError, type CalculationDefinition as CalculateBlockDefinition, type CalculateBlockParseError, type CalculateBlockParseResult, CalculateBlockProcessor, CalculationDefinition$1 as CalculationDefinition, CalculationRegistry, CardioDialect, ChildSelectionBehavior, type ChildSelectionConfig, type ChildSelectionLoopCondition, ChildrenStrategy, ChoiceGroupMetric, ClearChildrenAction, ClimbDialect, type ClimbGradeMetricValue, type ClimbGradeSystem, ClimbMetricType, CompileAndPushBlockAction, type CompiledLineForm, CompletionDecision, CompletionTimestampBehavior, CompositeEffortRegistry, type CompositeEffortRegistryOptions, type ControlsConfig, type CountdownMode, CountdownTimerBehavior, type CountdownTimerConfig, CountupTimerBehavior, type CountupTimerConfig, type CreateAnalyticsEngineOptions, type CreateAnalyticsEngineResult, CrossFitDialect, DAY, DEFAULT_UNRESOLVED_EFFORT_MET, type DayRollup, DialectStack, DimVector, type Dimension, type DurationPrimitive, EFFORT_DATA_METRIC_TYPE, EffortBlock, type EffortBlockConfig, EffortFallbackStrategy, type EffortPrimitive, EffortRegistrySource, EffortResolutionOptions, EffortResolver, EffortResolverOptions, EffortStorageAdapter, EmitEventAction, EmitSystemOutputAction, type EquipmentParseResult, ErrorAction, type EvalContext, EventBus, EventCallback, EventHandlerOptions, type EventHandlerRegistration, ExecutionContext, type ExecutionSnapshot, type ExecutionStatus, ExitBehavior, type ExitConfig, ExprNode, FixtureSyntaxError, type FuzzyCandidate, GenericGroupStrategy, GenericLoopStrategy, GenericTimerStrategy, HabitsDialect, type HeadingPrimitive, IAnalyticsEngine, type IAnalyticsProfile, IAnchorValue, IBehaviorContext, IBlockContext, type ICastSubscription, IEffort, IEffortRegistry, IEffortResolver, IEquipment, IEvent, IEventBus, IEventHandler, IJitCompiler, type ILookupTable, IMemoryLocation, IMemoryReference, type IMetricPresentationPolicy, INowProvider, type IProfileSource, IRealtimeProcessor, IRuntimeAction, IRuntimeActionable, IRuntimeBehavior, IRuntimeBlock, type IRuntimeBlockStrategy, IRuntimeClock, type IRuntimeEventProvider, type IRuntimeFactory, IRuntimeMemory, IRuntimeStack, type IRuntimeSubscription, IScriptRuntime, ISummaryProcessor, InMemoryEffortRegistry, IntervalLogicStrategy, JitCompiler, LabelingBehavior, type LabelingConfig, type LapPrimitive, type LineFormScope, type LineLocator, type LiteralKind, LocalEventProvider, LocalRuntimeSubscription, type LogLevel, type LoggableOutput, type LookupFieldDef, type LookupLayer, LookupRegistry, MAX_TAG_CONTRIBUTION_DEPTH, type MatchMode, MdTimerRuntime, type MemoryEntry, MemoryTag, MemoryTypeEnum, type MetricLine, type MetricObjectPrimitive, type MetricPresentationSurface, type MetricPresentationToken, MetricPromotionBehavior, type MetricPromotionConfig, type MetricRenderKind, type MetricTone, MetricVisibility, type MockClock, NextAction, NextEvent, NextEventHandler, OutputEmitter, OutputListener, PRODUCTION_STRATEGIES, type ParseOptions, type ParseReferences, type ParseResult, type ParserConfig, PopBlockAction, ProjectionResult, type PromotionRule, type PropertyPrimitive, PushBlockAction, PushRestBlockAction, type QuantityPrimitive, REST_EXCLUSION, RPE_LABELS, RUNTIME_LOG_SUBJECT_WIDTH, ReferenceIndex, ReferenceResolutionDefaults, RegisterEventHandlerAction, Registry, ReportOutputBehavior, type ReportOutputConfig, ReportOutputStrategy, ResolvedEffort, type ResolvedEffortData, type ResolvedTagContributions, RestBlock, type RestBlockConfig, type RoundSchemePrimitive, RoundsMetric, type RoundsPrimitive, RuntimeAdapter, RuntimeBlock, type RuntimeBlockOptions, RuntimeBuilder, type RuntimeButton, RuntimeClock, type RuntimeController, type RuntimeControls, RuntimeError, RuntimeFactory, type RuntimeLogEntry, RuntimeLogger, RuntimeMemory, type RuntimeMemoryLocation, RuntimeObservers, RuntimeStack, RuntimeStackOptions, SOUND_PLAY_EVENT, SOUND_PROFILE_METRIC, STANDARD_UNITS, STORE_CALCS, STREAM_ATOMS, ScriptRuntime, type SegmentWithMetadata, SessionRootBlock, type SessionRootConfig, SessionRootStrategy, SnapshotClock, SoundProfile, SoundProfileBehavior, type SoundProfileBehaviorConfig, SoundStrategy, type SourceInput, type SpanList, SpanTrackingBehavior, StackListener, StackObserver, StackSnapshot, StandardAnalyticsProfile, StartSessionAction, type StartSessionOptions, StartWorkoutAction, type StartWorkoutOptions, type StatementMetricDiff, type StaticEnv, type StreamAtomDef, SubscribeOptions, SubscriptionManager, type SyntaxFacts, type SyntaxMeta, type SyntaxPrimitive, type SyntaxStatement, TAG_MARKER_PREFIX, type TagRefPrimitive, TestableBlockConfig, type TextPrimitive, ThrowError, ThrowErrorAction, TimeSpan, TimerState, TwoPassEffortResolutionProcess, TypedMemoryReference, UNITS, type UnitDef$1 as UnitDef, type UnitMatch, UnitRegistry, UnitSet, UnitsDialect, UnregisterEventHandlerAction, Unsubscribe, UpdateNextPreviewAction, type Val, WaitingToStartBlock, WaitingToStartInjectorBehavior, WhiteboardScript, WodDialect, YogaDialect, addAliasToEffort, buildStaticLookups, buildTooltip, bundledEfforts, calculateElapsed, canonicalizeType, checkCalcLine, classifyStatements, closeCurrentSpan, collapseUnresolvedChoices, commonFixtureSet, compareStatement, compileLineForm, composeDivUnit, composeMulUnit, computeColumnLabel, computeLabel, computeWorkloadRollups, convertScalar, createAnalyticsEngineForBlock, createCalcEngine, createCalcStack, createCompiler, createDialectStack, createDisciplinesTable, createEffortTable, createLineLocator, createPolicy as createMetricPresentationPolicy, createMockClock, createParser, createProfileTable, createRpeLabelsTable, dailySessionLoads, dayBucket, dialectRegistry, dialectStack, diffStatement, documentToEffort, documentToEquipment, effortToDocument, equipmentToDocument, evaluate, evaluateCalculateDefinitions, extractEffortData, extractMetrics, extractStatements, extractStatementsRaw, extractSyntaxFacts, findBestFuzzyMatch, findTagContributionCycles, findUnresolvedChoices, fixtureBackSquat, fixtureBurpee, fixturePlank, fixtureRowing, fixtureRunning, fixtureUserCustom, fixtureUserOverride, formatDuration, formatRuntimeLogLine, formatRuntimeLogRule, formatRuntimeTimestamp, metricsToLabel as fragmentsToLabel, fullFixtureSet, fuseUnits, fuseUnitsInMetrics, getAnalyticsFromLogs, getAnalyticsFromRuntime, getHints, getUnit, hasHint, hintMetric, hintsToContainer, inferDim, isCastSubscription, isChoiceResolved, isTimeLikeMetric, isWithinThreshold, levenshteinDistance, metricPresentation, mutateTimerSpans, normalizeForFuzzy, num, openSpan, outputNodeId, outputNodeIds, padRuntimeLogEvent, padRuntimeLogSubject, parseCalcLine, parseCalculateBlock, parseEffortFile, parseEquipmentFile, parseExpression, parseMetricLine, parseScript, printCalculation, readNestedSection, readTimer, realtimeProcessorRegistry, renderMetric, resolveDominantOrigin, resolveSoundProfile, resolveTagContributions, startSpan, str, strategyRegistry, summaryProcessorRegistry, tagContributionMetrics, tagMarkerSlug, tagMarkerSlugs, tagMarkerType, toStoredOutputStatement, truthy, validateOutputUnit, parser as whiteboardParser, whiteboardScript, whiteboardScriptLanguage, writeChoiceSelection };
|