@bitcobblers/wod-wiki-engine 0.35.2129 → 0.36.2133

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,9 +1,9 @@
1
- import { IDialect, EventRecord, Note, BlockRevision, BlockIndexRow, Session, AnalyticsDataPoint, StoredOutputStatement, WorkoutResults, ICodeStatement, IOutputStatement, NoteBlock, BlockEffort } from '@bitcobblers/wod-wiki-core';
1
+ import { IDialect, EventRecord, Note, BlockRevision, BlockIndexRow, Session, AnalyticsDataPoint, StoredOutputStatement, WorkoutResults, ICodeStatement, NoteBlock, BlockEffort } from '@bitcobblers/wod-wiki-core';
2
2
  export * from '@bitcobblers/wod-wiki-core';
3
- import { IRealtimeProcessor, ISummaryProcessor, IEffort, IScript, INowProvider } from '@bitcobblers/wod-wiki-lang';
3
+ import { IRealtimeProcessor, ISummaryProcessor, IEffort, IScript } from '@bitcobblers/wod-wiki-lang';
4
4
  export { ABSENT, AGGREGATE_BUILTINS, AUTHORITATIVE_CASTS, AmrapLogicStrategy, AnalyticsContext, AnalyticsEngine, AnalyticsProfileContext, AnalyticsResult, AnalyticsTransformer, BUILTIN_CALCS, BUNDLED_EFFORT_COUNT, BehaviorContext, BehaviorEventListener, BehaviorEventType, BlockBuilder, BlockContext, BlockLifecycleOptions, ButtonBehavior, CONSUMED_HINTS, CONSUMED_HINT_KEYS, CONTEXT_ATOMS, CalcDefinition, CalcEngine, CalcOrigin, CalcScope, CalculateBlockProcessor, CalculationDefinition, CalculationRegistry, CardioDialect, ChildSelectionBehavior, ChildrenStrategy, ChoiceGroupMetric, ClimbDialect, ClimbMetricType, CompletionDecision, CountdownTimerBehavior, CountupTimerBehavior, CrossFitDialect, DEFAULT_RESOLVER_OPTIONS, DEFAULT_RUNTIME_OPTIONS, DEFAULT_UNRESOLVED_EFFORT_MET, DIM_LENGTH, DIM_MASS, DIM_TIME, DIM_ZERO, DialectStack, DimVector, EFFORT_DATA_METRIC_TYPE, EFFORT_REGISTRY_ORIGINS, EffortBaseAttributes, EffortDerivation, EffortFallbackStrategy, EffortRegistrySource, EffortResolutionOptions, EffortResolver, EffortResolverOptions, ErrorAction, EventBus, EventCallback, EventHandlerOptions, ExecutionContext, ExecutionStatus, ExitBehavior, ExprNode, FixtureSyntaxError, GenericGroupStrategy, GenericLoopStrategy, GenericTimerStrategy, HabitsDialect, IAnalyticsEngine, IAnalyticsProcessorDescriptor, IAnalyticsProfile, IAnchorValue, IBehaviorContext, IBlockContext, ICastSubscription, IEffort, IEffortRegistry, IEffortResolver, IEvent, IEventBus, IEventHandler, IJitCompiler, ILookupTable, IMemoryLocation, IMemoryReference, IMetricPresentationPolicy, INTENSITY_TIERS, INowProvider, IRealtimeProcessor, IRuntimeAction, IRuntimeActionable, IRuntimeBehavior, IRuntimeBlock, IRuntimeBlockStrategy, IRuntimeClock, IRuntimeEventProvider, IRuntimeFactory, IRuntimeMemory, IRuntimeStack, IRuntimeSubscription, IScript, IScriptRuntime, ISummaryProcessor, InMemoryEffortRegistry, IntensityTier, InterceptMode, IntervalLogicStrategy, JitCompiler, LabelingBehavior, LineFormScope, LiteralKind, LocalRuntimeSubscription, LookupRegistry, MatchMode, MdTimerRuntime, MemoryEntry, MemoryLocation, MemoryTag, MemoryTypeEnum, MetricLine, MetricPresentationSurface, MetricPresentationToken, MetricRenderKind, MetricTone, MetricVisibility, MockClock, NextEvent, OutputEmitter, OutputListener, PRODUCTION_STRATEGIES, PopBlockAction, ProjectionResult, PushBlockAction, RegisterEventHandlerAction, Registry, ReportOutputBehavior, ReportOutputStrategy, ResolvedEffort, ResolvedEffortData, RoundState, RoundsMetric, RuntimeAdapter, RuntimeBlock, RuntimeBlockOptions, RuntimeClock, RuntimeController, RuntimeError, RuntimeFactory, RuntimeLogger, RuntimeMemory, RuntimeObservers, RuntimeStack, RuntimeStackOptions, STORE_CALCS, STREAM_ATOMS, ScriptRuntime, ScriptRuntimeDependencies, SegmentWithMetadata, SessionRootStrategy, SnapshotClock, SoundCueBehavior, SoundStrategy, StackEvent, StackListener, StackObserver, StackSnapshot, StandardAnalyticsProfile, StartSessionAction, StartSessionOptions, StartWorkoutAction, StatementMetricDiff, SubscribeOptions, SubscriptionManager, TestableBlockConfig, TimeSpan, TimerState, TwoPassEffortResolutionProcess, TypedMemoryReference, UNITS, UnitsDialect, UnregisterEventHandlerAction, Unsubscribe, VISIBILITY_ICONS, VISIBILITY_LABELS, Val, WhiteboardScript, WodDialect, YogaDialect, buildTooltip, bundledEfforts, calculateElapsed, canonicalizeType, collapseUnresolvedChoices, compareStatement, compileLineForm, compoundName, computeColumnLabel, computeLabel, createAnalyticsEngineForBlock, createCalcEngine, createCompiler, createDialectStack, createMetricPresentationPolicy, createMockClock, createParser, dialectRegistry, dialectStack, diffStatement, evaluate, evaluateCalculateDefinitions, extractMetrics, extractStatements, findBestFuzzyMatch, findUnresolvedChoices, frozenNow, getAnalyticsFromLogs, getHints, getMetricVisibility, getRuntimeNowMs, hasHint, hintMetric, hintsToContainer, isCastSubscription, isChoiceResolved, isTimeLikeMetric, isWithinThreshold, levenshteinDistance, metricPresentation, normalizeForFuzzy, outputNodeId, outputNodeIds, parseCalcLine, parseCalculateBlock, parseExpression, parseMetricLine, parseScript, realtimeProcessorRegistry, renderMetric, strategyRegistry, summaryProcessorRegistry, toStoredOutputStatement, truthy, wallClockNow, whiteboardParser, whiteboardScript, whiteboardScriptLanguage, writeChoiceSelection } from '@bitcobblers/wod-wiki-lang';
5
5
  export { BlockTimerDisplay, BlockTimerDisplayProps, ScriptRuntimeProvider, ScriptRuntimeProviderProps, UseRuntimeExecutionReturn, useActiveControls, useBlockMemory, useLiveAnalytics, useMemorySubscription, useNextPreview, useOutputStatements, usePrimaryTimer, useRoundDisplay, useRuntimeExecution, useScriptRuntime, useSecondaryTimers, useSnapshotBlocks, useStackDisplayRows, useStackFragmentSources, useStackSnapshot, useStackTimers, useTimerDisplay, useTimerElapsed } from '@bitcobblers/wod-wiki-lang/react';
6
- import { EventStore, QueryServiceStores, QueryResult, RowsQueryResult, FindQueryResult, PipelineResult } from '@bitcobblers/wod-wiki-wql';
6
+ import { EventStore } from '@bitcobblers/wod-wiki-wql';
7
7
  export { Aggregator, AnyParsedQuery, BlockQueryStore, ComparisonOp, DASHBOARD_GRID_MAX_COLS, DASHBOARD_WIDGET_TYPES, DEFAULT_DASHBOARD_TITLE, DashboardDocument, DashboardMeta, DashboardToken, DashboardWidget, EffortQueryStore, EventStore, FindOptions, FindPredicate, FindQueryResult, MetricPredicate, NoteQueryStore, PLANNED_WIDGET_TYPES, ParsedAggregateQuery, ParsedFindQuery, ParsedPipelineQuery, ParsedRowsQuery, PipelineSink, PipelineSource, QueryOptions, QueryResult, QueryService, QueryServiceStores, QueryWidgetSuffix, QueryWindow, RowsQueryResult, RowsRun, Series, SeriesPoint, TagFilter, TagValue, WQL_AGGREGATORS, WQL_CALC_TARGETS, WQL_CHART_HEADS, WQL_COMPARISON_OPS, WQL_CONTENT_FILTER_KEYS, WQL_DISPLAY_UNITS, WQL_FIND_TARGETS, WQL_FUNCTION_HEADS, WQL_GRAINS, WQL_INTENSITY_TIERS, WQL_KEYWORDS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_RESULT_PLANES, WQL_ROLLUP_PERIODS, WQL_SOURCES, WQL_SOURCE_HEADS, WQL_SOURCE_VALUES, WQL_STANDARD_DATASETS, WQL_TAG_KEYS, WQL_VIRTUAL_DIMS, WqlChartHead, buildDashboardDocument, buildDashboardScaffold, dashboardSlug, defaultTokenValues, extractDashboardTokens, isAggregateQuery, isDashboardMeta, isDashboardWidgetType, isFindQuery, isPipelineQuery, normalizeWql, parseQuery, parseQueryWidgetSuffix, parseWqlSuffixes, resolveWidgetType, serialize, splitAtWhere, substituteTokens, unknownTokensMessage, unknownWidgetTypeMessage, wql, wqlLanguage, wqlParser, wqlTerms } from '@bitcobblers/wod-wiki-wql';
8
8
  import { Session as Session$1, Note as Note$1, IStorage } from '@bitcobblers/wod-wiki-storage';
9
9
 
@@ -112,189 +112,6 @@ interface CorpusIRData {
112
112
  tags?: Record<string, string[]>;
113
113
  }
114
114
 
115
- /**
116
- * Headless Parse Command Runner
117
- *
118
- * Parses Whiteboard Script source text and emits a versioned IR parse-tree envelope.
119
- */
120
-
121
- declare class ParseSyntaxError extends Error {
122
- readonly errors: Array<{
123
- message: string;
124
- line?: number;
125
- }>;
126
- constructor(errors: Array<{
127
- message: string;
128
- line?: number;
129
- }>, message?: string);
130
- }
131
- interface ParseOptions {
132
- sport?: string;
133
- sourceLabel?: string;
134
- }
135
- /**
136
- * Parses Whiteboard Script source directly into a StatementNode IR envelope.
137
- */
138
- declare function runParse(source: string, options?: ParseOptions): WodWikiIRFile<StatementNode>;
139
-
140
- /**
141
- * Headless Execution Command Runner
142
- *
143
- * Executes Whiteboard Script through JIT compiler and runtime state machine,
144
- * emitting a versioned execution-log IR envelope.
145
- */
146
-
147
- interface RunOptions {
148
- sport?: string;
149
- dialect?: 'time' | 'log';
150
- blockId?: string;
151
- blockVersion?: number;
152
- startTime?: number;
153
- maxIterations?: number;
154
- now?: INowProvider;
155
- sourceLabel?: string;
156
- }
157
- declare function buildWorkoutResults(outputs: readonly IOutputStatement[], options: {
158
- readonly startTime?: number;
159
- readonly elapsedTime: number;
160
- readonly completed: boolean;
161
- readonly now: INowProvider;
162
- }): WorkoutResults;
163
- /**
164
- * Runs a workout script to completion using headless state machine and Node clock.
165
- */
166
- declare function runExecution(source: string, options?: RunOptions): Promise<WodWikiIRFile<ExecutionLog>>;
167
-
168
- /**
169
- * Headless WQL Query Command Runner
170
- *
171
- * Evaluates WQL queries against in-memory stores sourced from --corpus,
172
- * --stdin-log, or --stdin-facts, and emits a versioned IR envelope.
173
- */
174
-
175
- declare class WqlSyntaxError extends Error {
176
- readonly query: string;
177
- readonly syntaxError: string;
178
- constructor(query: string, syntaxError: string);
179
- }
180
- interface QueryCliOptions {
181
- corpusPath?: string;
182
- stdinLog?: string;
183
- stdinFacts?: string;
184
- preferredUnit?: string;
185
- sourceLabel?: string;
186
- /** Pre-built store bundle (e.g. sqlite-backed). When set, the corpus/stdin
187
- * dataset options are ignored. */
188
- stores?: QueryServiceStores;
189
- }
190
- interface LoadedData {
191
- eventRecords: EventRecord[];
192
- facts: AnalyticsDataPoint[];
193
- results: Session[];
194
- notes: Note[];
195
- blocks: BlockIndexRow[];
196
- revisions: BlockRevision[];
197
- efforts: IEffort[];
198
- noteTags: Record<string, string[]>;
199
- }
200
- declare function loadQueryData(options: QueryCliOptions): LoadedData;
201
- /**
202
- * Runs a WQL query against the provided in-memory dataset and returns a versioned IR envelope.
203
- */
204
- declare function runQueryCli(wqlString: string, options?: QueryCliOptions): Promise<WodWikiIRFile<QueryResult | RowsQueryResult | FindQueryResult | PipelineResult>>;
205
-
206
- /**
207
- * Dynamic Language Pack Loader
208
- *
209
- * Dynamically loads and registers Language Packs passed via `--pack <module-spec>`.
210
- * Throws PackLoadError on failure, enabling exit code 3 handling.
211
- */
212
-
213
- declare class PackLoadError extends Error {
214
- readonly spec: string;
215
- readonly originalError: unknown;
216
- constructor(spec: string, originalError: unknown);
217
- }
218
- /**
219
- * Dynamically imports a Language Pack module and registers it.
220
- *
221
- * @param moduleSpec - Relative or absolute path, or package name.
222
- */
223
- declare function loadLanguagePack(moduleSpec: string): Promise<LanguagePack>;
224
-
225
- /**
226
- * CLI Output Formatters (JSON, ASCII Table, CSV)
227
- *
228
- * Implements presentation formatting for parse-tree, execution-log,
229
- * and WQL query results across json, table, and csv formats.
230
- */
231
-
232
- type OutputFormat = 'json' | 'table' | 'csv';
233
- /**
234
- * Format StatementNode parse tree
235
- */
236
- declare function formatParseOutput(ir: WodWikiIRFile<StatementNode>, format: OutputFormat, pretty?: boolean): string;
237
- /**
238
- * Format ExecutionLog runtime output
239
- */
240
- declare function formatExecutionOutput(ir: WodWikiIRFile<ExecutionLog>, format: OutputFormat, pretty?: boolean): string;
241
- /**
242
- * Format QueryResult / RowsQueryResult / FindQueryResult / PipelineResult
243
- */
244
- declare function formatQueryOutput(ir: WodWikiIRFile<QueryResult | RowsQueryResult | FindQueryResult | PipelineResult>, format: OutputFormat, pretty?: boolean): string;
245
-
246
- /**
247
- * Unified `wod` CLI Runner
248
- *
249
- * Implements CLI command routing, argument parsing, pipe handling,
250
- * and exit code conventions per wayfinder #962 and issue #967.
251
- *
252
- * Exit Codes:
253
- * 0 - OK / Success (including empty query results)
254
- * 1 - Runtime error (file missing, bad arguments, execution error)
255
- * 2 - Parse / Syntax error (invalid Whiteboard Script or malformed WQL)
256
- * 3 - Pack load error (failed to import or register --pack)
257
- */
258
-
259
- interface CliParsedArgs {
260
- subcommand?: 'parse' | 'run' | 'query' | 'download' | 'import' | 'build' | 'seed' | 'reset' | 'help' | 'version';
261
- target?: string;
262
- /** Second positional: the id (download) or file (import) after the kind. */
263
- target2?: string;
264
- corpus?: string;
265
- stdinLog?: boolean;
266
- stdinFacts?: boolean;
267
- format: OutputFormat;
268
- output?: string;
269
- packs: string[];
270
- sport?: string;
271
- unit?: string;
272
- help?: boolean;
273
- version?: boolean;
274
- /** SQLite database path (--db). Defaults to WOD_WIKI_DB or ./wodwiki.db. */
275
- db?: string;
276
- /** IR debug output: undefined = off, '' = default file name, otherwise the file name. */
277
- debug?: string;
278
- /** Extra seed source directories for `wod seed` (repeatable). */
279
- sources: string[];
280
- /** `wod build`: scaffold markdown stubs for newly discovered efforts. */
281
- scaffold?: boolean;
282
- /** `wod build`: extra template markdown file compiled as the `template` chunk. */
283
- template?: string;
284
- /** `wod build`: content repo root (alias for the positional directory). */
285
- dir?: string;
286
- }
287
- declare function parseCliArgs(args: string[]): CliParsedArgs;
288
- declare function readStdin(): Promise<string>;
289
- /**
290
- * Main CLI entry point. Returns numeric exit code.
291
- */
292
- declare function cliMain(argv?: string[], io?: {
293
- stdout?: (text: string) => void;
294
- stderr?: (text: string) => void;
295
- readStdinFn?: () => Promise<string>;
296
- }): Promise<number>;
297
-
298
115
  /**
299
116
  * Import / Export exchange formats for notes and sessions.
300
117
  *
@@ -372,7 +189,7 @@ declare function effortToMarkdown(effort: {
372
189
  /** One-label-per-row CSV (header `label`) for equipment catalogs. */
373
190
  declare function equipmentToCsv(labels: readonly string[]): string;
374
191
  declare function csvToEquipmentLabels(csv: string): string[];
375
- declare const SESSION_CSV_HEADER: ("duration" | "dialect" | "origin" | "completed" | "metricType" | "sourceBlockKey" | "timestamp" | "blockContentId" | "noteId" | "blockId" | "blockVersion" | "status" | "startTime" | "endTime" | "effortSlug" | "sessionId" | "sessionCreatedAt" | "sessionExtraJson" | "eventId" | "grain" | "outputType" | "pageId" | "eventBlockId" | "eventBlockVersion" | "eventBlockContentId" | "eventOrigin" | "timeSpan" | "sourceStatementId" | "line" | "text" | "stackLevel" | "completionReason" | "representationKind" | "metricValue" | "metricUnit" | "metricImage" | "metricOrigin" | "metricMetadata" | "metricTemporal" | "metricJson" | "eventExtraJson")[];
192
+ declare const SESSION_CSV_HEADER: ("duration" | "dialect" | "origin" | "noteId" | "sessionId" | "blockId" | "blockVersion" | "blockContentId" | "status" | "startTime" | "endTime" | "completed" | "sessionCreatedAt" | "sessionExtraJson" | "eventId" | "grain" | "outputType" | "timestamp" | "pageId" | "effortSlug" | "eventBlockId" | "eventBlockVersion" | "eventBlockContentId" | "eventOrigin" | "timeSpan" | "sourceBlockKey" | "sourceStatementId" | "line" | "text" | "stackLevel" | "completionReason" | "representationKind" | "metricType" | "metricValue" | "metricUnit" | "metricImage" | "metricOrigin" | "metricMetadata" | "metricTemporal" | "metricJson" | "eventExtraJson")[];
376
193
  /**
377
194
  * Serialize a session + its events to CSV — one row per metric, preceded by
378
195
  * one session anchor row (empty event columns). Import with
@@ -398,13 +215,13 @@ declare function csvToSessionRows(csv: string): SessionImportRows;
398
215
  * Auto-generated build version metadata.
399
216
  * Do not edit directly; updated by scripts/stamp-version.ts
400
217
  */
401
- declare const VERSION = "0.35.2129";
402
- declare const GIT_SHA = "a49fd2c";
403
- declare const BUILD_TIME = "2026-10-14T20:59:51.571Z";
218
+ declare const VERSION = "0.36.2133";
219
+ declare const GIT_SHA = "bb2644d";
220
+ declare const BUILD_TIME = "2026-10-15T01:00:35.539Z";
404
221
  declare const SEMVER: {
405
- readonly version: "0.35.2129";
406
- readonly gitSha: "a49fd2c";
407
- readonly buildTime: "2026-10-14T20:59:51.571Z";
222
+ readonly version: "0.36.2133";
223
+ readonly gitSha: "bb2644d";
224
+ readonly buildTime: "2026-10-15T01:00:35.539Z";
408
225
  };
409
226
 
410
227
  declare const SEED_SCHEMA = 8;
@@ -485,4 +302,4 @@ declare function applySeedChunk(storage: IStorage, write: SeedChunkWrite): Promi
485
302
  declare function assertSeedManifest(value: unknown): SeedManifest;
486
303
  declare function assertSeedRows(value: unknown): SeedRow[];
487
304
 
488
- export { BUILD_TIME, CANVAS_CHUNK_ID, type ChunkKind, type CliParsedArgs, type CorpusIRData, DASHBOARDS_CHUNK_ID, EFFORTS_CHUNK_ID, type EffortFileFields, type ExecutionLog, GIT_SHA, type IrKind, type LanguagePack, type LanguagePackIdentity, type LanguagePackLangSlice, type LanguagePackUiSlice, type ManifestChunk, type MetricNode, NOTE_ID_FRONTMATTER_KEY, type NoteIdentity, type OutputFormat, PackLoadError, type ParseOptions, ParseSyntaxError, type QueryCliOptions, type RunOptions, SEED_BROADCAST_CHANNEL, SEED_REGISTERED_WIDGETS, SEED_SCHEMA, SEMVER, SESSION_CSV_HEADER, type SeedChunkResult, type SeedChunkWrite, type SeedManifest, type SeedMetaRecord, type SeedRow, type SessionImportRows, type StatementNode, TEMPLATE_CHUNK_ID, type TypedTagItem, VERSION, type WodWikiIRFile, WqlSyntaxError, applySeedChunk, assertSeedManifest, assertSeedRows, buildStatementTree, buildWorkoutResults, canvasRouteSlug, catalogForChunkId, cliMain, composeNoteMarkdown, createIRFile, csvToEquipmentLabels, csvToSessionRows, defineLanguagePack, effortToMarkdown, emptySeedMeta, equipmentToCsv, extractNoteIdentity, extractTypedTags, formatExecutionOutput, formatParseOutput, formatQueryOutput, getRegisteredLanguagePacks, inMemoryEventStore, injectIdentityFrontmatter, isIRFile, listLanguagePacks, loadLanguagePack, loadQueryData, markdownToEffort, parseCliArgs, parseCsvLine, readFrontmatterMeta, readStdin, registerLanguagePack, runExecution, runParse, runQueryCli, seedMetaKey, seedNoteId, seedNoteSourceId, sessionToCsv, splitCsvRecords, statementToNode, unregisterLanguagePack };
305
+ export { BUILD_TIME, CANVAS_CHUNK_ID, type ChunkKind, type CorpusIRData, DASHBOARDS_CHUNK_ID, EFFORTS_CHUNK_ID, type EffortFileFields, type ExecutionLog, GIT_SHA, type IrKind, type LanguagePack, type LanguagePackIdentity, type LanguagePackLangSlice, type LanguagePackUiSlice, type ManifestChunk, type MetricNode, NOTE_ID_FRONTMATTER_KEY, type NoteIdentity, SEED_BROADCAST_CHANNEL, SEED_REGISTERED_WIDGETS, SEED_SCHEMA, SEMVER, SESSION_CSV_HEADER, type SeedChunkResult, type SeedChunkWrite, type SeedManifest, type SeedMetaRecord, type SeedRow, type SessionImportRows, type StatementNode, TEMPLATE_CHUNK_ID, type TypedTagItem, VERSION, type WodWikiIRFile, applySeedChunk, assertSeedManifest, assertSeedRows, buildStatementTree, canvasRouteSlug, catalogForChunkId, composeNoteMarkdown, createIRFile, csvToEquipmentLabels, csvToSessionRows, defineLanguagePack, effortToMarkdown, emptySeedMeta, equipmentToCsv, extractNoteIdentity, extractTypedTags, getRegisteredLanguagePacks, inMemoryEventStore, injectIdentityFrontmatter, isIRFile, listLanguagePacks, markdownToEffort, parseCsvLine, readFrontmatterMeta, registerLanguagePack, seedMetaKey, seedNoteId, seedNoteSourceId, sessionToCsv, splitCsvRecords, statementToNode, unregisterLanguagePack };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { IDialect, EventRecord, Note, BlockRevision, BlockIndexRow, Session, AnalyticsDataPoint, StoredOutputStatement, WorkoutResults, ICodeStatement, IOutputStatement, NoteBlock, BlockEffort } from '@bitcobblers/wod-wiki-core';
1
+ import { IDialect, EventRecord, Note, BlockRevision, BlockIndexRow, Session, AnalyticsDataPoint, StoredOutputStatement, WorkoutResults, ICodeStatement, NoteBlock, BlockEffort } from '@bitcobblers/wod-wiki-core';
2
2
  export * from '@bitcobblers/wod-wiki-core';
3
- import { IRealtimeProcessor, ISummaryProcessor, IEffort, IScript, INowProvider } from '@bitcobblers/wod-wiki-lang';
3
+ import { IRealtimeProcessor, ISummaryProcessor, IEffort, IScript } from '@bitcobblers/wod-wiki-lang';
4
4
  export { ABSENT, AGGREGATE_BUILTINS, AUTHORITATIVE_CASTS, AmrapLogicStrategy, AnalyticsContext, AnalyticsEngine, AnalyticsProfileContext, AnalyticsResult, AnalyticsTransformer, BUILTIN_CALCS, BUNDLED_EFFORT_COUNT, BehaviorContext, BehaviorEventListener, BehaviorEventType, BlockBuilder, BlockContext, BlockLifecycleOptions, ButtonBehavior, CONSUMED_HINTS, CONSUMED_HINT_KEYS, CONTEXT_ATOMS, CalcDefinition, CalcEngine, CalcOrigin, CalcScope, CalculateBlockProcessor, CalculationDefinition, CalculationRegistry, CardioDialect, ChildSelectionBehavior, ChildrenStrategy, ChoiceGroupMetric, ClimbDialect, ClimbMetricType, CompletionDecision, CountdownTimerBehavior, CountupTimerBehavior, CrossFitDialect, DEFAULT_RESOLVER_OPTIONS, DEFAULT_RUNTIME_OPTIONS, DEFAULT_UNRESOLVED_EFFORT_MET, DIM_LENGTH, DIM_MASS, DIM_TIME, DIM_ZERO, DialectStack, DimVector, EFFORT_DATA_METRIC_TYPE, EFFORT_REGISTRY_ORIGINS, EffortBaseAttributes, EffortDerivation, EffortFallbackStrategy, EffortRegistrySource, EffortResolutionOptions, EffortResolver, EffortResolverOptions, ErrorAction, EventBus, EventCallback, EventHandlerOptions, ExecutionContext, ExecutionStatus, ExitBehavior, ExprNode, FixtureSyntaxError, GenericGroupStrategy, GenericLoopStrategy, GenericTimerStrategy, HabitsDialect, IAnalyticsEngine, IAnalyticsProcessorDescriptor, IAnalyticsProfile, IAnchorValue, IBehaviorContext, IBlockContext, ICastSubscription, IEffort, IEffortRegistry, IEffortResolver, IEvent, IEventBus, IEventHandler, IJitCompiler, ILookupTable, IMemoryLocation, IMemoryReference, IMetricPresentationPolicy, INTENSITY_TIERS, INowProvider, IRealtimeProcessor, IRuntimeAction, IRuntimeActionable, IRuntimeBehavior, IRuntimeBlock, IRuntimeBlockStrategy, IRuntimeClock, IRuntimeEventProvider, IRuntimeFactory, IRuntimeMemory, IRuntimeStack, IRuntimeSubscription, IScript, IScriptRuntime, ISummaryProcessor, InMemoryEffortRegistry, IntensityTier, InterceptMode, IntervalLogicStrategy, JitCompiler, LabelingBehavior, LineFormScope, LiteralKind, LocalRuntimeSubscription, LookupRegistry, MatchMode, MdTimerRuntime, MemoryEntry, MemoryLocation, MemoryTag, MemoryTypeEnum, MetricLine, MetricPresentationSurface, MetricPresentationToken, MetricRenderKind, MetricTone, MetricVisibility, MockClock, NextEvent, OutputEmitter, OutputListener, PRODUCTION_STRATEGIES, PopBlockAction, ProjectionResult, PushBlockAction, RegisterEventHandlerAction, Registry, ReportOutputBehavior, ReportOutputStrategy, ResolvedEffort, ResolvedEffortData, RoundState, RoundsMetric, RuntimeAdapter, RuntimeBlock, RuntimeBlockOptions, RuntimeClock, RuntimeController, RuntimeError, RuntimeFactory, RuntimeLogger, RuntimeMemory, RuntimeObservers, RuntimeStack, RuntimeStackOptions, STORE_CALCS, STREAM_ATOMS, ScriptRuntime, ScriptRuntimeDependencies, SegmentWithMetadata, SessionRootStrategy, SnapshotClock, SoundCueBehavior, SoundStrategy, StackEvent, StackListener, StackObserver, StackSnapshot, StandardAnalyticsProfile, StartSessionAction, StartSessionOptions, StartWorkoutAction, StatementMetricDiff, SubscribeOptions, SubscriptionManager, TestableBlockConfig, TimeSpan, TimerState, TwoPassEffortResolutionProcess, TypedMemoryReference, UNITS, UnitsDialect, UnregisterEventHandlerAction, Unsubscribe, VISIBILITY_ICONS, VISIBILITY_LABELS, Val, WhiteboardScript, WodDialect, YogaDialect, buildTooltip, bundledEfforts, calculateElapsed, canonicalizeType, collapseUnresolvedChoices, compareStatement, compileLineForm, compoundName, computeColumnLabel, computeLabel, createAnalyticsEngineForBlock, createCalcEngine, createCompiler, createDialectStack, createMetricPresentationPolicy, createMockClock, createParser, dialectRegistry, dialectStack, diffStatement, evaluate, evaluateCalculateDefinitions, extractMetrics, extractStatements, findBestFuzzyMatch, findUnresolvedChoices, frozenNow, getAnalyticsFromLogs, getHints, getMetricVisibility, getRuntimeNowMs, hasHint, hintMetric, hintsToContainer, isCastSubscription, isChoiceResolved, isTimeLikeMetric, isWithinThreshold, levenshteinDistance, metricPresentation, normalizeForFuzzy, outputNodeId, outputNodeIds, parseCalcLine, parseCalculateBlock, parseExpression, parseMetricLine, parseScript, realtimeProcessorRegistry, renderMetric, strategyRegistry, summaryProcessorRegistry, toStoredOutputStatement, truthy, wallClockNow, whiteboardParser, whiteboardScript, whiteboardScriptLanguage, writeChoiceSelection } from '@bitcobblers/wod-wiki-lang';
5
5
  export { BlockTimerDisplay, BlockTimerDisplayProps, ScriptRuntimeProvider, ScriptRuntimeProviderProps, UseRuntimeExecutionReturn, useActiveControls, useBlockMemory, useLiveAnalytics, useMemorySubscription, useNextPreview, useOutputStatements, usePrimaryTimer, useRoundDisplay, useRuntimeExecution, useScriptRuntime, useSecondaryTimers, useSnapshotBlocks, useStackDisplayRows, useStackFragmentSources, useStackSnapshot, useStackTimers, useTimerDisplay, useTimerElapsed } from '@bitcobblers/wod-wiki-lang/react';
6
- import { EventStore, QueryServiceStores, QueryResult, RowsQueryResult, FindQueryResult, PipelineResult } from '@bitcobblers/wod-wiki-wql';
6
+ import { EventStore } from '@bitcobblers/wod-wiki-wql';
7
7
  export { Aggregator, AnyParsedQuery, BlockQueryStore, ComparisonOp, DASHBOARD_GRID_MAX_COLS, DASHBOARD_WIDGET_TYPES, DEFAULT_DASHBOARD_TITLE, DashboardDocument, DashboardMeta, DashboardToken, DashboardWidget, EffortQueryStore, EventStore, FindOptions, FindPredicate, FindQueryResult, MetricPredicate, NoteQueryStore, PLANNED_WIDGET_TYPES, ParsedAggregateQuery, ParsedFindQuery, ParsedPipelineQuery, ParsedRowsQuery, PipelineSink, PipelineSource, QueryOptions, QueryResult, QueryService, QueryServiceStores, QueryWidgetSuffix, QueryWindow, RowsQueryResult, RowsRun, Series, SeriesPoint, TagFilter, TagValue, WQL_AGGREGATORS, WQL_CALC_TARGETS, WQL_CHART_HEADS, WQL_COMPARISON_OPS, WQL_CONTENT_FILTER_KEYS, WQL_DISPLAY_UNITS, WQL_FIND_TARGETS, WQL_FUNCTION_HEADS, WQL_GRAINS, WQL_INTENSITY_TIERS, WQL_KEYWORDS, WQL_METRIC_AGGREGATES, WQL_METRIC_FAMILIES, WQL_RESULT_PLANES, WQL_ROLLUP_PERIODS, WQL_SOURCES, WQL_SOURCE_HEADS, WQL_SOURCE_VALUES, WQL_STANDARD_DATASETS, WQL_TAG_KEYS, WQL_VIRTUAL_DIMS, WqlChartHead, buildDashboardDocument, buildDashboardScaffold, dashboardSlug, defaultTokenValues, extractDashboardTokens, isAggregateQuery, isDashboardMeta, isDashboardWidgetType, isFindQuery, isPipelineQuery, normalizeWql, parseQuery, parseQueryWidgetSuffix, parseWqlSuffixes, resolveWidgetType, serialize, splitAtWhere, substituteTokens, unknownTokensMessage, unknownWidgetTypeMessage, wql, wqlLanguage, wqlParser, wqlTerms } from '@bitcobblers/wod-wiki-wql';
8
8
  import { Session as Session$1, Note as Note$1, IStorage } from '@bitcobblers/wod-wiki-storage';
9
9
 
@@ -112,189 +112,6 @@ interface CorpusIRData {
112
112
  tags?: Record<string, string[]>;
113
113
  }
114
114
 
115
- /**
116
- * Headless Parse Command Runner
117
- *
118
- * Parses Whiteboard Script source text and emits a versioned IR parse-tree envelope.
119
- */
120
-
121
- declare class ParseSyntaxError extends Error {
122
- readonly errors: Array<{
123
- message: string;
124
- line?: number;
125
- }>;
126
- constructor(errors: Array<{
127
- message: string;
128
- line?: number;
129
- }>, message?: string);
130
- }
131
- interface ParseOptions {
132
- sport?: string;
133
- sourceLabel?: string;
134
- }
135
- /**
136
- * Parses Whiteboard Script source directly into a StatementNode IR envelope.
137
- */
138
- declare function runParse(source: string, options?: ParseOptions): WodWikiIRFile<StatementNode>;
139
-
140
- /**
141
- * Headless Execution Command Runner
142
- *
143
- * Executes Whiteboard Script through JIT compiler and runtime state machine,
144
- * emitting a versioned execution-log IR envelope.
145
- */
146
-
147
- interface RunOptions {
148
- sport?: string;
149
- dialect?: 'time' | 'log';
150
- blockId?: string;
151
- blockVersion?: number;
152
- startTime?: number;
153
- maxIterations?: number;
154
- now?: INowProvider;
155
- sourceLabel?: string;
156
- }
157
- declare function buildWorkoutResults(outputs: readonly IOutputStatement[], options: {
158
- readonly startTime?: number;
159
- readonly elapsedTime: number;
160
- readonly completed: boolean;
161
- readonly now: INowProvider;
162
- }): WorkoutResults;
163
- /**
164
- * Runs a workout script to completion using headless state machine and Node clock.
165
- */
166
- declare function runExecution(source: string, options?: RunOptions): Promise<WodWikiIRFile<ExecutionLog>>;
167
-
168
- /**
169
- * Headless WQL Query Command Runner
170
- *
171
- * Evaluates WQL queries against in-memory stores sourced from --corpus,
172
- * --stdin-log, or --stdin-facts, and emits a versioned IR envelope.
173
- */
174
-
175
- declare class WqlSyntaxError extends Error {
176
- readonly query: string;
177
- readonly syntaxError: string;
178
- constructor(query: string, syntaxError: string);
179
- }
180
- interface QueryCliOptions {
181
- corpusPath?: string;
182
- stdinLog?: string;
183
- stdinFacts?: string;
184
- preferredUnit?: string;
185
- sourceLabel?: string;
186
- /** Pre-built store bundle (e.g. sqlite-backed). When set, the corpus/stdin
187
- * dataset options are ignored. */
188
- stores?: QueryServiceStores;
189
- }
190
- interface LoadedData {
191
- eventRecords: EventRecord[];
192
- facts: AnalyticsDataPoint[];
193
- results: Session[];
194
- notes: Note[];
195
- blocks: BlockIndexRow[];
196
- revisions: BlockRevision[];
197
- efforts: IEffort[];
198
- noteTags: Record<string, string[]>;
199
- }
200
- declare function loadQueryData(options: QueryCliOptions): LoadedData;
201
- /**
202
- * Runs a WQL query against the provided in-memory dataset and returns a versioned IR envelope.
203
- */
204
- declare function runQueryCli(wqlString: string, options?: QueryCliOptions): Promise<WodWikiIRFile<QueryResult | RowsQueryResult | FindQueryResult | PipelineResult>>;
205
-
206
- /**
207
- * Dynamic Language Pack Loader
208
- *
209
- * Dynamically loads and registers Language Packs passed via `--pack <module-spec>`.
210
- * Throws PackLoadError on failure, enabling exit code 3 handling.
211
- */
212
-
213
- declare class PackLoadError extends Error {
214
- readonly spec: string;
215
- readonly originalError: unknown;
216
- constructor(spec: string, originalError: unknown);
217
- }
218
- /**
219
- * Dynamically imports a Language Pack module and registers it.
220
- *
221
- * @param moduleSpec - Relative or absolute path, or package name.
222
- */
223
- declare function loadLanguagePack(moduleSpec: string): Promise<LanguagePack>;
224
-
225
- /**
226
- * CLI Output Formatters (JSON, ASCII Table, CSV)
227
- *
228
- * Implements presentation formatting for parse-tree, execution-log,
229
- * and WQL query results across json, table, and csv formats.
230
- */
231
-
232
- type OutputFormat = 'json' | 'table' | 'csv';
233
- /**
234
- * Format StatementNode parse tree
235
- */
236
- declare function formatParseOutput(ir: WodWikiIRFile<StatementNode>, format: OutputFormat, pretty?: boolean): string;
237
- /**
238
- * Format ExecutionLog runtime output
239
- */
240
- declare function formatExecutionOutput(ir: WodWikiIRFile<ExecutionLog>, format: OutputFormat, pretty?: boolean): string;
241
- /**
242
- * Format QueryResult / RowsQueryResult / FindQueryResult / PipelineResult
243
- */
244
- declare function formatQueryOutput(ir: WodWikiIRFile<QueryResult | RowsQueryResult | FindQueryResult | PipelineResult>, format: OutputFormat, pretty?: boolean): string;
245
-
246
- /**
247
- * Unified `wod` CLI Runner
248
- *
249
- * Implements CLI command routing, argument parsing, pipe handling,
250
- * and exit code conventions per wayfinder #962 and issue #967.
251
- *
252
- * Exit Codes:
253
- * 0 - OK / Success (including empty query results)
254
- * 1 - Runtime error (file missing, bad arguments, execution error)
255
- * 2 - Parse / Syntax error (invalid Whiteboard Script or malformed WQL)
256
- * 3 - Pack load error (failed to import or register --pack)
257
- */
258
-
259
- interface CliParsedArgs {
260
- subcommand?: 'parse' | 'run' | 'query' | 'download' | 'import' | 'build' | 'seed' | 'reset' | 'help' | 'version';
261
- target?: string;
262
- /** Second positional: the id (download) or file (import) after the kind. */
263
- target2?: string;
264
- corpus?: string;
265
- stdinLog?: boolean;
266
- stdinFacts?: boolean;
267
- format: OutputFormat;
268
- output?: string;
269
- packs: string[];
270
- sport?: string;
271
- unit?: string;
272
- help?: boolean;
273
- version?: boolean;
274
- /** SQLite database path (--db). Defaults to WOD_WIKI_DB or ./wodwiki.db. */
275
- db?: string;
276
- /** IR debug output: undefined = off, '' = default file name, otherwise the file name. */
277
- debug?: string;
278
- /** Extra seed source directories for `wod seed` (repeatable). */
279
- sources: string[];
280
- /** `wod build`: scaffold markdown stubs for newly discovered efforts. */
281
- scaffold?: boolean;
282
- /** `wod build`: extra template markdown file compiled as the `template` chunk. */
283
- template?: string;
284
- /** `wod build`: content repo root (alias for the positional directory). */
285
- dir?: string;
286
- }
287
- declare function parseCliArgs(args: string[]): CliParsedArgs;
288
- declare function readStdin(): Promise<string>;
289
- /**
290
- * Main CLI entry point. Returns numeric exit code.
291
- */
292
- declare function cliMain(argv?: string[], io?: {
293
- stdout?: (text: string) => void;
294
- stderr?: (text: string) => void;
295
- readStdinFn?: () => Promise<string>;
296
- }): Promise<number>;
297
-
298
115
  /**
299
116
  * Import / Export exchange formats for notes and sessions.
300
117
  *
@@ -372,7 +189,7 @@ declare function effortToMarkdown(effort: {
372
189
  /** One-label-per-row CSV (header `label`) for equipment catalogs. */
373
190
  declare function equipmentToCsv(labels: readonly string[]): string;
374
191
  declare function csvToEquipmentLabels(csv: string): string[];
375
- declare const SESSION_CSV_HEADER: ("duration" | "dialect" | "origin" | "completed" | "metricType" | "sourceBlockKey" | "timestamp" | "blockContentId" | "noteId" | "blockId" | "blockVersion" | "status" | "startTime" | "endTime" | "effortSlug" | "sessionId" | "sessionCreatedAt" | "sessionExtraJson" | "eventId" | "grain" | "outputType" | "pageId" | "eventBlockId" | "eventBlockVersion" | "eventBlockContentId" | "eventOrigin" | "timeSpan" | "sourceStatementId" | "line" | "text" | "stackLevel" | "completionReason" | "representationKind" | "metricValue" | "metricUnit" | "metricImage" | "metricOrigin" | "metricMetadata" | "metricTemporal" | "metricJson" | "eventExtraJson")[];
192
+ declare const SESSION_CSV_HEADER: ("duration" | "dialect" | "origin" | "noteId" | "sessionId" | "blockId" | "blockVersion" | "blockContentId" | "status" | "startTime" | "endTime" | "completed" | "sessionCreatedAt" | "sessionExtraJson" | "eventId" | "grain" | "outputType" | "timestamp" | "pageId" | "effortSlug" | "eventBlockId" | "eventBlockVersion" | "eventBlockContentId" | "eventOrigin" | "timeSpan" | "sourceBlockKey" | "sourceStatementId" | "line" | "text" | "stackLevel" | "completionReason" | "representationKind" | "metricType" | "metricValue" | "metricUnit" | "metricImage" | "metricOrigin" | "metricMetadata" | "metricTemporal" | "metricJson" | "eventExtraJson")[];
376
193
  /**
377
194
  * Serialize a session + its events to CSV — one row per metric, preceded by
378
195
  * one session anchor row (empty event columns). Import with
@@ -398,13 +215,13 @@ declare function csvToSessionRows(csv: string): SessionImportRows;
398
215
  * Auto-generated build version metadata.
399
216
  * Do not edit directly; updated by scripts/stamp-version.ts
400
217
  */
401
- declare const VERSION = "0.35.2129";
402
- declare const GIT_SHA = "a49fd2c";
403
- declare const BUILD_TIME = "2026-10-14T20:59:51.571Z";
218
+ declare const VERSION = "0.36.2133";
219
+ declare const GIT_SHA = "bb2644d";
220
+ declare const BUILD_TIME = "2026-10-15T01:00:35.539Z";
404
221
  declare const SEMVER: {
405
- readonly version: "0.35.2129";
406
- readonly gitSha: "a49fd2c";
407
- readonly buildTime: "2026-10-14T20:59:51.571Z";
222
+ readonly version: "0.36.2133";
223
+ readonly gitSha: "bb2644d";
224
+ readonly buildTime: "2026-10-15T01:00:35.539Z";
408
225
  };
409
226
 
410
227
  declare const SEED_SCHEMA = 8;
@@ -485,4 +302,4 @@ declare function applySeedChunk(storage: IStorage, write: SeedChunkWrite): Promi
485
302
  declare function assertSeedManifest(value: unknown): SeedManifest;
486
303
  declare function assertSeedRows(value: unknown): SeedRow[];
487
304
 
488
- export { BUILD_TIME, CANVAS_CHUNK_ID, type ChunkKind, type CliParsedArgs, type CorpusIRData, DASHBOARDS_CHUNK_ID, EFFORTS_CHUNK_ID, type EffortFileFields, type ExecutionLog, GIT_SHA, type IrKind, type LanguagePack, type LanguagePackIdentity, type LanguagePackLangSlice, type LanguagePackUiSlice, type ManifestChunk, type MetricNode, NOTE_ID_FRONTMATTER_KEY, type NoteIdentity, type OutputFormat, PackLoadError, type ParseOptions, ParseSyntaxError, type QueryCliOptions, type RunOptions, SEED_BROADCAST_CHANNEL, SEED_REGISTERED_WIDGETS, SEED_SCHEMA, SEMVER, SESSION_CSV_HEADER, type SeedChunkResult, type SeedChunkWrite, type SeedManifest, type SeedMetaRecord, type SeedRow, type SessionImportRows, type StatementNode, TEMPLATE_CHUNK_ID, type TypedTagItem, VERSION, type WodWikiIRFile, WqlSyntaxError, applySeedChunk, assertSeedManifest, assertSeedRows, buildStatementTree, buildWorkoutResults, canvasRouteSlug, catalogForChunkId, cliMain, composeNoteMarkdown, createIRFile, csvToEquipmentLabels, csvToSessionRows, defineLanguagePack, effortToMarkdown, emptySeedMeta, equipmentToCsv, extractNoteIdentity, extractTypedTags, formatExecutionOutput, formatParseOutput, formatQueryOutput, getRegisteredLanguagePacks, inMemoryEventStore, injectIdentityFrontmatter, isIRFile, listLanguagePacks, loadLanguagePack, loadQueryData, markdownToEffort, parseCliArgs, parseCsvLine, readFrontmatterMeta, readStdin, registerLanguagePack, runExecution, runParse, runQueryCli, seedMetaKey, seedNoteId, seedNoteSourceId, sessionToCsv, splitCsvRecords, statementToNode, unregisterLanguagePack };
305
+ export { BUILD_TIME, CANVAS_CHUNK_ID, type ChunkKind, type CorpusIRData, DASHBOARDS_CHUNK_ID, EFFORTS_CHUNK_ID, type EffortFileFields, type ExecutionLog, GIT_SHA, type IrKind, type LanguagePack, type LanguagePackIdentity, type LanguagePackLangSlice, type LanguagePackUiSlice, type ManifestChunk, type MetricNode, NOTE_ID_FRONTMATTER_KEY, type NoteIdentity, SEED_BROADCAST_CHANNEL, SEED_REGISTERED_WIDGETS, SEED_SCHEMA, SEMVER, SESSION_CSV_HEADER, type SeedChunkResult, type SeedChunkWrite, type SeedManifest, type SeedMetaRecord, type SeedRow, type SessionImportRows, type StatementNode, TEMPLATE_CHUNK_ID, type TypedTagItem, VERSION, type WodWikiIRFile, applySeedChunk, assertSeedManifest, assertSeedRows, buildStatementTree, canvasRouteSlug, catalogForChunkId, composeNoteMarkdown, createIRFile, csvToEquipmentLabels, csvToSessionRows, defineLanguagePack, effortToMarkdown, emptySeedMeta, equipmentToCsv, extractNoteIdentity, extractTypedTags, getRegisteredLanguagePacks, inMemoryEventStore, injectIdentityFrontmatter, isIRFile, listLanguagePacks, markdownToEffort, parseCsvLine, readFrontmatterMeta, registerLanguagePack, seedMetaKey, seedNoteId, seedNoteSourceId, sessionToCsv, splitCsvRecords, statementToNode, unregisterLanguagePack };