@bitcobblers/wod-wiki-engine 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.cjs +3646 -112
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +479 -16
- package/dist/index.d.ts +479 -16
- package/dist/index.mjs +3403 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IDialect, EventRecord, Note, BlockRevision, BlockIndexRow, Session, AnalyticsDataPoint, StoredOutputStatement, WorkoutResults, ICodeStatement, NoteBlock, BlockEffort, BlockEquipment } from '@bitcobblers/wod-wiki-core';
|
|
1
|
+
import { IDialect, EventRecord, Note, BlockRevision, BlockIndexRow, Session, AnalyticsDataPoint, StoredOutputStatement, WorkoutResults, ICodeStatement, NoteBlock, NoteTelemetryBundleResult, NoteTelemetryBundle, BlockEffort, BlockEquipment, PublicationVisibilitySummary, NotebookId, NotebookLinkTargetKind, ResultOrigin, NoteProvenance, Tag, TagTypeRecord, TagIndex, OverridePropertyKind, ScopedPropertyOverride } from '@bitcobblers/wod-wiki-core';
|
|
2
2
|
export * from '@bitcobblers/wod-wiki-core';
|
|
3
|
-
import { IRealtimeProcessor, ISummaryProcessor, IEffort, IScript } from '@bitcobblers/wod-wiki-lang';
|
|
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, CalculationDefinition, CalculationRegistry, CardioDialect, ChildSelectionBehavior, ChildrenStrategy, ChoiceGroupMetric, ClimbDialect, ClimbMetricType, CompletionDecision, CountdownTimerBehavior, CountupTimerBehavior, CrossFitDialect, DEFAULT_RESOLVER_OPTIONS, DEFAULT_RUNTIME_OPTIONS, DEFAULT_SOUND_PROFILE, 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, MAX_TAG_CONTRIBUTION_DEPTH, MatchMode, MdTimerRuntime, MemoryEntry, MemoryLocation, MemoryTag, MemoryTypeEnum, MetricLine, MetricPresentationSurface, MetricPresentationToken, MetricRenderKind, MetricTone, MetricVisibility, MockClock, NextEvent, OutputEmitter, OutputListener, PRODUCTION_STRATEGIES, PopBlockAction, ProjectionResult, PropertyRuleInput, PropertySourceLayer, PushBlockAction, RegisterEventHandlerAction, Registry, ReportOutputBehavior, ReportOutputStrategy, ResolvedEffort, ResolvedEffortData, ResolvedTagContributions, RoundState, RoundsMetric, RuntimeAdapter, RuntimeBlock, RuntimeBlockOptions, RuntimeClock, RuntimeController, RuntimeError, RuntimeFactory, RuntimeLogger, RuntimeMemory, RuntimeObservers, RuntimeStack, RuntimeStackOptions, SEED_PRECEDENCE_RANK, SOUND_PLAY_EVENT, SOUND_PROFILE_METRIC, STORE_CALCS, STREAM_ATOMS, ScriptRuntime, ScriptRuntimeDependencies, SeedPrecedenceTier, SegmentWithMetadata, SessionRootStrategy, ShakeOutResult, SkippedDependencyDiagnostic, SnapshotClock, SoundProfile, SoundProfileBehavior, SoundRule, SoundStrategy, SoundTriggerAnchor, SoundTriggerPoint, StackEvent, StackListener, StackObserver, StackSnapshot, StackedDashboardWidgetDescriptor, StandardAnalyticsProfile, StartSessionAction, StartSessionOptions, StartWorkoutAction, StatementMetricDiff, SubscribeOptions, SubscriptionManager, TAG_MARKER_PREFIX, TestableBlockConfig, TimeSpan, TimerState, TwoPassEffortResolutionProcess, TypedMemoryReference, UNITS, UnitsDialect, UnregisterEventHandlerAction, Unsubscribe, VISIBILITY_ICONS, VISIBILITY_LABELS, Val, WhiteboardScript, WodDialect, YogaDialect, buildTooltip, bundledEfforts, calculateElapsed, canonicalizeType, collapseUnresolvedChoices, compareStatement, compileLineForm, compilePropertySummaryCalcs, compoundName, computeColumnLabel, computeLabel, createAnalyticsEngineForBlock, createCalcEngine, createCompiler, createDialectStack, createMetricPresentationPolicy, createMockClock, createParser, dedupeEntitiesByPrecedence, dialectRegistry, dialectStack, diffStatement, evaluate, extractMetrics, extractPropertyRulesFromMeta, extractStatements, extractTagPropertyRules, findBestFuzzyMatch, findTagContributionCycles, findUnresolvedChoices, formatSoundTrigger, frozenNow, getAnalyticsFromLogs, getHints, getMetricVisibility, getRuntimeNowMs, hasHint, hintMetric, hintsToContainer, isCastSubscription, isChoiceResolved, isTimeLikeMetric, isWithinThreshold, levenshteinDistance, metricPresentation, normalizeForFuzzy, outputNodeId, outputNodeIds, parseCalcLine, parseExpression, parseMetricLine, parseScript, parseSoundTrigger, realtimeProcessorRegistry, renderMetric, resolveEntityRank, resolveEntityTier, resolveProfileRules, resolvePropertyDashboardWidgets, resolveSoundProfile, resolveSourceRank, resolveSourceTier, resolveTagContributions, runMetricShakeOutQueue, strategyRegistry, summaryProcessorRegistry, tagContributionMetrics, tagMarkerSlug, tagMarkerSlugs, tagMarkerType, toStoredOutputStatement, truthy, wallClockNow, whiteboardParser, whiteboardScript, whiteboardScriptLanguage, writeChoiceSelection } from '@bitcobblers/wod-wiki-lang';
|
|
3
|
+
import { IRealtimeProcessor, ISummaryProcessor, IEffort, IScript, IEquipment, ReferenceIndex } from '@bitcobblers/wod-wiki-lang';
|
|
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, CalculationDefinition, CalculationRegistry, CardioDialect, ChildSelectionBehavior, ChildrenStrategy, ChoiceGroupMetric, ClimbDialect, ClimbMetricType, CompletionDecision, CountdownTimerBehavior, CountupTimerBehavior, CrossFitDialect, DAY, DEFAULT_RESOLVER_OPTIONS, DEFAULT_RUNTIME_OPTIONS, DEFAULT_SOUND_PROFILE, DEFAULT_UNRESOLVED_EFFORT_MET, DIM_LENGTH, DIM_MASS, DIM_TIME, DIM_ZERO, DayRollup, 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, MAX_TAG_CONTRIBUTION_DEPTH, MatchMode, MdTimerRuntime, MemoryEntry, MemoryLocation, MemoryTag, MemoryTypeEnum, MetricLine, MetricPresentationSurface, MetricPresentationToken, MetricRenderKind, MetricTone, MetricVisibility, MockClock, NextEvent, OutputEmitter, OutputListener, PRODUCTION_STRATEGIES, PopBlockAction, ProjectionResult, PropertyRuleInput, PropertySourceLayer, PushBlockAction, RegisterEventHandlerAction, Registry, ReportOutputBehavior, ReportOutputStrategy, ResolvedEffort, ResolvedEffortData, ResolvedTagContributions, RoundState, RoundsMetric, RuntimeAdapter, RuntimeBlock, RuntimeBlockOptions, RuntimeClock, RuntimeController, RuntimeError, RuntimeFactory, RuntimeLogger, RuntimeMemory, RuntimeObservers, RuntimeStack, RuntimeStackOptions, SEED_PRECEDENCE_RANK, SOUND_PLAY_EVENT, SOUND_PROFILE_METRIC, STORE_CALCS, STREAM_ATOMS, ScriptRuntime, ScriptRuntimeDependencies, SeedPrecedenceTier, SegmentWithMetadata, SessionRootStrategy, ShakeOutResult, SkippedDependencyDiagnostic, SnapshotClock, SoundProfile, SoundProfileBehavior, SoundRule, SoundStrategy, SoundTriggerAnchor, SoundTriggerPoint, StackEvent, StackListener, StackObserver, StackSnapshot, StackedDashboardWidgetDescriptor, StandardAnalyticsProfile, StartSessionAction, StartSessionOptions, StartWorkoutAction, StatementMetricDiff, SubscribeOptions, SubscriptionManager, TAG_MARKER_PREFIX, TestableBlockConfig, TimeSpan, TimerState, TwoPassEffortResolutionProcess, TypedMemoryReference, UNITS, UnitsDialect, UnregisterEventHandlerAction, Unsubscribe, VISIBILITY_ICONS, VISIBILITY_LABELS, Val, WhiteboardScript, WodDialect, YogaDialect, buildTooltip, bundledEfforts, calculateDuration, calculateElapsed, canonicalizeType, collapseUnresolvedChoices, compareStatement, compileLineForm, compilePropertySummaryCalcs, compoundName, computeColumnLabel, computeLabel, computeWorkloadRollups, createAnalyticsEngineForBlock, createCalcEngine, createCompiler, createDialectStack, createMetricPresentationPolicy, createMockClock, createParser, dailySessionLoads, dayBucket, dedupeEntitiesByPrecedence, dialectRegistry, dialectStack, diffStatement, evaluate, extractMetrics, extractPropertyRulesFromMeta, extractStatements, extractTagPropertyRules, findBestFuzzyMatch, findTagContributionCycles, findUnresolvedChoices, formatDurationCompact, formatDurationSmart, formatSecondsHHMMSS, formatSecondsMMSS, formatSoundTrigger, formatTime, formatTimeHHMMSS, formatTimeMMSS, formatTimePrecise, formatTimestamp, frozenNow, getAnalyticsFromLogs, getAnalyticsFromRuntime, getHints, getMetricVisibility, getRuntimeNowMs, hasHint, hintMetric, hintsToContainer, isCastSubscription, isChoiceResolved, isTimeLikeMetric, isWithinThreshold, levenshteinDistance, metricPresentation, normalizeForFuzzy, outputNodeId, outputNodeIds, parseCalcLine, parseExpression, parseMetricLine, parseScript, parseSoundTrigger, realtimeProcessorRegistry, renderMetric, resolveEntityRank, resolveEntityTier, resolveProfileRules, resolvePropertyDashboardWidgets, resolveSoundProfile, resolveSourceRank, resolveSourceTier, resolveTagContributions, roundToTenth, runMetricShakeOutQueue, strategyRegistry, summaryProcessorRegistry, tagContributionMetrics, tagMarkerSlug, tagMarkerSlugs, tagMarkerType, toStoredOutputStatement, truthy, wallClockNow, whiteboardParser, whiteboardScript, whiteboardScriptLanguage, writeChoiceSelection } from '@bitcobblers/wod-wiki-lang';
|
|
5
5
|
import { EventStore } from '@bitcobblers/wod-wiki-wql';
|
|
6
|
-
export { Aggregator, AnyParsedQuery, BlockQueryStore, BuildScopedDashboardOptions, ComparisonOp, DASHBOARD_GRID_MAX_COLS, DASHBOARD_WIDGET_TYPES, DEFAULT_DASHBOARD_TITLE, DEFAULT_NOTEBOOK_SLUGS, DashboardDocument, DashboardMeta, DashboardToken, DashboardWidget,
|
|
6
|
+
export { Aggregator, AnyParsedQuery, BlockQueryStore, BuildScopedDashboardOptions, ComparisonOp, DASHBOARD_GRID_MAX_COLS, DASHBOARD_WIDGET_TYPES, DEFAULT_DASHBOARD_TITLE, DEFAULT_NOTEBOOK_SLUGS, DashboardDocument, DashboardMeta, DashboardToken, DashboardWidget, EffortQueryStore, EntityScopeDescriptor, EntityScopeKind, EventStore, FeedCatalogQueryStore, FindOptions, FindPredicate, FindQueryResult, MetricPredicate, NoteQueryStore, NotebookId, PLANNED_WIDGET_TYPES, ParseQueryBlockOptions, ParsedAggregateQuery, ParsedFindQuery, ParsedPipelineQuery, ParsedRowsQuery, PipelineSink, PipelineSource, QueryBlockObject, QueryOptions, QueryResult, QuerySeriesSpec, QueryService, QueryServiceStores, QuerySortSpec, QueryViewKind, QueryWidgetSuffix, QueryWindow, ResolveEntityScopeInput, RowsQueryResult, RowsRun, ScalarOrParam, 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_TYPED_TAG_KEYS, WQL_VIRTUAL_DIMS, WqlChartHead, WqlFindTarget, WqlSourceValue, bindQueryParams, buildDashboardDocument, buildDashboardFromScope, buildDashboardScaffold, buildWidgetsForWqlScope, collectQueryBlockParams, collectQueryParams, dashboardSlug, defaultTokenValues, extractDashboardTokens, extractNoteWqlOverride, isAggregateQuery, isDashboardMeta, isDashboardWidgetType, isDefaultShorthandQueryBlock, isFindQuery, isNoteEditable, isPipelineQuery, isYamlQueryBlockBody, normalizeWql, notebookOfItem, notebookSlugFromId, notebooksOfItem, parseFilterFragment, parseQuery, parseQueryBlock, parseQueryWidgetSuffix, parseWqlSuffixes, queryBlockAttributes, queryBlockToDocumentText, resolveEntityScope, resolveWidgetType, serialize, serializeQueryBlock, serializeQueryBlockFence, splitAtWhere, substituteTokens, toNotebookId, unknownTokensMessage, unknownWidgetTypeMessage, wql, wqlLanguage, wqlParser, wqlTerms } from '@bitcobblers/wod-wiki-wql';
|
|
7
7
|
import { Session as Session$1, Note as Note$1, IStorage } from '@bitcobblers/wod-wiki-storage';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -132,17 +132,42 @@ declare const NOTE_ID_FRONTMATTER_KEY = "wod-note-id";
|
|
|
132
132
|
interface NoteIdentity {
|
|
133
133
|
noteId: string;
|
|
134
134
|
title?: string;
|
|
135
|
+
date?: string;
|
|
136
|
+
notebook?: string;
|
|
137
|
+
public?: boolean;
|
|
135
138
|
}
|
|
136
139
|
/** Read the stamped note identity from the leading frontmatter block, if any. */
|
|
137
140
|
declare function extractNoteIdentity(markdown: string): NoteIdentity | undefined;
|
|
141
|
+
declare function parseFrontmatterDateMs(raw: string | undefined): number | undefined;
|
|
138
142
|
/**
|
|
139
|
-
* Ensure the leading frontmatter carries `title` + `wod-note-id
|
|
140
|
-
*
|
|
141
|
-
*
|
|
143
|
+
* Ensure the leading frontmatter carries `title` + `wod-note-id` (and optional
|
|
144
|
+
* portable metadata: `date`, `notebook`, `public`). Existing keys are replaced
|
|
145
|
+
* in place; a missing block is prepended.
|
|
142
146
|
*/
|
|
143
147
|
declare function injectIdentityFrontmatter(markdown: string, identity: NoteIdentity): string;
|
|
144
|
-
/** Export the exact authored Note source, with identity for re-import. */
|
|
148
|
+
/** Export the exact authored Note source, with YAML frontmatter identity for re-import and Feed repositories. */
|
|
145
149
|
declare function composeNoteMarkdown(note: Note$1): string;
|
|
150
|
+
interface ParsedNoteMarkdown {
|
|
151
|
+
id?: string;
|
|
152
|
+
title: string;
|
|
153
|
+
rawContent: string;
|
|
154
|
+
date?: number;
|
|
155
|
+
notebookId?: string;
|
|
156
|
+
public?: boolean;
|
|
157
|
+
tags: string[];
|
|
158
|
+
typedTags: TypedTagItem[];
|
|
159
|
+
blocks: Record<string, NoteBlock>;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Parse canonical YAML-frontmatter or plain Markdown into a recoverable Note payload.
|
|
163
|
+
* Strips synthetic `wod-note-id` when it was injected into a frontmatter-free Note
|
|
164
|
+
* so export → import round-trips keep `rawContent` clean.
|
|
165
|
+
*/
|
|
166
|
+
declare function parseNoteMarkdown(markdown: string, options?: {
|
|
167
|
+
defaultDate?: number;
|
|
168
|
+
fallbackTitle?: string;
|
|
169
|
+
sourceRevision?: number;
|
|
170
|
+
}): ParsedNoteMarkdown;
|
|
146
171
|
interface TypedTagItem {
|
|
147
172
|
label: string;
|
|
148
173
|
type?: string;
|
|
@@ -171,7 +196,7 @@ declare function effortToMarkdown(effort: {
|
|
|
171
196
|
slug: string;
|
|
172
197
|
label: string;
|
|
173
198
|
aliases?: string[];
|
|
174
|
-
baseAttributes:
|
|
199
|
+
baseAttributes: object;
|
|
175
200
|
body?: string;
|
|
176
201
|
}): string;
|
|
177
202
|
/** Compose an equipment registry row back into corpus-style markdown (effortToMarkdown's equipment twin). */
|
|
@@ -206,18 +231,29 @@ interface SessionImportRows {
|
|
|
206
231
|
* session columns are present on the event rows.
|
|
207
232
|
*/
|
|
208
233
|
declare function csvToSessionRows(csv: string): SessionImportRows;
|
|
234
|
+
declare const TELEMETRY_CSV_HEADER: readonly ["recordKind", ...("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")[], "revisionKind", "revisionRawContent", "revisionSavedAt", "revisionDialect", "revisionSport", "parseId", "parseStage", "parseStatus", "parseDiagnosticsJson", "parseMetricsJson"];
|
|
235
|
+
/**
|
|
236
|
+
* Serialize a full `NoteTelemetryBundle` (`revisions`, `parses`, `sessions`,
|
|
237
|
+
* `events`) to CSV — lossless tabular twin of `serializeNoteBundleToJsonl`.
|
|
238
|
+
*/
|
|
239
|
+
declare function telemetryBundleToCsv(bundle: NoteTelemetryBundle): string;
|
|
240
|
+
/**
|
|
241
|
+
* Parse a `telemetryBundleToCsv` (or single-session `sessionToCsv`) CSV back
|
|
242
|
+
* into `NoteTelemetryBundleResult` — exact round-trip twin of `parseNoteBundleFromJsonl`.
|
|
243
|
+
*/
|
|
244
|
+
declare function csvToTelemetryBundle(csv: string): NoteTelemetryBundleResult;
|
|
209
245
|
|
|
210
246
|
/**
|
|
211
247
|
* Auto-generated build version metadata.
|
|
212
248
|
* Do not edit directly; updated by scripts/stamp-version.ts
|
|
213
249
|
*/
|
|
214
|
-
declare const VERSION = "0.
|
|
215
|
-
declare const GIT_SHA = "
|
|
216
|
-
declare const BUILD_TIME = "2026-11-
|
|
250
|
+
declare const VERSION = "0.53.2203";
|
|
251
|
+
declare const GIT_SHA = "522974d";
|
|
252
|
+
declare const BUILD_TIME = "2026-11-11T22:34:03.328Z";
|
|
217
253
|
declare const SEMVER: {
|
|
218
|
-
readonly version: "0.
|
|
219
|
-
readonly gitSha: "
|
|
220
|
-
readonly buildTime: "2026-11-
|
|
254
|
+
readonly version: "0.53.2203";
|
|
255
|
+
readonly gitSha: "522974d";
|
|
256
|
+
readonly buildTime: "2026-11-11T22:34:03.328Z";
|
|
221
257
|
};
|
|
222
258
|
|
|
223
259
|
declare const SEED_SCHEMA = 9;
|
|
@@ -231,6 +267,10 @@ interface SeedRow {
|
|
|
231
267
|
blockIndex: BlockIndexRow[];
|
|
232
268
|
blockEfforts: BlockEffort[];
|
|
233
269
|
blockEquipment: BlockEquipment[];
|
|
270
|
+
telemetry?: {
|
|
271
|
+
sessions: Session[];
|
|
272
|
+
events: EventRecord[];
|
|
273
|
+
};
|
|
234
274
|
commit?: string;
|
|
235
275
|
uuid?: string;
|
|
236
276
|
version?: number;
|
|
@@ -389,4 +429,427 @@ declare function assertNotebookIndex(value: unknown): NotebookIndex;
|
|
|
389
429
|
declare function assertSeedRows(value: unknown): SeedRow[];
|
|
390
430
|
declare function assertSeedRow(value: unknown): SeedRow;
|
|
391
431
|
|
|
392
|
-
|
|
432
|
+
/**
|
|
433
|
+
* Browser-side QR encoder + subscription wiring, inlined into the feed
|
|
434
|
+
* landing page (`index.html`).
|
|
435
|
+
*
|
|
436
|
+
* Two constraints shape this module:
|
|
437
|
+
*
|
|
438
|
+
* 1. The landing page is static and dependency-free — no CDN script, no
|
|
439
|
+
* reader-side build step.
|
|
440
|
+
* 2. The feed's own hosted URL is only knowable at runtime: the page knows
|
|
441
|
+
* where it is served from (`window.location`), the build does not. The
|
|
442
|
+
* subscription deep links therefore resolve in the page, not at build
|
|
443
|
+
* time.
|
|
444
|
+
*
|
|
445
|
+
* So the QR encoder ships as inline JavaScript inside the page. It is a
|
|
446
|
+
* compact, dependency-free QR implementation (byte mode, error correction
|
|
447
|
+
* level M, versions 1–20) that renders an SVG matrix.
|
|
448
|
+
*/
|
|
449
|
+
/** Canonical Wod.Wiki app origin the landing page deep-links into. */
|
|
450
|
+
declare const APP_ORIGIN = "https://wod.wiki";
|
|
451
|
+
/** Element id of the inlined script (tests and the page both key on it). */
|
|
452
|
+
declare const QR_SCRIPT_ID = "wod-feed-qr";
|
|
453
|
+
/**
|
|
454
|
+
* The inline script for the landing page. `__APP_ORIGIN__` is replaced with
|
|
455
|
+
* the app origin so the page and the build agree on one value.
|
|
456
|
+
*/
|
|
457
|
+
declare function qrInlineScript(appOrigin?: string): string;
|
|
458
|
+
|
|
459
|
+
interface LandingNote {
|
|
460
|
+
title: string;
|
|
461
|
+
path: string;
|
|
462
|
+
date?: number;
|
|
463
|
+
recordPath?: string;
|
|
464
|
+
content?: string;
|
|
465
|
+
publicSessions?: number;
|
|
466
|
+
}
|
|
467
|
+
interface LandingNotebook {
|
|
468
|
+
id: string;
|
|
469
|
+
label: string;
|
|
470
|
+
notes: LandingNote[];
|
|
471
|
+
}
|
|
472
|
+
interface FeedLandingData {
|
|
473
|
+
manifest: SeedManifest;
|
|
474
|
+
totalMs: number;
|
|
475
|
+
passMs: {
|
|
476
|
+
scan: number;
|
|
477
|
+
blockIndex: number;
|
|
478
|
+
parseGate: number;
|
|
479
|
+
blockEfforts: number;
|
|
480
|
+
write: number;
|
|
481
|
+
};
|
|
482
|
+
fileCount: number;
|
|
483
|
+
notebooks: LandingNotebook[];
|
|
484
|
+
appOrigin?: string;
|
|
485
|
+
}
|
|
486
|
+
declare function renderFeedLandingHtml(data: FeedLandingData): string;
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* FeedTree — universal path-addressed byte tree port and runtime-agnostic adapters.
|
|
490
|
+
*
|
|
491
|
+
* Unifies:
|
|
492
|
+
* - MemoryFeedTree: in-memory tests, server snapshot staging, dirty diffs
|
|
493
|
+
* - HttpFeedTree: read-only fetch over GitHub Pages, custom peer URLs, and `wod server /feed/`
|
|
494
|
+
* - DirectoryHandleFeedTree: browser File System Access folder export/import
|
|
495
|
+
*/
|
|
496
|
+
type FeedPath = string;
|
|
497
|
+
type FeedTreeErrorCode = 'not-found' | 'unsupported' | 'read-only' | 'checksum' | 'layout' | 'permission';
|
|
498
|
+
declare class FeedTreeError extends Error {
|
|
499
|
+
readonly code: FeedTreeErrorCode;
|
|
500
|
+
constructor(code: FeedTreeErrorCode, message: string);
|
|
501
|
+
}
|
|
502
|
+
interface FeedFileStat {
|
|
503
|
+
bytes: number;
|
|
504
|
+
sha256?: string;
|
|
505
|
+
}
|
|
506
|
+
interface FeedTreeReader {
|
|
507
|
+
read(path: FeedPath): Promise<Uint8Array>;
|
|
508
|
+
stat(path: FeedPath): Promise<FeedFileStat | undefined>;
|
|
509
|
+
list?(prefix?: string): Promise<FeedPath[]>;
|
|
510
|
+
}
|
|
511
|
+
interface FeedTreeWriter {
|
|
512
|
+
write(path: FeedPath, bytes: Uint8Array): Promise<void>;
|
|
513
|
+
delete(path: FeedPath): Promise<void>;
|
|
514
|
+
}
|
|
515
|
+
interface FeedTree extends FeedTreeReader, FeedTreeWriter {
|
|
516
|
+
}
|
|
517
|
+
declare function encodeUtf8(text: string): Uint8Array;
|
|
518
|
+
declare function decodeUtf8(bytes: Uint8Array): string;
|
|
519
|
+
declare function normalizeFeedTreePath(rawPath: string): FeedPath;
|
|
520
|
+
declare function sha256HexAsync(input: Uint8Array | string): Promise<string>;
|
|
521
|
+
declare class MemoryFeedTree implements FeedTree {
|
|
522
|
+
private readonly store;
|
|
523
|
+
constructor(initial?: Readonly<Record<string, string | Uint8Array>>);
|
|
524
|
+
read(path: FeedPath): Promise<Uint8Array>;
|
|
525
|
+
readText(path: FeedPath): Promise<string>;
|
|
526
|
+
stat(path: FeedPath): Promise<FeedFileStat | undefined>;
|
|
527
|
+
write(path: FeedPath, bytes: Uint8Array): Promise<void>;
|
|
528
|
+
writeText(path: FeedPath, text: string): Promise<void>;
|
|
529
|
+
delete(path: FeedPath): Promise<void>;
|
|
530
|
+
list(prefix?: string): Promise<FeedPath[]>;
|
|
531
|
+
entries(): Array<[FeedPath, Uint8Array]>;
|
|
532
|
+
}
|
|
533
|
+
type FetchLike = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
534
|
+
declare class HttpFeedTree implements FeedTreeReader {
|
|
535
|
+
private readonly baseUrl;
|
|
536
|
+
private readonly fetchImpl;
|
|
537
|
+
constructor(baseUrl: string, fetchImpl?: FetchLike);
|
|
538
|
+
read(path: FeedPath): Promise<Uint8Array>;
|
|
539
|
+
readJson<T = unknown>(path: FeedPath): Promise<T>;
|
|
540
|
+
stat(path: FeedPath): Promise<FeedFileStat | undefined>;
|
|
541
|
+
}
|
|
542
|
+
/** Structural subset of the Web File System Access API so non-DOM builds need no ambient DOM types. */
|
|
543
|
+
interface FileSystemWritableLike {
|
|
544
|
+
write(data: Uint8Array): Promise<void>;
|
|
545
|
+
close(): Promise<void>;
|
|
546
|
+
}
|
|
547
|
+
interface FileSystemFileHandleLike {
|
|
548
|
+
readonly kind: 'file';
|
|
549
|
+
readonly name: string;
|
|
550
|
+
getFile(): Promise<{
|
|
551
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
552
|
+
size: number;
|
|
553
|
+
}>;
|
|
554
|
+
createWritable(): Promise<FileSystemWritableLike>;
|
|
555
|
+
}
|
|
556
|
+
interface FileSystemDirectoryHandleLike {
|
|
557
|
+
readonly kind: 'directory';
|
|
558
|
+
readonly name: string;
|
|
559
|
+
getDirectoryHandle(name: string, options?: {
|
|
560
|
+
create?: boolean;
|
|
561
|
+
}): Promise<FileSystemDirectoryHandleLike>;
|
|
562
|
+
getFileHandle(name: string, options?: {
|
|
563
|
+
create?: boolean;
|
|
564
|
+
}): Promise<FileSystemFileHandleLike>;
|
|
565
|
+
removeEntry(name: string, options?: {
|
|
566
|
+
recursive?: boolean;
|
|
567
|
+
}): Promise<void>;
|
|
568
|
+
}
|
|
569
|
+
declare class DirectoryHandleFeedTree implements FeedTree {
|
|
570
|
+
private readonly root;
|
|
571
|
+
constructor(root: FileSystemDirectoryHandleLike);
|
|
572
|
+
private resolveDir;
|
|
573
|
+
read(path: FeedPath): Promise<Uint8Array>;
|
|
574
|
+
stat(path: FeedPath): Promise<FeedFileStat | undefined>;
|
|
575
|
+
write(path: FeedPath, bytes: Uint8Array): Promise<void>;
|
|
576
|
+
delete(path: FeedPath): Promise<void>;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
/**
|
|
580
|
+
* FeedPublisher — runtime-agnostic compiler from IStorage to any FeedTree.
|
|
581
|
+
*
|
|
582
|
+
* Powers both:
|
|
583
|
+
* 1. Self-hosted `wod server` (`layout: 'feed'` → `/feed/*` + dirty-check status)
|
|
584
|
+
* 2. Non-self-hosted Browser IndexedDB export (`layout: 'repository'` → complete
|
|
585
|
+
* `wod-wiki-feed-repository` with `markdown/notebooks/<slug>/*.md`, companion
|
|
586
|
+
* `.jsonl` for `Session.public === true`, referenced user Property Notes,
|
|
587
|
+
* GitHub Actions workflow, AND pre-compiled `dist/` Seed artifacts).
|
|
588
|
+
* 3. CLI `wod publish` (replacing the incomplete `cli/publish.ts` fork).
|
|
589
|
+
*/
|
|
590
|
+
|
|
591
|
+
declare const PUBLISHED_FEED_META_KEY = "publish:local-feed";
|
|
592
|
+
interface PublishedFeedCheckpoint {
|
|
593
|
+
key: typeof PUBLISHED_FEED_META_KEY;
|
|
594
|
+
version: number;
|
|
595
|
+
builtAt: string;
|
|
596
|
+
manifestSha256: string;
|
|
597
|
+
chunkShas: Record<string, string>;
|
|
598
|
+
}
|
|
599
|
+
interface PublishFeedOptions {
|
|
600
|
+
/**
|
|
601
|
+
* 'feed' writes `manifest.json`, `indexes/`, `chunks/`, `markdown/`, and `index.html`
|
|
602
|
+
* directly at the tree root (used by `wod server /feed/*` and `wod publish`).
|
|
603
|
+
* 'repository' writes a ready-to-push `wod-wiki-feed-repository` at the tree root
|
|
604
|
+
* (`markdown/`, `package.json`, `.github/workflows/publish-feed.yml`, `README.md`)
|
|
605
|
+
* AND writes the compiled static feed under `dist/`.
|
|
606
|
+
*/
|
|
607
|
+
layout?: 'feed' | 'repository';
|
|
608
|
+
/** Optional single notebook slug filter (`wod publish <slug>`). */
|
|
609
|
+
notebookSlug?: string;
|
|
610
|
+
/** Explicit manifest version override; defaults to monotonic checkpoint version + 1. */
|
|
611
|
+
version?: number;
|
|
612
|
+
/** Feed display metadata. */
|
|
613
|
+
name?: string;
|
|
614
|
+
description?: string;
|
|
615
|
+
repositoryUrl?: string;
|
|
616
|
+
/** Includeall user-owned notebooks even when `public` is not set (explicit CLI single-notebook publish). */
|
|
617
|
+
includePrivateWhenFiltered?: boolean;
|
|
618
|
+
/** Fixed ISO timestamp for deterministic dirty-checking. */
|
|
619
|
+
builtAt?: string;
|
|
620
|
+
/** Update the storage checkpoint (`publish:local-feed`) on completion (default true when layout === 'feed'). */
|
|
621
|
+
recordCheckpoint?: boolean;
|
|
622
|
+
}
|
|
623
|
+
interface PublishFeedReport {
|
|
624
|
+
manifest: SeedManifest;
|
|
625
|
+
notebooks: string[];
|
|
626
|
+
totalNotes: number;
|
|
627
|
+
totalPublicSessions: number;
|
|
628
|
+
manifestSha256: string;
|
|
629
|
+
}
|
|
630
|
+
interface UnpublishedFeedStatus {
|
|
631
|
+
hasPublicContent: boolean;
|
|
632
|
+
publishedVersion: number | null;
|
|
633
|
+
builtAt: string | null;
|
|
634
|
+
dirty: boolean;
|
|
635
|
+
publicNotebooks: number;
|
|
636
|
+
publicNotes: number;
|
|
637
|
+
publicSessions: number;
|
|
638
|
+
changes: Array<{
|
|
639
|
+
notebookId: string;
|
|
640
|
+
status: 'added' | 'modified' | 'removed';
|
|
641
|
+
}>;
|
|
642
|
+
}
|
|
643
|
+
declare function publishFeedFromStorage(storage: IStorage, tree: FeedTree, options?: PublishFeedOptions): Promise<PublishFeedReport>;
|
|
644
|
+
/**
|
|
645
|
+
* Compare current public Notebooks & public Sessions in `storage` against the last
|
|
646
|
+
* published snapshot (`currentTree` or stored `publish:local-feed` checkpoint)
|
|
647
|
+
* to surface "Unpublished changes" without mutating storage.
|
|
648
|
+
*/
|
|
649
|
+
declare function checkUnpublishedFeedChanges(storage: IStorage, currentTree?: FeedTreeReader, options?: PublishFeedOptions): Promise<UnpublishedFeedStatus>;
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* VaultIngestor & PublicationManager — transactional Note/Telemetry ingestion,
|
|
653
|
+
* zero-import remote preview, single-Note cloning, and Publication Visibility
|
|
654
|
+
* controls over IStorage.
|
|
655
|
+
*/
|
|
656
|
+
|
|
657
|
+
declare function getNotePublicationSummary(storage: IStorage, noteId: string): Promise<PublicationVisibilitySummary>;
|
|
658
|
+
declare function setNotebookPublic(storage: IStorage, notebookIdOrSlug: string, isPublic: boolean): Promise<Note>;
|
|
659
|
+
declare function setSessionPublic(storage: IStorage, sessionId: string, isPublic: boolean): Promise<Session>;
|
|
660
|
+
declare function previewRemoteNotebook(reader: FeedTreeReader, indexPath: string): Promise<NotebookIndex>;
|
|
661
|
+
declare function previewRemoteRecord(reader: FeedTreeReader, recordPath: string): Promise<SeedRow>;
|
|
662
|
+
declare function cloneRemoteRecord(storage: IStorage, reader: FeedTreeReader, input: {
|
|
663
|
+
feedId: string;
|
|
664
|
+
record: SeedRecordRef;
|
|
665
|
+
targetNotebookId: string;
|
|
666
|
+
includePublicTelemetry?: boolean;
|
|
667
|
+
}): Promise<Note>;
|
|
668
|
+
interface PortableFileEntry {
|
|
669
|
+
path: string;
|
|
670
|
+
content: string;
|
|
671
|
+
}
|
|
672
|
+
interface PortabilityImportReport {
|
|
673
|
+
notesImported: number;
|
|
674
|
+
revisionsImported: number;
|
|
675
|
+
sessionsImported: number;
|
|
676
|
+
eventsImported: number;
|
|
677
|
+
errors: string[];
|
|
678
|
+
}
|
|
679
|
+
declare function exportPortableFilesFromStorage(storage: IStorage, options?: {
|
|
680
|
+
noteIds?: readonly string[];
|
|
681
|
+
telemetryFormat?: 'jsonl' | 'csv' | 'both';
|
|
682
|
+
}): Promise<PortableFileEntry[]>;
|
|
683
|
+
declare function ingestPortableFilesIntoStorage(storage: IStorage, files: readonly PortableFileEntry[], options?: {
|
|
684
|
+
defaultNotebookId?: string;
|
|
685
|
+
now?: number;
|
|
686
|
+
}): Promise<PortabilityImportReport>;
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* NotebookMembership — Deep module owning many-to-many Note and Session
|
|
690
|
+
* membership across Notebooks (`notebook_links` store + synchronized
|
|
691
|
+
* `Note.notebookIds` and `Session.notebookIds` projections).
|
|
692
|
+
*
|
|
693
|
+
* Invariants:
|
|
694
|
+
* 1. `notebook/journal` is the permanent private container tracking every
|
|
695
|
+
* user-owned Note and Session created in the application. User Notes
|
|
696
|
+
* promoted to one or more user Notebooks NEVER lose `notebook/journal`
|
|
697
|
+
* membership.
|
|
698
|
+
* 2. Read-only system Notebooks (`notebook/defaults`, `notebook/guides`,
|
|
699
|
+
* `notebook/efforts`, `notebook/equipment`, `notebook/dashboards`) and
|
|
700
|
+
* feed-delivered Notebooks (`origin: 'feed'`) reject user Note membership
|
|
701
|
+
* mutations.
|
|
702
|
+
* 3. Non-publishable Notebooks (`journal`, `playground`, `defaults`,
|
|
703
|
+
* `custom`, `guides`, `efforts`, `equipment`, `dashboards`) can never be
|
|
704
|
+
* marked `public`.
|
|
705
|
+
*/
|
|
706
|
+
|
|
707
|
+
declare function makeNotebookLinkId(notebookId: NotebookId, targetKind: NotebookLinkTargetKind, targetId: string): string;
|
|
708
|
+
declare function createUserNotebookLanding(storage: IStorage, rawName: string): Promise<NotebookId>;
|
|
709
|
+
interface PromoteNoteToNotebooksInput {
|
|
710
|
+
noteId: string;
|
|
711
|
+
/** Target user Notebooks to link this Note (and optional Sessions) into. */
|
|
712
|
+
notebookIds: readonly string[];
|
|
713
|
+
/** Optional subset of attached Session IDs on this Note to promote alongside it. */
|
|
714
|
+
sessionIds?: readonly string[];
|
|
715
|
+
/** When true, marks the promoted `sessionIds` as `public: true` for Feed publication. */
|
|
716
|
+
shareSessionsPublicly?: boolean;
|
|
717
|
+
}
|
|
718
|
+
interface PromoteNoteResult {
|
|
719
|
+
note: Note;
|
|
720
|
+
notebookIds: NotebookId[];
|
|
721
|
+
promotedSessionIds: string[];
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* Promote a Note (Journal, Playground, or regular user Note) and optional
|
|
725
|
+
* attached Sessions into one or more user Notebooks without evicting the Note
|
|
726
|
+
* from `notebook/journal`.
|
|
727
|
+
*/
|
|
728
|
+
declare function promoteNoteToNotebooks(storage: IStorage, input: PromoteNoteToNotebooksInput): Promise<PromoteNoteResult>;
|
|
729
|
+
/**
|
|
730
|
+
* Replace the exact set of user Notebooks a Note is promoted to while keeping
|
|
731
|
+
* its mandatory `notebook/journal` (and `notebook/playground`, if applicable)
|
|
732
|
+
* anchor intact.
|
|
733
|
+
*/
|
|
734
|
+
declare function setNoteNotebooks(storage: IStorage, input: {
|
|
735
|
+
noteId: string;
|
|
736
|
+
notebookIds: readonly string[];
|
|
737
|
+
}): Promise<NotebookId[]>;
|
|
738
|
+
/**
|
|
739
|
+
* Detach a Note from one promoted user Notebook. Refuses detaching a user Note
|
|
740
|
+
* from `notebook/journal`, which permanently tracks all created Notes.
|
|
741
|
+
*/
|
|
742
|
+
declare function removeNoteFromNotebook(storage: IStorage, noteId: string, notebookIdOrSlug: string): Promise<NotebookId[]>;
|
|
743
|
+
/**
|
|
744
|
+
* Resolve all Notebooks currently linked to a Note across `notebook_links` and
|
|
745
|
+
* the Note's persisted membership fields.
|
|
746
|
+
*/
|
|
747
|
+
declare function getNoteNotebooks(storage: IStorage, noteId: string): Promise<NotebookId[]>;
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* JournalSessionIntake — Deep module owning read-only workout cloning into
|
|
751
|
+
* `notebook/journal`, atomic Session pinning, and upstream Note provenance
|
|
752
|
+
* resolution.
|
|
753
|
+
*
|
|
754
|
+
* When a workout is started on ANY read-only Note (`seedOrigin === 'seed'`,
|
|
755
|
+
* `feedOrigin === 'feed'`, `notebook/defaults`, `notebook/guides`, or a
|
|
756
|
+
* subscribed Feed Notebook), this module atomically:
|
|
757
|
+
* 1. Clones the full Note (Markdown prose, frontmatter, all workout & widget
|
|
758
|
+
* blocks, and immutable `BlockRevision`s) into `notebook/journal`,
|
|
759
|
+
* 2. Places the cloned Note onto the requested calendar `Page` (`YYYY-MM-DD`),
|
|
760
|
+
* 3. Records structured `NoteProvenance` (`sourceNoteId`, `sourceVersion`,
|
|
761
|
+
* `sourceCommit`, `feedSourceId`, `sourceNotebookId`, `sourcePath`),
|
|
762
|
+
* 4. Pins the new `Session` to the corresponding block occurrence on the
|
|
763
|
+
* Journal clone — leaving the read-only upstream Note untouched.
|
|
764
|
+
*/
|
|
765
|
+
|
|
766
|
+
interface PrepareJournalSessionRunInput {
|
|
767
|
+
noteId: string;
|
|
768
|
+
blockId?: string;
|
|
769
|
+
sessionId?: string;
|
|
770
|
+
journalDate?: string;
|
|
771
|
+
startedAt?: number;
|
|
772
|
+
origin?: ResultOrigin;
|
|
773
|
+
}
|
|
774
|
+
interface PreparedJournalSessionRun {
|
|
775
|
+
note: Note;
|
|
776
|
+
revision: BlockRevision;
|
|
777
|
+
session: Session;
|
|
778
|
+
clonedFromReadOnly: boolean;
|
|
779
|
+
upstreamNoteId?: string;
|
|
780
|
+
}
|
|
781
|
+
interface ResolvedUpstreamProvenance {
|
|
782
|
+
exists: boolean;
|
|
783
|
+
sourceNoteId: string;
|
|
784
|
+
title?: string;
|
|
785
|
+
sourceVersion?: number;
|
|
786
|
+
currentUpstreamVersion?: number;
|
|
787
|
+
sourceCommit?: string;
|
|
788
|
+
feedSourceId?: string;
|
|
789
|
+
sourceNotebookId?: string;
|
|
790
|
+
sourcePath?: string;
|
|
791
|
+
}
|
|
792
|
+
declare function prepareJournalSessionRun(storage: IStorage, input: PrepareJournalSessionRunInput): Promise<PreparedJournalSessionRun>;
|
|
793
|
+
/**
|
|
794
|
+
* Resolve a cloned Note's upstream provenance against current storage.
|
|
795
|
+
* Returns `exists: true` while the original Note remains in storage (so UI can
|
|
796
|
+
* link directly to it), and `exists: false` with preserved metadata if the
|
|
797
|
+
* upstream Feed was later unsubscribed or removed.
|
|
798
|
+
*/
|
|
799
|
+
declare function resolveUpstreamProvenance(storage: IStorage, note: Pick<Note, 'provenance' | 'sourceId'>): Promise<ResolvedUpstreamProvenance | null>;
|
|
800
|
+
declare function buildNoteProvenance(sourceNote: Pick<Note, 'id' | 'seedVersion' | 'sourceRevision' | 'seedCommit' | 'feedSourceId' | 'sourcePath'>, sourceNotebookId: string | undefined, clonedAt: number): NoteProvenance;
|
|
801
|
+
|
|
802
|
+
/**
|
|
803
|
+
* ScopedPropertyInheritance — Deep module owning Property Note override storage,
|
|
804
|
+
* Notebook-scoped inheritance (`notebook/defaults` -> subscribed Feed or user
|
|
805
|
+
* Notebook overrides -> `notebook/custom` overrides), runtime vs shared
|
|
806
|
+
* Notebook target selection, and automatic override promotion upon publishing.
|
|
807
|
+
*/
|
|
808
|
+
|
|
809
|
+
type PropertyInheritanceMode = 'source-first' | 'custom-runtime';
|
|
810
|
+
interface SaveScopedPropertyOverrideInput {
|
|
811
|
+
/** Target Notebook scope: `'notebook/custom'` (personal runtime) or `'notebook/<user-slug>'` (shared user Notebook). */
|
|
812
|
+
targetNotebookId: string;
|
|
813
|
+
kind: OverridePropertyKind;
|
|
814
|
+
/** Canonical slug — preserved verbatim (no `-custom` suffixing required). */
|
|
815
|
+
slug: string;
|
|
816
|
+
rawContent: string;
|
|
817
|
+
title?: string;
|
|
818
|
+
category?: string;
|
|
819
|
+
}
|
|
820
|
+
interface PropertyResolutionContext {
|
|
821
|
+
note?: Pick<Note, 'id' | 'notebookId' | 'notebookIds' | 'provenance' | 'feedSourceId' | 'sourceId' | 'sourcePath'>;
|
|
822
|
+
notebookId?: string;
|
|
823
|
+
mode?: PropertyInheritanceMode;
|
|
824
|
+
}
|
|
825
|
+
interface ResolvedScopedCatalog {
|
|
826
|
+
efforts: IEffort[];
|
|
827
|
+
equipment: IEquipment[];
|
|
828
|
+
tags: Tag[];
|
|
829
|
+
tagTypes: TagTypeRecord[];
|
|
830
|
+
referenceIndex: ReferenceIndex;
|
|
831
|
+
tagIndex: TagIndex;
|
|
832
|
+
/** Maps `${kind}:${slug}` -> winning scope identifier (`'notebook/defaults'`, `'notebook/custom'`, or `'notebook/<slug>'`). */
|
|
833
|
+
originByKey: Map<string, string>;
|
|
834
|
+
}
|
|
835
|
+
declare function makeScopedOverrideId(notebookId: string, kind: OverridePropertyKind, slug: string): string;
|
|
836
|
+
declare function saveScopedPropertyOverride(storage: IStorage, input: SaveScopedPropertyOverrideInput): Promise<ScopedPropertyOverride>;
|
|
837
|
+
declare function listScopedPropertyOverrides(storage: IStorage, filter?: {
|
|
838
|
+
notebookId?: string;
|
|
839
|
+
kind?: OverridePropertyKind;
|
|
840
|
+
slug?: string;
|
|
841
|
+
}): Promise<ScopedPropertyOverride[]>;
|
|
842
|
+
declare function resolveScopedPropertyCatalog(storage: IStorage, context?: PropertyResolutionContext): Promise<ResolvedScopedCatalog>;
|
|
843
|
+
/**
|
|
844
|
+
* Promote any `notebook/custom` Property Note overrides referenced by a
|
|
845
|
+
* publishable user Notebook directly into that Notebook's `property_overrides`
|
|
846
|
+
* scope, returning the Notebook's complete override rows for Feed emission.
|
|
847
|
+
*/
|
|
848
|
+
declare function promoteReferencedOverridesToNotebook(storage: IStorage, input: {
|
|
849
|
+
notebookId: string;
|
|
850
|
+
effortSlugs?: Iterable<string>;
|
|
851
|
+
equipmentSlugs?: Iterable<string>;
|
|
852
|
+
tagSlugs?: Iterable<string>;
|
|
853
|
+
}): Promise<ScopedPropertyOverride[]>;
|
|
854
|
+
|
|
855
|
+
export { APP_ORIGIN, BUILD_TIME, CANVAS_CHUNK_ID, type ChunkKind, type CorpusIRData, DASHBOARDS_CHUNK_ID, DirectoryHandleFeedTree, EFFORTS_CHUNK_ID, EQUIPMENT_CHUNK_ID, type ExecutionLog, type FeedFileStat, type FeedLandingData, type FeedPath, type FeedTree, FeedTreeError, type FeedTreeErrorCode, type FeedTreeReader, type FeedTreeWriter, type FetchLike, type FileSystemDirectoryHandleLike, type FileSystemFileHandleLike, type FileSystemWritableLike, GIT_SHA, HttpFeedTree, type IrKind, type LandingNote, type LandingNotebook, type LanguagePack, type LanguagePackIdentity, type LanguagePackLangSlice, type LanguagePackUiSlice, type ManifestChunk, MemoryFeedTree, type MetricNode, NOTE_ID_FRONTMATTER_KEY, type NoteIdentity, type NotebookIndex, type NotebookIndexSummary, PUBLISHED_FEED_META_KEY, type ParsedNoteMarkdown, type PortabilityImportReport, type PortableFileEntry, type PrepareJournalSessionRunInput, type PreparedJournalSessionRun, type PromoteNoteResult, type PromoteNoteToNotebooksInput, type PropertyInheritanceMode, type PropertyResolutionContext, type PublishFeedOptions, type PublishFeedReport, type PublishedFeedCheckpoint, QR_SCRIPT_ID, type ResolvedScopedCatalog, type ResolvedUpstreamProvenance, SEED_BROADCAST_CHANNEL, SEED_NAMESPACE, SEED_REGISTERED_WIDGETS, SEED_SCHEMA, SEMVER, SESSION_CSV_HEADER, type SaveScopedPropertyOverrideInput, type SeedChunkResult, type SeedChunkWrite, type SeedManifest, type SeedMetaRecord, type SeedRecordRef, type SeedRow, type SessionImportRows, type StatementNode, TELEMETRY_CSV_HEADER, type TypedTagItem, type UnpublishedFeedStatus, VERSION, type WodWikiIRFile, applySeedChunk, assertNotebookIndex, assertSeedManifest, assertSeedRow, assertSeedRows, backfillFeedProvenance, buildNoteProvenance, buildStatementTree, canvasRouteSlug, checkUnpublishedFeedChanges, cloneRemoteRecord, composeNoteMarkdown, createIRFile, createUserNotebookLanding, csvToEquipmentLabels, csvToSessionRows, csvToTelemetryBundle, decodeUtf8, defineLanguagePack, effortToMarkdown, emptySeedMeta, encodeUtf8, equipmentToCsv, equipmentToMarkdown, exportPortableFilesFromStorage, extractNoteIdentity, extractTypedTags, feedIdOfMetaKey, getNoteNotebooks, getNotePublicationSummary, getRegisteredLanguagePacks, inMemoryEventStore, ingestPortableFilesIntoStorage, injectIdentityFrontmatter, isIRFile, listLanguagePacks, listScopedPropertyOverrides, makeNotebookLinkId, makeScopedOverrideId, migrateNotebookVocabulary, normalizeFeedTreePath, notebookSlugForChunkId, parseCsvLine, parseFrontmatterDateMs, parseNoteMarkdown, prepareJournalSessionRun, previewRemoteNotebook, previewRemoteRecord, promoteNoteToNotebooks, promoteReferencedOverridesToNotebook, publishFeedFromStorage, qrInlineScript, readFrontmatterMeta, registerLanguagePack, removeNoteFromNotebook, renderFeedLandingHtml, resolveScopedPropertyCatalog, resolveUpstreamProvenance, saveScopedPropertyOverride, seedMetaKey, seedNoteId, seedNoteSourceId, seedPrecedenceRank, seedSourceTier, sessionToCsv, setNoteNotebooks, setNotebookPublic, setSessionPublic, sha256HexAsync, splitCsvRecords, statementToNode, telemetryBundleToCsv, unregisterLanguagePack };
|