@bitcobblers/wod-wiki-lang 0.51.2196 → 0.53.2203

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,4 +1,4 @@
1
- import { IMetric, MetricContainer, MetricOrigin, MetricType, IDialect, ICodeStatement, DialectAnalysis, TagIndex, ParsedCodeStatement, TagTypeRecord, Tag, TagMetricContribution, IOutputStatement, OutputStatementType, BlockKey, TagReferenceMetadata, ScriptBlock, FenceDialect, Segment, AnalyticsGroup, StoredOutputStatement, OutputStatement } from '@bitcobblers/wod-wiki-core';
1
+ import { IMetric, MetricContainer, MetricOrigin, MetricType, IDialect, ICodeStatement, DialectAnalysis, TagIndex, ParsedCodeStatement, TagTypeRecord, Tag, TagMetricContribution, IOutputStatement, OutputStatementType, BlockKey, TagReferenceMetadata, ScriptBlock, FenceDialect, Segment, AnalyticsGroup, StoredOutputStatement, OutputStatement, TimeSpan as TimeSpan$1 } from '@bitcobblers/wod-wiki-core';
2
2
  export { ParseError } from '@bitcobblers/wod-wiki-core';
3
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 IEquipmentRegistry, i as EquipmentStorageAdapter, j as EffortStorageAdapter, k as IRuntimeActionable, l as IEventBus, m as IRuntimeStack, n as IRuntimeClock, o as IJitCompiler, p as INowProvider, q as RuntimeStackOptions, r as RuntimeError, A as AnalyticsContext, s as IEvent, t as IRuntimeAction, O as OutputListener, U as Unsubscribe, u as IAnalyticsEngine, v as IRuntimeBlock, w as IBehaviorContext, B as BehaviorEventType, x as BehaviorEventListener, S as SubscribeOptions, y as Unsubscribe$1, z as OutputOptions, M as MemoryTag, C as IMemoryLocation, D as IRuntimeBehavior, F as IBlockContext, G as MetricVisibility, H as BlockLifecycleOptions, J as CompletionDecision, T as TimeSpan, K as IRuntimeMemory, L as TypedMemoryReference, N as MemorySearchCriteria, P as IMemoryReference, Q as RuntimeStackLogger, V as StackObserver, X as StackSnapshot, Y as StackListener, Z as MemoryTypeEnum, _ as IAnchorValue, $ as SoundProfile, a0 as ButtonConfig, a1 as IEventHandler, a2 as HandlerScope, a3 as IScriptRuntime, a4 as TestableBlockConfig, a5 as IRuntimeOptions, a6 as ScriptRuntime, a7 as EventHandlerOptions, a8 as EventCallback, a9 as TimerState, aa as CalculationDefinition, ab as PropertyRuleInput, ac as IRealtimeProcessor, ad as ISummaryProcessor, ae as DimVector, af as CalcLine, ag as ExprNode, ah as CalcScope, ai as ILookupTable, aj as LookupRegistry, ak as CalcRegistrationDiagnostic, al as ProjectionResult } from './browserRuntimeNow-JnK2JvJg.cjs';
4
4
  export { am as ABSENT, an as BinaryOp, ao as ButtonVariant, ap as ButtonsState, aq as CalcEvalError, ar as CalcNode, as as CalcOrigin, at as CalcVariant, au as ChildrenStatusState, av as CompiledPropertySummaries, aw as CompletionState, ax as DEFAULT_RESOLVER_OPTIONS, ay as DEFAULT_RUNTIME_OPTIONS, az as DEFAULT_SOUND_PROFILE, aA as DIM_COUNT, aB as DIM_ENERGY, aC as DIM_LENGTH, aD as DIM_MASS, aE as DIM_TIME, aF as DIM_ZERO, aG as DISCIPLINE_FACTORS, aH as DisplayState, aI as EFFORT_DISCIPLINES, aJ as EFFORT_REGISTRY_ORIGINS, aK as EffortBaseAttributes, aL as EffortDerivation, aM as EffortDiscipline, aN as EffortMaterializer, aO as EffortResolvedFrom, aP as EvalContext, aQ as FenceDialect, aR as FragmentDisplayState, aS as FragmentState, aT as IAnalyticsProcessorDescriptor, aU as INTENSITY_TIERS, aV as IScript, aW as IntensityTier, aX as InterceptMode, aY as LookupFieldDef, aZ as LookupLayer, a_ as MemoryLocation, a$ as MemoryType, b0 as MemoryTypeMap, b1 as MemoryValueOf, b2 as NAMED_COMPOUNDS, b3 as PropertySourceLayer, b4 as ReferenceCatalog, b5 as ResolvedReferences, b6 as RoundState, b7 as RuntimeState, b8 as SEED_PRECEDENCE_RANK, b9 as ScriptRuntimeDependencies, ba as SeedPrecedenceTier, bb as ShakeOutQueueOptions, bc as ShakeOutResult, bd as SkippedDependencyDiagnostic, be as SoundRule, bf as SoundTriggerAnchor, bg as SoundTriggerPoint, bh as StackEvent, bi as StackedDashboardWidgetDescriptor, bj as TimerDirection, bk as VISIBILITY_ICONS, bl as VISIBILITY_LABELS, bm as Val, bn as addDim, bo as compilePropertySummaryCalcs, bp as compilePropertySummaryCalcsWithDiagnostics, bq as compoundName, br as createBrowserRuntimeNow, bs as createReferenceIndex, bt as dedupeEntitiesByPrecedence, bu as dimEquals, bv as disciplineFactorFor, bw as evaluate, bx as extractPropertyRulesFromMeta, by as extractStatementRefs, bz as extractTagPropertyRules, bA as filterTagsByVisibility, bB as formatDim, bC as formatSoundTrigger, bD as frozenNow, bE as getMetricVisibility, bF as getRuntimeNowMs, bG as isDimensionless, bH as isEffortDiscipline, bI as isFragmentTag, bJ as num, bK as parseSoundTrigger, bL as resolveEntityRank, bM as resolveEntityTier, bN as resolveProfileRules, bO as resolvePropertyDashboardWidgets, bP as resolveSourceRank, bQ as resolveSourceTier, bR as runMetricShakeOutQueue, bS as slugifyRefLabel, bT as str, bU as subDim, bV as truthy, bW as wallClockNow } from './browserRuntimeNow-JnK2JvJg.cjs';
@@ -5317,6 +5317,87 @@ declare function computeWorkloadRollups(loads: ReadonlyMap<number, number>, thro
5317
5317
  */
5318
5318
  declare function toStoredOutputStatement(output: IOutputStatement | OutputStatement): StoredOutputStatement;
5319
5319
 
5320
+ /**
5321
+ * Canonical time formatting utilities
5322
+ * Consolidates 15+ inline formatter implementations across the codebase
5323
+ *
5324
+ * All formatters handle edge cases: null, undefined, negative numbers, non-finite values
5325
+ */
5326
+ /**
5327
+ * Formats milliseconds to MM:SS format
5328
+ * e.g., 65432 → "01:05" (~65 seconds)
5329
+ */
5330
+ declare const formatTimeMMSS: (ms: number) => string;
5331
+ /**
5332
+ * Formats milliseconds to HH:MM:SS format
5333
+ * e.g., 3665432 → "01:01:05" (~1 hour, 1 minute, 5 seconds)
5334
+ */
5335
+ declare const formatTimeHHMMSS: (ms: number) => string;
5336
+ /**
5337
+ * Formats milliseconds to MM:SS.ms format (with centisecond precision)
5338
+ * e.g., 65432 → "01:05.43" (~65.4 seconds)
5339
+ */
5340
+ declare const formatTimePrecise: (ms: number) => string;
5341
+ /**
5342
+ * Formats seconds to MM:SS format
5343
+ * NOTE: Input is SECONDS, not milliseconds (unlike the ms variants above)
5344
+ * e.g., 65 → "01:05"
5345
+ *
5346
+ * Use this ONLY for callers that have seconds-based time values
5347
+ */
5348
+ declare const formatSecondsMMSS: (seconds: number) => string;
5349
+ /**
5350
+ * Formats seconds to HH:MM:SS format
5351
+ * NOTE: Input is SECONDS, not milliseconds
5352
+ * e.g., 3665 → "01:01:05"
5353
+ */
5354
+ declare const formatSecondsHHMMSS: (seconds: number) => string;
5355
+ /**
5356
+ * Smart duration formatter: chooses MM:SS or HH:MM:SS based on total duration
5357
+ * If duration >= 1 hour: returns HH:MM:SS, else MM:SS
5358
+ * Input: milliseconds
5359
+ */
5360
+ declare const formatDurationSmart: (ms: number) => string;
5361
+ /**
5362
+ * Compact duration format: M:SS.m or MM:SS depending on magnitude
5363
+ * e.g., 5432 → "5:43", 65432 → "01:05"
5364
+ * Input: milliseconds
5365
+ *
5366
+ * Use this only for space-constrained UIs
5367
+ */
5368
+ declare const formatDurationCompact: (ms: number) => string;
5369
+ /**
5370
+ * Formats a timestamp (Date or number) into HH:MM:SS format
5371
+ * e.g., new Date('2024-01-01T12:34:56Z') → "12:34:56"
5372
+ * Returns 'running' if date is undefined.
5373
+ */
5374
+ declare const formatTimestamp: (date?: Date | number) => string;
5375
+
5376
+ /**
5377
+ * Format milliseconds to MM:SS.ms display
5378
+ * e.g., 65432 -> "01:05.43"
5379
+ */
5380
+ declare const formatTime: (ms: number) => string;
5381
+ /**
5382
+ * Calculates **Elapsed** (sum of span durations) from an array of time spans.
5383
+ *
5384
+ * Equivalent to `calculateElapsed()` in `src/runtime/time/calculateElapsed.ts`.
5385
+ * Prefer the runtime version for new code; this exists for component-layer compat.
5386
+ *
5387
+ * @see docs/architecture/time-terminology.md
5388
+ */
5389
+ declare const calculateDuration: (spans: ReadonlyArray<TimeSpan$1 | {
5390
+ started: number;
5391
+ ended?: number;
5392
+ } | {
5393
+ start: number | Date;
5394
+ stop?: number | Date;
5395
+ }>, now: number) => number;
5396
+ /**
5397
+ * Rounds a duration in seconds to the nearest 0.1s.
5398
+ */
5399
+ declare const roundToTenth: (seconds: number) => number;
5400
+
5320
5401
  /**
5321
5402
  * Metric-line DSL parser for parser fixture files (spec: wayfinder
5322
5403
  * test-validation-harness asset 001).
@@ -5396,4 +5477,4 @@ declare function diffStatement(expected: MetricLine[], actual: readonly IMetric[
5396
5477
  */
5397
5478
  declare function compareStatement(expectations: MetricLine[], actual: readonly IMetric[], mode: MatchMode): string[];
5398
5479
 
5399
- export { 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, COMPLETION_PROPERTY_KEYS, CONSUMED_HINTS, CONSUMED_HINT_KEYS, CONTEXT_ATOMS, type CalcAnalysis, CalculationDefinition as CalcDefinition, type CalcDiagnostic, CalcEngine, type CalcEngineDeps, CalcLine, CalcParseError, CalcRegistrationError, CalcScope, type CalcStack, type CalcStackOptions, type UnitDef as CalcUnitDef, CalcUnitError, CalculationDefinition, CalculationRegistry, CardioDialect, ChildSelectionBehavior, type ChildSelectionConfig, type ChildSelectionLoopCondition, ChildrenStrategy, ChoiceGroupMetric, ClearChildrenAction, ClimbDialect, type ClimbGradeMetricValue, type ClimbGradeSystem, ClimbMetricType, CompileAndPushBlockAction, type CompiledLineForm, CompletionDecision, CompletionTimestampBehavior, type CompletionValueOption, type CompletionValueSource, CompositeEffortRegistry, type CompositeEffortRegistryOptions, CompositeEquipmentRegistry, CompositePropertyRegistry, 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, EquipmentStorageAdapter, ErrorAction, 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, IEquipmentRegistry, IEvent, IEventBus, IEventHandler, IJitCompiler, 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, 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, PROPERTY_KEY_TO_METRIC_TYPE, type ParseOptions, type ParseReferences, type ParseResult, type ParserConfig, PopBlockAction, ProjectionResult, type PromotionRule, type PropertyEntity, type PropertyPrimitive, PropertyRuleInput, type PropertyStorageAdapter, PushBlockAction, PushRestBlockAction, type QuantityPrimitive, REFERENCE_PAIR_KEYS, 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, STRUCTURAL_EFFORT_WORDS, 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 TagCategoryPropertyDocument, type TagParseResult, type TagPropertyDocument, 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, WaitingToStartBlock, WaitingToStartInjectorBehavior, WhiteboardScript, type WhiteboardScriptCompletionOptions, type WhiteboardScriptSnippet, WodDialect, YogaDialect, addAliasToEffort, applyTemplateDefaults, 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, documentToTag, effortToDocument, equipmentToDocument, 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, openSpan, outputNodeId, outputNodeIds, padRuntimeLogEvent, padRuntimeLogSubject, parseCalcLine, parseEffortFile, parseEquipmentFile, parseExpression, parseMetricLine, parseScript, printCalculation, readNestedSection, readTimer, realtimeProcessorRegistry, renderMetric, resolveDominantOrigin, resolveFusedEffortReferences, resolveSoundProfile, resolveTagContributions, snippetCompletions, startSpan, strategyRegistry, summaryProcessorRegistry, tagCategoryRecordToDocument, tagCategoryToDocument, tagContributionMetrics, tagMarkerSlug, tagMarkerSlugs, tagMarkerType, tagRecordToDocument, tagToDocument, toStoredOutputStatement, validateOutputUnit, parser as whiteboardParser, whiteboardScript, whiteboardScriptCompletion, whiteboardScriptCompletionSource, whiteboardScriptLanguage, whiteboardScriptSnippets, writeChoiceSelection };
5480
+ export { 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, COMPLETION_PROPERTY_KEYS, CONSUMED_HINTS, CONSUMED_HINT_KEYS, CONTEXT_ATOMS, type CalcAnalysis, CalculationDefinition as CalcDefinition, type CalcDiagnostic, CalcEngine, type CalcEngineDeps, CalcLine, CalcParseError, CalcRegistrationError, CalcScope, type CalcStack, type CalcStackOptions, type UnitDef as CalcUnitDef, CalcUnitError, CalculationDefinition, CalculationRegistry, CardioDialect, ChildSelectionBehavior, type ChildSelectionConfig, type ChildSelectionLoopCondition, ChildrenStrategy, ChoiceGroupMetric, ClearChildrenAction, ClimbDialect, type ClimbGradeMetricValue, type ClimbGradeSystem, ClimbMetricType, CompileAndPushBlockAction, type CompiledLineForm, CompletionDecision, CompletionTimestampBehavior, type CompletionValueOption, type CompletionValueSource, CompositeEffortRegistry, type CompositeEffortRegistryOptions, CompositeEquipmentRegistry, CompositePropertyRegistry, 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, EquipmentStorageAdapter, ErrorAction, 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, IEquipmentRegistry, IEvent, IEventBus, IEventHandler, IJitCompiler, 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, 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, PROPERTY_KEY_TO_METRIC_TYPE, type ParseOptions, type ParseReferences, type ParseResult, type ParserConfig, PopBlockAction, ProjectionResult, type PromotionRule, type PropertyEntity, type PropertyPrimitive, PropertyRuleInput, type PropertyStorageAdapter, PushBlockAction, PushRestBlockAction, type QuantityPrimitive, REFERENCE_PAIR_KEYS, 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, STRUCTURAL_EFFORT_WORDS, 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 TagCategoryPropertyDocument, type TagParseResult, type TagPropertyDocument, 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, WaitingToStartBlock, WaitingToStartInjectorBehavior, WhiteboardScript, type WhiteboardScriptCompletionOptions, type WhiteboardScriptSnippet, WodDialect, YogaDialect, addAliasToEffort, applyTemplateDefaults, buildStaticLookups, buildTooltip, bundledEfforts, calculateDuration, 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, documentToTag, effortToDocument, equipmentToDocument, extractEffortData, extractMetrics, extractStatements, extractStatementsRaw, extractSyntaxFacts, findBestFuzzyMatch, findTagContributionCycles, findUnresolvedChoices, fixtureBackSquat, fixtureBurpee, fixturePlank, fixtureRowing, fixtureRunning, fixtureUserCustom, fixtureUserOverride, formatDuration, formatDurationCompact, formatDurationSmart, formatRuntimeLogLine, formatRuntimeLogRule, formatRuntimeTimestamp, formatSecondsHHMMSS, formatSecondsMMSS, formatTime, formatTimeHHMMSS, formatTimeMMSS, formatTimePrecise, formatTimestamp, metricsToLabel as fragmentsToLabel, fullFixtureSet, fuseUnits, fuseUnitsInMetrics, getAnalyticsFromLogs, getAnalyticsFromRuntime, getHints, getUnit, hasHint, hintMetric, hintsToContainer, inferDim, isCastSubscription, isChoiceResolved, isTimeLikeMetric, isWithinThreshold, levenshteinDistance, metricPresentation, mutateTimerSpans, normalizeForFuzzy, openSpan, outputNodeId, outputNodeIds, padRuntimeLogEvent, padRuntimeLogSubject, parseCalcLine, parseEffortFile, parseEquipmentFile, parseExpression, parseMetricLine, parseScript, printCalculation, readNestedSection, readTimer, realtimeProcessorRegistry, renderMetric, resolveDominantOrigin, resolveFusedEffortReferences, resolveSoundProfile, resolveTagContributions, roundToTenth, snippetCompletions, startSpan, strategyRegistry, summaryProcessorRegistry, tagCategoryRecordToDocument, tagCategoryToDocument, tagContributionMetrics, tagMarkerSlug, tagMarkerSlugs, tagMarkerType, tagRecordToDocument, tagToDocument, toStoredOutputStatement, validateOutputUnit, parser as whiteboardParser, whiteboardScript, whiteboardScriptCompletion, whiteboardScriptCompletionSource, whiteboardScriptLanguage, whiteboardScriptSnippets, writeChoiceSelection };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IMetric, MetricContainer, MetricOrigin, MetricType, IDialect, ICodeStatement, DialectAnalysis, TagIndex, ParsedCodeStatement, TagTypeRecord, Tag, TagMetricContribution, IOutputStatement, OutputStatementType, BlockKey, TagReferenceMetadata, ScriptBlock, FenceDialect, Segment, AnalyticsGroup, StoredOutputStatement, OutputStatement } from '@bitcobblers/wod-wiki-core';
1
+ import { IMetric, MetricContainer, MetricOrigin, MetricType, IDialect, ICodeStatement, DialectAnalysis, TagIndex, ParsedCodeStatement, TagTypeRecord, Tag, TagMetricContribution, IOutputStatement, OutputStatementType, BlockKey, TagReferenceMetadata, ScriptBlock, FenceDialect, Segment, AnalyticsGroup, StoredOutputStatement, OutputStatement, TimeSpan as TimeSpan$1 } from '@bitcobblers/wod-wiki-core';
2
2
  export { ParseError } from '@bitcobblers/wod-wiki-core';
3
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 IEquipmentRegistry, i as EquipmentStorageAdapter, j as EffortStorageAdapter, k as IRuntimeActionable, l as IEventBus, m as IRuntimeStack, n as IRuntimeClock, o as IJitCompiler, p as INowProvider, q as RuntimeStackOptions, r as RuntimeError, A as AnalyticsContext, s as IEvent, t as IRuntimeAction, O as OutputListener, U as Unsubscribe, u as IAnalyticsEngine, v as IRuntimeBlock, w as IBehaviorContext, B as BehaviorEventType, x as BehaviorEventListener, S as SubscribeOptions, y as Unsubscribe$1, z as OutputOptions, M as MemoryTag, C as IMemoryLocation, D as IRuntimeBehavior, F as IBlockContext, G as MetricVisibility, H as BlockLifecycleOptions, J as CompletionDecision, T as TimeSpan, K as IRuntimeMemory, L as TypedMemoryReference, N as MemorySearchCriteria, P as IMemoryReference, Q as RuntimeStackLogger, V as StackObserver, X as StackSnapshot, Y as StackListener, Z as MemoryTypeEnum, _ as IAnchorValue, $ as SoundProfile, a0 as ButtonConfig, a1 as IEventHandler, a2 as HandlerScope, a3 as IScriptRuntime, a4 as TestableBlockConfig, a5 as IRuntimeOptions, a6 as ScriptRuntime, a7 as EventHandlerOptions, a8 as EventCallback, a9 as TimerState, aa as CalculationDefinition, ab as PropertyRuleInput, ac as IRealtimeProcessor, ad as ISummaryProcessor, ae as DimVector, af as CalcLine, ag as ExprNode, ah as CalcScope, ai as ILookupTable, aj as LookupRegistry, ak as CalcRegistrationDiagnostic, al as ProjectionResult } from './browserRuntimeNow-JnK2JvJg.js';
4
4
  export { am as ABSENT, an as BinaryOp, ao as ButtonVariant, ap as ButtonsState, aq as CalcEvalError, ar as CalcNode, as as CalcOrigin, at as CalcVariant, au as ChildrenStatusState, av as CompiledPropertySummaries, aw as CompletionState, ax as DEFAULT_RESOLVER_OPTIONS, ay as DEFAULT_RUNTIME_OPTIONS, az as DEFAULT_SOUND_PROFILE, aA as DIM_COUNT, aB as DIM_ENERGY, aC as DIM_LENGTH, aD as DIM_MASS, aE as DIM_TIME, aF as DIM_ZERO, aG as DISCIPLINE_FACTORS, aH as DisplayState, aI as EFFORT_DISCIPLINES, aJ as EFFORT_REGISTRY_ORIGINS, aK as EffortBaseAttributes, aL as EffortDerivation, aM as EffortDiscipline, aN as EffortMaterializer, aO as EffortResolvedFrom, aP as EvalContext, aQ as FenceDialect, aR as FragmentDisplayState, aS as FragmentState, aT as IAnalyticsProcessorDescriptor, aU as INTENSITY_TIERS, aV as IScript, aW as IntensityTier, aX as InterceptMode, aY as LookupFieldDef, aZ as LookupLayer, a_ as MemoryLocation, a$ as MemoryType, b0 as MemoryTypeMap, b1 as MemoryValueOf, b2 as NAMED_COMPOUNDS, b3 as PropertySourceLayer, b4 as ReferenceCatalog, b5 as ResolvedReferences, b6 as RoundState, b7 as RuntimeState, b8 as SEED_PRECEDENCE_RANK, b9 as ScriptRuntimeDependencies, ba as SeedPrecedenceTier, bb as ShakeOutQueueOptions, bc as ShakeOutResult, bd as SkippedDependencyDiagnostic, be as SoundRule, bf as SoundTriggerAnchor, bg as SoundTriggerPoint, bh as StackEvent, bi as StackedDashboardWidgetDescriptor, bj as TimerDirection, bk as VISIBILITY_ICONS, bl as VISIBILITY_LABELS, bm as Val, bn as addDim, bo as compilePropertySummaryCalcs, bp as compilePropertySummaryCalcsWithDiagnostics, bq as compoundName, br as createBrowserRuntimeNow, bs as createReferenceIndex, bt as dedupeEntitiesByPrecedence, bu as dimEquals, bv as disciplineFactorFor, bw as evaluate, bx as extractPropertyRulesFromMeta, by as extractStatementRefs, bz as extractTagPropertyRules, bA as filterTagsByVisibility, bB as formatDim, bC as formatSoundTrigger, bD as frozenNow, bE as getMetricVisibility, bF as getRuntimeNowMs, bG as isDimensionless, bH as isEffortDiscipline, bI as isFragmentTag, bJ as num, bK as parseSoundTrigger, bL as resolveEntityRank, bM as resolveEntityTier, bN as resolveProfileRules, bO as resolvePropertyDashboardWidgets, bP as resolveSourceRank, bQ as resolveSourceTier, bR as runMetricShakeOutQueue, bS as slugifyRefLabel, bT as str, bU as subDim, bV as truthy, bW as wallClockNow } from './browserRuntimeNow-JnK2JvJg.js';
@@ -5317,6 +5317,87 @@ declare function computeWorkloadRollups(loads: ReadonlyMap<number, number>, thro
5317
5317
  */
5318
5318
  declare function toStoredOutputStatement(output: IOutputStatement | OutputStatement): StoredOutputStatement;
5319
5319
 
5320
+ /**
5321
+ * Canonical time formatting utilities
5322
+ * Consolidates 15+ inline formatter implementations across the codebase
5323
+ *
5324
+ * All formatters handle edge cases: null, undefined, negative numbers, non-finite values
5325
+ */
5326
+ /**
5327
+ * Formats milliseconds to MM:SS format
5328
+ * e.g., 65432 → "01:05" (~65 seconds)
5329
+ */
5330
+ declare const formatTimeMMSS: (ms: number) => string;
5331
+ /**
5332
+ * Formats milliseconds to HH:MM:SS format
5333
+ * e.g., 3665432 → "01:01:05" (~1 hour, 1 minute, 5 seconds)
5334
+ */
5335
+ declare const formatTimeHHMMSS: (ms: number) => string;
5336
+ /**
5337
+ * Formats milliseconds to MM:SS.ms format (with centisecond precision)
5338
+ * e.g., 65432 → "01:05.43" (~65.4 seconds)
5339
+ */
5340
+ declare const formatTimePrecise: (ms: number) => string;
5341
+ /**
5342
+ * Formats seconds to MM:SS format
5343
+ * NOTE: Input is SECONDS, not milliseconds (unlike the ms variants above)
5344
+ * e.g., 65 → "01:05"
5345
+ *
5346
+ * Use this ONLY for callers that have seconds-based time values
5347
+ */
5348
+ declare const formatSecondsMMSS: (seconds: number) => string;
5349
+ /**
5350
+ * Formats seconds to HH:MM:SS format
5351
+ * NOTE: Input is SECONDS, not milliseconds
5352
+ * e.g., 3665 → "01:01:05"
5353
+ */
5354
+ declare const formatSecondsHHMMSS: (seconds: number) => string;
5355
+ /**
5356
+ * Smart duration formatter: chooses MM:SS or HH:MM:SS based on total duration
5357
+ * If duration >= 1 hour: returns HH:MM:SS, else MM:SS
5358
+ * Input: milliseconds
5359
+ */
5360
+ declare const formatDurationSmart: (ms: number) => string;
5361
+ /**
5362
+ * Compact duration format: M:SS.m or MM:SS depending on magnitude
5363
+ * e.g., 5432 → "5:43", 65432 → "01:05"
5364
+ * Input: milliseconds
5365
+ *
5366
+ * Use this only for space-constrained UIs
5367
+ */
5368
+ declare const formatDurationCompact: (ms: number) => string;
5369
+ /**
5370
+ * Formats a timestamp (Date or number) into HH:MM:SS format
5371
+ * e.g., new Date('2024-01-01T12:34:56Z') → "12:34:56"
5372
+ * Returns 'running' if date is undefined.
5373
+ */
5374
+ declare const formatTimestamp: (date?: Date | number) => string;
5375
+
5376
+ /**
5377
+ * Format milliseconds to MM:SS.ms display
5378
+ * e.g., 65432 -> "01:05.43"
5379
+ */
5380
+ declare const formatTime: (ms: number) => string;
5381
+ /**
5382
+ * Calculates **Elapsed** (sum of span durations) from an array of time spans.
5383
+ *
5384
+ * Equivalent to `calculateElapsed()` in `src/runtime/time/calculateElapsed.ts`.
5385
+ * Prefer the runtime version for new code; this exists for component-layer compat.
5386
+ *
5387
+ * @see docs/architecture/time-terminology.md
5388
+ */
5389
+ declare const calculateDuration: (spans: ReadonlyArray<TimeSpan$1 | {
5390
+ started: number;
5391
+ ended?: number;
5392
+ } | {
5393
+ start: number | Date;
5394
+ stop?: number | Date;
5395
+ }>, now: number) => number;
5396
+ /**
5397
+ * Rounds a duration in seconds to the nearest 0.1s.
5398
+ */
5399
+ declare const roundToTenth: (seconds: number) => number;
5400
+
5320
5401
  /**
5321
5402
  * Metric-line DSL parser for parser fixture files (spec: wayfinder
5322
5403
  * test-validation-harness asset 001).
@@ -5396,4 +5477,4 @@ declare function diffStatement(expected: MetricLine[], actual: readonly IMetric[
5396
5477
  */
5397
5478
  declare function compareStatement(expectations: MetricLine[], actual: readonly IMetric[], mode: MatchMode): string[];
5398
5479
 
5399
- export { 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, COMPLETION_PROPERTY_KEYS, CONSUMED_HINTS, CONSUMED_HINT_KEYS, CONTEXT_ATOMS, type CalcAnalysis, CalculationDefinition as CalcDefinition, type CalcDiagnostic, CalcEngine, type CalcEngineDeps, CalcLine, CalcParseError, CalcRegistrationError, CalcScope, type CalcStack, type CalcStackOptions, type UnitDef as CalcUnitDef, CalcUnitError, CalculationDefinition, CalculationRegistry, CardioDialect, ChildSelectionBehavior, type ChildSelectionConfig, type ChildSelectionLoopCondition, ChildrenStrategy, ChoiceGroupMetric, ClearChildrenAction, ClimbDialect, type ClimbGradeMetricValue, type ClimbGradeSystem, ClimbMetricType, CompileAndPushBlockAction, type CompiledLineForm, CompletionDecision, CompletionTimestampBehavior, type CompletionValueOption, type CompletionValueSource, CompositeEffortRegistry, type CompositeEffortRegistryOptions, CompositeEquipmentRegistry, CompositePropertyRegistry, 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, EquipmentStorageAdapter, ErrorAction, 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, IEquipmentRegistry, IEvent, IEventBus, IEventHandler, IJitCompiler, 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, 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, PROPERTY_KEY_TO_METRIC_TYPE, type ParseOptions, type ParseReferences, type ParseResult, type ParserConfig, PopBlockAction, ProjectionResult, type PromotionRule, type PropertyEntity, type PropertyPrimitive, PropertyRuleInput, type PropertyStorageAdapter, PushBlockAction, PushRestBlockAction, type QuantityPrimitive, REFERENCE_PAIR_KEYS, 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, STRUCTURAL_EFFORT_WORDS, 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 TagCategoryPropertyDocument, type TagParseResult, type TagPropertyDocument, 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, WaitingToStartBlock, WaitingToStartInjectorBehavior, WhiteboardScript, type WhiteboardScriptCompletionOptions, type WhiteboardScriptSnippet, WodDialect, YogaDialect, addAliasToEffort, applyTemplateDefaults, 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, documentToTag, effortToDocument, equipmentToDocument, 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, openSpan, outputNodeId, outputNodeIds, padRuntimeLogEvent, padRuntimeLogSubject, parseCalcLine, parseEffortFile, parseEquipmentFile, parseExpression, parseMetricLine, parseScript, printCalculation, readNestedSection, readTimer, realtimeProcessorRegistry, renderMetric, resolveDominantOrigin, resolveFusedEffortReferences, resolveSoundProfile, resolveTagContributions, snippetCompletions, startSpan, strategyRegistry, summaryProcessorRegistry, tagCategoryRecordToDocument, tagCategoryToDocument, tagContributionMetrics, tagMarkerSlug, tagMarkerSlugs, tagMarkerType, tagRecordToDocument, tagToDocument, toStoredOutputStatement, validateOutputUnit, parser as whiteboardParser, whiteboardScript, whiteboardScriptCompletion, whiteboardScriptCompletionSource, whiteboardScriptLanguage, whiteboardScriptSnippets, writeChoiceSelection };
5480
+ export { 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, COMPLETION_PROPERTY_KEYS, CONSUMED_HINTS, CONSUMED_HINT_KEYS, CONTEXT_ATOMS, type CalcAnalysis, CalculationDefinition as CalcDefinition, type CalcDiagnostic, CalcEngine, type CalcEngineDeps, CalcLine, CalcParseError, CalcRegistrationError, CalcScope, type CalcStack, type CalcStackOptions, type UnitDef as CalcUnitDef, CalcUnitError, CalculationDefinition, CalculationRegistry, CardioDialect, ChildSelectionBehavior, type ChildSelectionConfig, type ChildSelectionLoopCondition, ChildrenStrategy, ChoiceGroupMetric, ClearChildrenAction, ClimbDialect, type ClimbGradeMetricValue, type ClimbGradeSystem, ClimbMetricType, CompileAndPushBlockAction, type CompiledLineForm, CompletionDecision, CompletionTimestampBehavior, type CompletionValueOption, type CompletionValueSource, CompositeEffortRegistry, type CompositeEffortRegistryOptions, CompositeEquipmentRegistry, CompositePropertyRegistry, 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, EquipmentStorageAdapter, ErrorAction, 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, IEquipmentRegistry, IEvent, IEventBus, IEventHandler, IJitCompiler, 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, 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, PROPERTY_KEY_TO_METRIC_TYPE, type ParseOptions, type ParseReferences, type ParseResult, type ParserConfig, PopBlockAction, ProjectionResult, type PromotionRule, type PropertyEntity, type PropertyPrimitive, PropertyRuleInput, type PropertyStorageAdapter, PushBlockAction, PushRestBlockAction, type QuantityPrimitive, REFERENCE_PAIR_KEYS, 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, STRUCTURAL_EFFORT_WORDS, 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 TagCategoryPropertyDocument, type TagParseResult, type TagPropertyDocument, 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, WaitingToStartBlock, WaitingToStartInjectorBehavior, WhiteboardScript, type WhiteboardScriptCompletionOptions, type WhiteboardScriptSnippet, WodDialect, YogaDialect, addAliasToEffort, applyTemplateDefaults, buildStaticLookups, buildTooltip, bundledEfforts, calculateDuration, 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, documentToTag, effortToDocument, equipmentToDocument, extractEffortData, extractMetrics, extractStatements, extractStatementsRaw, extractSyntaxFacts, findBestFuzzyMatch, findTagContributionCycles, findUnresolvedChoices, fixtureBackSquat, fixtureBurpee, fixturePlank, fixtureRowing, fixtureRunning, fixtureUserCustom, fixtureUserOverride, formatDuration, formatDurationCompact, formatDurationSmart, formatRuntimeLogLine, formatRuntimeLogRule, formatRuntimeTimestamp, formatSecondsHHMMSS, formatSecondsMMSS, formatTime, formatTimeHHMMSS, formatTimeMMSS, formatTimePrecise, formatTimestamp, metricsToLabel as fragmentsToLabel, fullFixtureSet, fuseUnits, fuseUnitsInMetrics, getAnalyticsFromLogs, getAnalyticsFromRuntime, getHints, getUnit, hasHint, hintMetric, hintsToContainer, inferDim, isCastSubscription, isChoiceResolved, isTimeLikeMetric, isWithinThreshold, levenshteinDistance, metricPresentation, mutateTimerSpans, normalizeForFuzzy, openSpan, outputNodeId, outputNodeIds, padRuntimeLogEvent, padRuntimeLogSubject, parseCalcLine, parseEffortFile, parseEquipmentFile, parseExpression, parseMetricLine, parseScript, printCalculation, readNestedSection, readTimer, realtimeProcessorRegistry, renderMetric, resolveDominantOrigin, resolveFusedEffortReferences, resolveSoundProfile, resolveTagContributions, roundToTenth, snippetCompletions, startSpan, strategyRegistry, summaryProcessorRegistry, tagCategoryRecordToDocument, tagCategoryToDocument, tagContributionMetrics, tagMarkerSlug, tagMarkerSlugs, tagMarkerType, tagRecordToDocument, tagToDocument, toStoredOutputStatement, validateOutputUnit, parser as whiteboardParser, whiteboardScript, whiteboardScriptCompletion, whiteboardScriptCompletionSource, whiteboardScriptLanguage, whiteboardScriptSnippets, writeChoiceSelection };
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { wallClockNow, formatDurationSmart } from './chunk-PFQDVQQO.mjs';
2
- export { createBrowserRuntimeNow, frozenNow, getRuntimeNowMs, wallClockNow } from './chunk-PFQDVQQO.mjs';
1
+ import { wallClockNow, formatDurationSmart } from './chunk-27K5HAHU.mjs';
2
+ export { calculateDuration, createBrowserRuntimeNow, formatDurationCompact, formatDurationSmart, formatSecondsHHMMSS, formatSecondsMMSS, formatTime, formatTimeHHMMSS, formatTimeMMSS, formatTimePrecise, formatTimestamp, frozenNow, getRuntimeNowMs, roundToTenth, wallClockNow } from './chunk-27K5HAHU.mjs';
3
3
  import { MetricType, MetricContainer, BlockKey, REFERENCE_METADATA_KEY, ParsedCodeStatement, getReferenceMetadata, TAG_REFERENCE_METADATA_KEY, parseFrontmatter, getScalar, OutputStatement, valueKindOf, normalizeFieldPath, getTagReference } from '@bitcobblers/wod-wiki-core';
4
4
  import { LRParser } from '@lezer/lr';
5
5
  import { LRLanguage, LanguageSupport, syntaxTree } from '@codemirror/language';
package/dist/react.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { wallClockNow, formatDurationSmart, getRuntimeNowMs } from './chunk-PFQDVQQO.mjs';
2
- export { createBrowserRuntimeNow, getRuntimeNowMs, wallClockNow as runtimeNow } from './chunk-PFQDVQQO.mjs';
1
+ import { wallClockNow, calculateDuration, formatDurationSmart, getRuntimeNowMs } from './chunk-27K5HAHU.mjs';
2
+ export { createBrowserRuntimeNow, getRuntimeNowMs, wallClockNow as runtimeNow } from './chunk-27K5HAHU.mjs';
3
3
  import { createContext, useState, useRef, useCallback, useEffect, useMemo, useContext } from 'react';
4
4
  import { MetricContainer } from '@bitcobblers/wod-wiki-core';
5
5
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -154,23 +154,6 @@ var useRuntimeExecution = (runtime) => {
154
154
  step
155
155
  }), [status, elapsedTime, stepCount, startTime, start, pause, stop, reset, step]);
156
156
  };
157
-
158
- // src/utils/timeUtils.ts
159
- var calculateDuration = (spans, now) => {
160
- if (!spans || !Array.isArray(spans)) return 0;
161
- return spans.reduce((total, span) => {
162
- if ("started" in span) {
163
- const start2 = span.started;
164
- const end = span.ended ?? now;
165
- return total + Math.max(0, end - start2);
166
- }
167
- const start = span.start instanceof Date ? span.start.getTime() : span.start || 0;
168
- const stop = span.stop ? span.stop instanceof Date ? span.stop.getTime() : span.stop : now;
169
- return total + Math.max(0, stop - start);
170
- }, 0);
171
- };
172
-
173
- // src/react/hooks/useBlockMemory.ts
174
157
  function useBlockMemory(block, type) {
175
158
  const tag = type;
176
159
  const getVal = () => {