@bitcobblers/wod-wiki-core 0.43.2153 → 0.44.2155

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
@@ -933,6 +933,123 @@ interface Segment {
933
933
  metrics?: MetricContainer;
934
934
  }
935
935
 
936
+ /**
937
+ * Tags — named bundles a script can reference.
938
+ *
939
+ * A script line points at a tag instead of repeating what the tag means:
940
+ *
941
+ * ```text
942
+ * 5 reps @ 100 kg #heavy
943
+ * ```
944
+ *
945
+ * A tag contributes three kinds of thing to the statements that reference
946
+ * it:
947
+ *
948
+ * - a **metric** — a typed value with a unit (the meaning of the line),
949
+ * - a **tag** — another tag, so a tag can build on a tag,
950
+ * - a **function** — a named calculation the tag activates where it applies.
951
+ *
952
+ * The model lives in core because both the parser (which resolves
953
+ * `#slug` references) and the runtime (which runs the functions a tag
954
+ * carries) need it, and neither should know how tags are stored.
955
+ */
956
+ /** A metric a tag contributes: a typed value with an optional unit. */
957
+ interface TagMetricContribution {
958
+ readonly kind: 'metric';
959
+ /** The metric type, e.g. `sound` or `rpe`. */
960
+ readonly type: string;
961
+ /** The metric's value. */
962
+ readonly value: string | number | boolean | null;
963
+ /** The unit the value is expressed in, when it has one. */
964
+ readonly unit?: string;
965
+ }
966
+ /** Another tag this tag applies. */
967
+ interface TagTagContribution {
968
+ readonly kind: 'tag';
969
+ /** The slug of the applied tag. */
970
+ readonly slug: string;
971
+ }
972
+ /** A named function this tag carries. */
973
+ interface TagFunctionContribution {
974
+ readonly kind: 'function';
975
+ /**
976
+ * The function's name — the id of the calculation it refers to. The
977
+ * calculation's own scope decides the grain it runs at: `segment` per
978
+ * record, `workout` at the end of the workout.
979
+ */
980
+ readonly name: string;
981
+ }
982
+ /** What a tag contributes. */
983
+ type TagContribution = TagMetricContribution | TagTagContribution | TagFunctionContribution;
984
+ /** A tag and what it contributes. */
985
+ interface TagDefinition {
986
+ /** The slug a script references: `#slug`. */
987
+ readonly slug: string;
988
+ /** What the tag contributes when referenced. */
989
+ readonly contributions: readonly TagContribution[];
990
+ }
991
+ /** A slug → tag lookup. */
992
+ interface TagIndex {
993
+ /**
994
+ * The tag with this slug, or `undefined` when the catalogue has no such
995
+ * tag.
996
+ */
997
+ resolve(slug: string): TagDefinition | undefined;
998
+ /** Every tag in the index. */
999
+ list(): readonly TagDefinition[];
1000
+ }
1001
+ /**
1002
+ * A host-supplied source of tags.
1003
+ *
1004
+ * The language never reads storage: the host loads its tags and hands the
1005
+ * language a {@link TagIndex}. A host implements this to feed the parser a
1006
+ * database-configured catalogue.
1007
+ */
1008
+ interface ITagSource {
1009
+ /** Load every tag the host knows about. */
1010
+ loadTags(): Promise<readonly TagDefinition[]>;
1011
+ }
1012
+ /**
1013
+ * Build a tag index from tag definitions.
1014
+ *
1015
+ * Later definitions of the same slug win, matching how the app layers
1016
+ * user-defined tags over seeded ones.
1017
+ */
1018
+ declare function createTagIndex(tags: readonly TagDefinition[]): TagIndex;
1019
+
1020
+ /**
1021
+ * Tag references — the tag a metric came from.
1022
+ *
1023
+ * A script line can point at a tag (`5 reps @ 100 kg #heavy`), and the tag
1024
+ * brings metrics, other tags and functions. The metrics it brings record
1025
+ * where they came from, so the editor can show the tag, link to it, and the
1026
+ * compiler can compose what the block used.
1027
+ *
1028
+ * Pure data: survives the stored-logs / JSON round-trip.
1029
+ */
1030
+ /** A tag reference: the tag, what it carries, and what it names. */
1031
+ interface TagReferenceMetadata {
1032
+ /** The tag's slug — what `#slug` refers to. */
1033
+ slug: string;
1034
+ /** The tag's display label (its slug, for now). */
1035
+ label: string;
1036
+ /** The functions the tag carries — named calculations it activates. */
1037
+ functions?: readonly string[];
1038
+ /**
1039
+ * The sound profile the tag selects, when it names one. A tag that carries
1040
+ * a sound metric points at the profile that metric names.
1041
+ */
1042
+ soundProfileId?: string;
1043
+ }
1044
+ /** Metadata key under which {@link TagReferenceMetadata} is stored on a metric. */
1045
+ declare const TAG_REFERENCE_METADATA_KEY = "tagReference";
1046
+ /**
1047
+ * Read the tag reference off a metric's metadata. Validates shape before
1048
+ * trusting persisted input: an unknown-shape payload is ignored rather than
1049
+ * partially honored.
1050
+ */
1051
+ declare function getTagReference(metadata: Record<string, unknown> | undefined): TagReferenceMetadata | undefined;
1052
+
936
1053
  /** Cross-note fingerprint of the trimmed, unfenced workout body. Never an occurrence ID. */
937
1054
  declare function blockContentId(content: string): string;
938
1055
 
@@ -1041,6 +1158,8 @@ interface Note {
1041
1158
  seedChunkId?: string;
1042
1159
  /** Authored seed path used for deterministic identity and routing. */
1043
1160
  sourcePath?: string;
1161
+ /** Git commit hash in which this note was published or changed. */
1162
+ seedCommit?: string;
1044
1163
  }
1045
1164
  interface Page {
1046
1165
  id: string;
@@ -1064,10 +1183,21 @@ interface TagTypeRecord {
1064
1183
  color?: string;
1065
1184
  createdAt: number;
1066
1185
  }
1186
+ /**
1187
+ * A tag: a named bundle a script can reference with `#slug`.
1188
+ *
1189
+ * Keeping the contributions on the tag means the meaning lives in one place
1190
+ * instead of being repeated on every line that wants the tag.
1191
+ */
1067
1192
  interface Tag {
1068
1193
  id: string;
1069
1194
  label: string;
1070
1195
  type?: TagType;
1196
+ /**
1197
+ * What this tag contributes when referenced from script content: metrics,
1198
+ * other tags, and functions.
1199
+ */
1200
+ contributions?: TagContribution[];
1071
1201
  createdAt: number;
1072
1202
  }
1073
1203
  interface NoteTag {
@@ -1629,13 +1759,13 @@ declare function patchFrontmatterProperty(raw: string, path: readonly string[],
1629
1759
  * Auto-generated build version metadata.
1630
1760
  * Do not edit directly; updated by scripts/stamp-version.ts
1631
1761
  */
1632
- declare const VERSION = "0.43.2153";
1633
- declare const GIT_SHA = "3bb3096";
1634
- declare const BUILD_TIME = "2026-10-22T21:06:18.747Z";
1762
+ declare const VERSION = "0.44.2155";
1763
+ declare const GIT_SHA = "6807397";
1764
+ declare const BUILD_TIME = "2026-10-24T03:58:47.392Z";
1635
1765
  declare const SEMVER: {
1636
- readonly version: "0.43.2153";
1637
- readonly gitSha: "3bb3096";
1638
- readonly buildTime: "2026-10-22T21:06:18.747Z";
1766
+ readonly version: "0.44.2155";
1767
+ readonly gitSha: "6807397";
1768
+ readonly buildTime: "2026-10-24T03:58:47.392Z";
1639
1769
  };
1640
1770
 
1641
- export { type AnalyticsDataPoint, type AnalyticsGraphConfig, type AnalyticsGroup, type Attachment, BUILD_TIME, type BlockEffort, type BlockEquipment, type BlockIndexRow, BlockKey, type BlockRevision, type CatalogBackfillState, CodeMetadata, CodeStatement, DEFAULT_NOTEBOOK_SLUGS, type DefaultNotebookSlug, type DialectAnalysis, type DimensionKey, type DisplayStatus, type EventGrain, type EventRecord, type FenceDialect, type FieldCatalogEntry, type FieldContribution, type FieldLeaf, type FieldRef, type FieldSourceRecord, type FieldValueKind, type FieldValueRecord, type FrontMatterSubtype, type FrontmatterPatchValue, GIT_SHA, type IBlockKey, type ICodeMetadata, type ICodeStatement, type IDialect, type IDialectTagDescriptor, type IMetric, type IMetricOwnershipResolver, type IMetricSource, type IOutputStatement, type IScript, KNOWN_OUTPUT_TYPES, KNOWN_SECTION_WIDGETS, LEGACY_ORIGIN_TO_OWNERSHIP_LAYER, METRIC_OWNERSHIP_LAYER_CHAIN, type Membership, Metric, type MetricAction, MetricContainer, type MetricFilter, type MetricOrigin, type MetricOwnershipLayer, type MetricOwnershipLedger, type MetricOwnershipOutcome, type MetricOwnershipPromotionCandidate, type MetricOwnershipQuery, type MetricOwnershipResolvedContribution, type MetricOwnershipTypeExplanation, type MetricTemporal, MetricType, type MetricWithOptionalOwnershipLayer, NOTEBOOK_TAG_PREFIX, type Note, type NoteBlock, type NoteBlockChange, type NoteBlockKind, type NoteKind, type NoteTag, type Notebook, type NotebookId, type NotebookOrigin, type NullValueKind, type Origin, OutputStatement, type OutputStatementOptions, type OutputStatementType, OwnershipResolver, type Page, type PageNote, type ParseError, ParsedCodeStatement, REFERENCE_METADATA_KEY, type ReconcileNoteBlocksOptions, type ReducerStats, type ReferenceDiagnostic, type ReferenceDiagnosticReason, type ReferenceKind, type ReferenceMatchKind, type ReferenceMetadata, type ReferenceRef, type ResultOrigin, SEMVER, SYSTEM_DEFAULT_OUTPUT_UNIT, type ScriptBlock, type ScriptBlockState, type Section, type SectionDocument, type SectionRecognitionOptions, type SectionType, type Segment, type Session, type StoredOutputStatement, type SummaryCoverage, type Tag, type TagType, type TagTypeRecord, type TimeSpan, UNIT_CATALOG, UnitConversionError, type UnitDefinition, type UnitErrorCode, VALID_FENCE_DIALECTS, VERSION, type VisualizerFilter, type VisualizerSize, type WorkoutResults, type WorkoutSectionType, actionableSectionKind, blockContentId, buildRawContent, calculateTotalLines, convertViaCatalog, createMetricOwnershipLedger, detectScriptBlocks, dimensionKeyOf, extractBlockContent, fieldRefFromKey, fieldRefKey, findBlockAtLine, flattenFieldLeaves, fromNotebookTag, getMetricOwnershipLayer, getReferenceMetadata, isNoteEditable, isNotebookTag, isWorkoutSectionType, lookupUnit, mapNoteBlockChanges, matchDialectFence, normalizeFieldComponent, normalizeFieldPath, notebookSlugFromId, ownershipRank, parseDocumentSections, patchFrontmatterProperty, reconcileNoteBlocks, resolveLayer, runAffordance, systemDefaultUnit, toNotebookId, toNotebookTag, validateNoteBlocks, valueKindOf };
1771
+ export { type AnalyticsDataPoint, type AnalyticsGraphConfig, type AnalyticsGroup, type Attachment, BUILD_TIME, type BlockEffort, type BlockEquipment, type BlockIndexRow, BlockKey, type BlockRevision, type CatalogBackfillState, CodeMetadata, CodeStatement, DEFAULT_NOTEBOOK_SLUGS, type DefaultNotebookSlug, type DialectAnalysis, type DimensionKey, type DisplayStatus, type EventGrain, type EventRecord, type FenceDialect, type FieldCatalogEntry, type FieldContribution, type FieldLeaf, type FieldRef, type FieldSourceRecord, type FieldValueKind, type FieldValueRecord, type FrontMatterSubtype, type FrontmatterPatchValue, GIT_SHA, type IBlockKey, type ICodeMetadata, type ICodeStatement, type IDialect, type IDialectTagDescriptor, type IMetric, type IMetricOwnershipResolver, type IMetricSource, type IOutputStatement, type IScript, type ITagSource, KNOWN_OUTPUT_TYPES, KNOWN_SECTION_WIDGETS, LEGACY_ORIGIN_TO_OWNERSHIP_LAYER, METRIC_OWNERSHIP_LAYER_CHAIN, type Membership, Metric, type MetricAction, MetricContainer, type MetricFilter, type MetricOrigin, type MetricOwnershipLayer, type MetricOwnershipLedger, type MetricOwnershipOutcome, type MetricOwnershipPromotionCandidate, type MetricOwnershipQuery, type MetricOwnershipResolvedContribution, type MetricOwnershipTypeExplanation, type MetricTemporal, MetricType, type MetricWithOptionalOwnershipLayer, NOTEBOOK_TAG_PREFIX, type Note, type NoteBlock, type NoteBlockChange, type NoteBlockKind, type NoteKind, type NoteTag, type Notebook, type NotebookId, type NotebookOrigin, type NullValueKind, type Origin, OutputStatement, type OutputStatementOptions, type OutputStatementType, OwnershipResolver, type Page, type PageNote, type ParseError, ParsedCodeStatement, REFERENCE_METADATA_KEY, type ReconcileNoteBlocksOptions, type ReducerStats, type ReferenceDiagnostic, type ReferenceDiagnosticReason, type ReferenceKind, type ReferenceMatchKind, type ReferenceMetadata, type ReferenceRef, type ResultOrigin, SEMVER, SYSTEM_DEFAULT_OUTPUT_UNIT, type ScriptBlock, type ScriptBlockState, type Section, type SectionDocument, type SectionRecognitionOptions, type SectionType, type Segment, type Session, type StoredOutputStatement, type SummaryCoverage, TAG_REFERENCE_METADATA_KEY, type Tag, type TagContribution, type TagDefinition, type TagFunctionContribution, type TagIndex, type TagMetricContribution, type TagReferenceMetadata, type TagTagContribution, type TagType, type TagTypeRecord, type TimeSpan, UNIT_CATALOG, UnitConversionError, type UnitDefinition, type UnitErrorCode, VALID_FENCE_DIALECTS, VERSION, type VisualizerFilter, type VisualizerSize, type WorkoutResults, type WorkoutSectionType, actionableSectionKind, blockContentId, buildRawContent, calculateTotalLines, convertViaCatalog, createMetricOwnershipLedger, createTagIndex, detectScriptBlocks, dimensionKeyOf, extractBlockContent, fieldRefFromKey, fieldRefKey, findBlockAtLine, flattenFieldLeaves, fromNotebookTag, getMetricOwnershipLayer, getReferenceMetadata, getTagReference, isNoteEditable, isNotebookTag, isWorkoutSectionType, lookupUnit, mapNoteBlockChanges, matchDialectFence, normalizeFieldComponent, normalizeFieldPath, notebookSlugFromId, ownershipRank, parseDocumentSections, patchFrontmatterProperty, reconcileNoteBlocks, resolveLayer, runAffordance, systemDefaultUnit, toNotebookId, toNotebookTag, validateNoteBlocks, valueKindOf };
package/dist/index.d.ts CHANGED
@@ -933,6 +933,123 @@ interface Segment {
933
933
  metrics?: MetricContainer;
934
934
  }
935
935
 
936
+ /**
937
+ * Tags — named bundles a script can reference.
938
+ *
939
+ * A script line points at a tag instead of repeating what the tag means:
940
+ *
941
+ * ```text
942
+ * 5 reps @ 100 kg #heavy
943
+ * ```
944
+ *
945
+ * A tag contributes three kinds of thing to the statements that reference
946
+ * it:
947
+ *
948
+ * - a **metric** — a typed value with a unit (the meaning of the line),
949
+ * - a **tag** — another tag, so a tag can build on a tag,
950
+ * - a **function** — a named calculation the tag activates where it applies.
951
+ *
952
+ * The model lives in core because both the parser (which resolves
953
+ * `#slug` references) and the runtime (which runs the functions a tag
954
+ * carries) need it, and neither should know how tags are stored.
955
+ */
956
+ /** A metric a tag contributes: a typed value with an optional unit. */
957
+ interface TagMetricContribution {
958
+ readonly kind: 'metric';
959
+ /** The metric type, e.g. `sound` or `rpe`. */
960
+ readonly type: string;
961
+ /** The metric's value. */
962
+ readonly value: string | number | boolean | null;
963
+ /** The unit the value is expressed in, when it has one. */
964
+ readonly unit?: string;
965
+ }
966
+ /** Another tag this tag applies. */
967
+ interface TagTagContribution {
968
+ readonly kind: 'tag';
969
+ /** The slug of the applied tag. */
970
+ readonly slug: string;
971
+ }
972
+ /** A named function this tag carries. */
973
+ interface TagFunctionContribution {
974
+ readonly kind: 'function';
975
+ /**
976
+ * The function's name — the id of the calculation it refers to. The
977
+ * calculation's own scope decides the grain it runs at: `segment` per
978
+ * record, `workout` at the end of the workout.
979
+ */
980
+ readonly name: string;
981
+ }
982
+ /** What a tag contributes. */
983
+ type TagContribution = TagMetricContribution | TagTagContribution | TagFunctionContribution;
984
+ /** A tag and what it contributes. */
985
+ interface TagDefinition {
986
+ /** The slug a script references: `#slug`. */
987
+ readonly slug: string;
988
+ /** What the tag contributes when referenced. */
989
+ readonly contributions: readonly TagContribution[];
990
+ }
991
+ /** A slug → tag lookup. */
992
+ interface TagIndex {
993
+ /**
994
+ * The tag with this slug, or `undefined` when the catalogue has no such
995
+ * tag.
996
+ */
997
+ resolve(slug: string): TagDefinition | undefined;
998
+ /** Every tag in the index. */
999
+ list(): readonly TagDefinition[];
1000
+ }
1001
+ /**
1002
+ * A host-supplied source of tags.
1003
+ *
1004
+ * The language never reads storage: the host loads its tags and hands the
1005
+ * language a {@link TagIndex}. A host implements this to feed the parser a
1006
+ * database-configured catalogue.
1007
+ */
1008
+ interface ITagSource {
1009
+ /** Load every tag the host knows about. */
1010
+ loadTags(): Promise<readonly TagDefinition[]>;
1011
+ }
1012
+ /**
1013
+ * Build a tag index from tag definitions.
1014
+ *
1015
+ * Later definitions of the same slug win, matching how the app layers
1016
+ * user-defined tags over seeded ones.
1017
+ */
1018
+ declare function createTagIndex(tags: readonly TagDefinition[]): TagIndex;
1019
+
1020
+ /**
1021
+ * Tag references — the tag a metric came from.
1022
+ *
1023
+ * A script line can point at a tag (`5 reps @ 100 kg #heavy`), and the tag
1024
+ * brings metrics, other tags and functions. The metrics it brings record
1025
+ * where they came from, so the editor can show the tag, link to it, and the
1026
+ * compiler can compose what the block used.
1027
+ *
1028
+ * Pure data: survives the stored-logs / JSON round-trip.
1029
+ */
1030
+ /** A tag reference: the tag, what it carries, and what it names. */
1031
+ interface TagReferenceMetadata {
1032
+ /** The tag's slug — what `#slug` refers to. */
1033
+ slug: string;
1034
+ /** The tag's display label (its slug, for now). */
1035
+ label: string;
1036
+ /** The functions the tag carries — named calculations it activates. */
1037
+ functions?: readonly string[];
1038
+ /**
1039
+ * The sound profile the tag selects, when it names one. A tag that carries
1040
+ * a sound metric points at the profile that metric names.
1041
+ */
1042
+ soundProfileId?: string;
1043
+ }
1044
+ /** Metadata key under which {@link TagReferenceMetadata} is stored on a metric. */
1045
+ declare const TAG_REFERENCE_METADATA_KEY = "tagReference";
1046
+ /**
1047
+ * Read the tag reference off a metric's metadata. Validates shape before
1048
+ * trusting persisted input: an unknown-shape payload is ignored rather than
1049
+ * partially honored.
1050
+ */
1051
+ declare function getTagReference(metadata: Record<string, unknown> | undefined): TagReferenceMetadata | undefined;
1052
+
936
1053
  /** Cross-note fingerprint of the trimmed, unfenced workout body. Never an occurrence ID. */
937
1054
  declare function blockContentId(content: string): string;
938
1055
 
@@ -1041,6 +1158,8 @@ interface Note {
1041
1158
  seedChunkId?: string;
1042
1159
  /** Authored seed path used for deterministic identity and routing. */
1043
1160
  sourcePath?: string;
1161
+ /** Git commit hash in which this note was published or changed. */
1162
+ seedCommit?: string;
1044
1163
  }
1045
1164
  interface Page {
1046
1165
  id: string;
@@ -1064,10 +1183,21 @@ interface TagTypeRecord {
1064
1183
  color?: string;
1065
1184
  createdAt: number;
1066
1185
  }
1186
+ /**
1187
+ * A tag: a named bundle a script can reference with `#slug`.
1188
+ *
1189
+ * Keeping the contributions on the tag means the meaning lives in one place
1190
+ * instead of being repeated on every line that wants the tag.
1191
+ */
1067
1192
  interface Tag {
1068
1193
  id: string;
1069
1194
  label: string;
1070
1195
  type?: TagType;
1196
+ /**
1197
+ * What this tag contributes when referenced from script content: metrics,
1198
+ * other tags, and functions.
1199
+ */
1200
+ contributions?: TagContribution[];
1071
1201
  createdAt: number;
1072
1202
  }
1073
1203
  interface NoteTag {
@@ -1629,13 +1759,13 @@ declare function patchFrontmatterProperty(raw: string, path: readonly string[],
1629
1759
  * Auto-generated build version metadata.
1630
1760
  * Do not edit directly; updated by scripts/stamp-version.ts
1631
1761
  */
1632
- declare const VERSION = "0.43.2153";
1633
- declare const GIT_SHA = "3bb3096";
1634
- declare const BUILD_TIME = "2026-10-22T21:06:18.747Z";
1762
+ declare const VERSION = "0.44.2155";
1763
+ declare const GIT_SHA = "6807397";
1764
+ declare const BUILD_TIME = "2026-10-24T03:58:47.392Z";
1635
1765
  declare const SEMVER: {
1636
- readonly version: "0.43.2153";
1637
- readonly gitSha: "3bb3096";
1638
- readonly buildTime: "2026-10-22T21:06:18.747Z";
1766
+ readonly version: "0.44.2155";
1767
+ readonly gitSha: "6807397";
1768
+ readonly buildTime: "2026-10-24T03:58:47.392Z";
1639
1769
  };
1640
1770
 
1641
- export { type AnalyticsDataPoint, type AnalyticsGraphConfig, type AnalyticsGroup, type Attachment, BUILD_TIME, type BlockEffort, type BlockEquipment, type BlockIndexRow, BlockKey, type BlockRevision, type CatalogBackfillState, CodeMetadata, CodeStatement, DEFAULT_NOTEBOOK_SLUGS, type DefaultNotebookSlug, type DialectAnalysis, type DimensionKey, type DisplayStatus, type EventGrain, type EventRecord, type FenceDialect, type FieldCatalogEntry, type FieldContribution, type FieldLeaf, type FieldRef, type FieldSourceRecord, type FieldValueKind, type FieldValueRecord, type FrontMatterSubtype, type FrontmatterPatchValue, GIT_SHA, type IBlockKey, type ICodeMetadata, type ICodeStatement, type IDialect, type IDialectTagDescriptor, type IMetric, type IMetricOwnershipResolver, type IMetricSource, type IOutputStatement, type IScript, KNOWN_OUTPUT_TYPES, KNOWN_SECTION_WIDGETS, LEGACY_ORIGIN_TO_OWNERSHIP_LAYER, METRIC_OWNERSHIP_LAYER_CHAIN, type Membership, Metric, type MetricAction, MetricContainer, type MetricFilter, type MetricOrigin, type MetricOwnershipLayer, type MetricOwnershipLedger, type MetricOwnershipOutcome, type MetricOwnershipPromotionCandidate, type MetricOwnershipQuery, type MetricOwnershipResolvedContribution, type MetricOwnershipTypeExplanation, type MetricTemporal, MetricType, type MetricWithOptionalOwnershipLayer, NOTEBOOK_TAG_PREFIX, type Note, type NoteBlock, type NoteBlockChange, type NoteBlockKind, type NoteKind, type NoteTag, type Notebook, type NotebookId, type NotebookOrigin, type NullValueKind, type Origin, OutputStatement, type OutputStatementOptions, type OutputStatementType, OwnershipResolver, type Page, type PageNote, type ParseError, ParsedCodeStatement, REFERENCE_METADATA_KEY, type ReconcileNoteBlocksOptions, type ReducerStats, type ReferenceDiagnostic, type ReferenceDiagnosticReason, type ReferenceKind, type ReferenceMatchKind, type ReferenceMetadata, type ReferenceRef, type ResultOrigin, SEMVER, SYSTEM_DEFAULT_OUTPUT_UNIT, type ScriptBlock, type ScriptBlockState, type Section, type SectionDocument, type SectionRecognitionOptions, type SectionType, type Segment, type Session, type StoredOutputStatement, type SummaryCoverage, type Tag, type TagType, type TagTypeRecord, type TimeSpan, UNIT_CATALOG, UnitConversionError, type UnitDefinition, type UnitErrorCode, VALID_FENCE_DIALECTS, VERSION, type VisualizerFilter, type VisualizerSize, type WorkoutResults, type WorkoutSectionType, actionableSectionKind, blockContentId, buildRawContent, calculateTotalLines, convertViaCatalog, createMetricOwnershipLedger, detectScriptBlocks, dimensionKeyOf, extractBlockContent, fieldRefFromKey, fieldRefKey, findBlockAtLine, flattenFieldLeaves, fromNotebookTag, getMetricOwnershipLayer, getReferenceMetadata, isNoteEditable, isNotebookTag, isWorkoutSectionType, lookupUnit, mapNoteBlockChanges, matchDialectFence, normalizeFieldComponent, normalizeFieldPath, notebookSlugFromId, ownershipRank, parseDocumentSections, patchFrontmatterProperty, reconcileNoteBlocks, resolveLayer, runAffordance, systemDefaultUnit, toNotebookId, toNotebookTag, validateNoteBlocks, valueKindOf };
1771
+ export { type AnalyticsDataPoint, type AnalyticsGraphConfig, type AnalyticsGroup, type Attachment, BUILD_TIME, type BlockEffort, type BlockEquipment, type BlockIndexRow, BlockKey, type BlockRevision, type CatalogBackfillState, CodeMetadata, CodeStatement, DEFAULT_NOTEBOOK_SLUGS, type DefaultNotebookSlug, type DialectAnalysis, type DimensionKey, type DisplayStatus, type EventGrain, type EventRecord, type FenceDialect, type FieldCatalogEntry, type FieldContribution, type FieldLeaf, type FieldRef, type FieldSourceRecord, type FieldValueKind, type FieldValueRecord, type FrontMatterSubtype, type FrontmatterPatchValue, GIT_SHA, type IBlockKey, type ICodeMetadata, type ICodeStatement, type IDialect, type IDialectTagDescriptor, type IMetric, type IMetricOwnershipResolver, type IMetricSource, type IOutputStatement, type IScript, type ITagSource, KNOWN_OUTPUT_TYPES, KNOWN_SECTION_WIDGETS, LEGACY_ORIGIN_TO_OWNERSHIP_LAYER, METRIC_OWNERSHIP_LAYER_CHAIN, type Membership, Metric, type MetricAction, MetricContainer, type MetricFilter, type MetricOrigin, type MetricOwnershipLayer, type MetricOwnershipLedger, type MetricOwnershipOutcome, type MetricOwnershipPromotionCandidate, type MetricOwnershipQuery, type MetricOwnershipResolvedContribution, type MetricOwnershipTypeExplanation, type MetricTemporal, MetricType, type MetricWithOptionalOwnershipLayer, NOTEBOOK_TAG_PREFIX, type Note, type NoteBlock, type NoteBlockChange, type NoteBlockKind, type NoteKind, type NoteTag, type Notebook, type NotebookId, type NotebookOrigin, type NullValueKind, type Origin, OutputStatement, type OutputStatementOptions, type OutputStatementType, OwnershipResolver, type Page, type PageNote, type ParseError, ParsedCodeStatement, REFERENCE_METADATA_KEY, type ReconcileNoteBlocksOptions, type ReducerStats, type ReferenceDiagnostic, type ReferenceDiagnosticReason, type ReferenceKind, type ReferenceMatchKind, type ReferenceMetadata, type ReferenceRef, type ResultOrigin, SEMVER, SYSTEM_DEFAULT_OUTPUT_UNIT, type ScriptBlock, type ScriptBlockState, type Section, type SectionDocument, type SectionRecognitionOptions, type SectionType, type Segment, type Session, type StoredOutputStatement, type SummaryCoverage, TAG_REFERENCE_METADATA_KEY, type Tag, type TagContribution, type TagDefinition, type TagFunctionContribution, type TagIndex, type TagMetricContribution, type TagReferenceMetadata, type TagTagContribution, type TagType, type TagTypeRecord, type TimeSpan, UNIT_CATALOG, UnitConversionError, type UnitDefinition, type UnitErrorCode, VALID_FENCE_DIALECTS, VERSION, type VisualizerFilter, type VisualizerSize, type WorkoutResults, type WorkoutSectionType, actionableSectionKind, blockContentId, buildRawContent, calculateTotalLines, convertViaCatalog, createMetricOwnershipLedger, createTagIndex, detectScriptBlocks, dimensionKeyOf, extractBlockContent, fieldRefFromKey, fieldRefKey, findBlockAtLine, flattenFieldLeaves, fromNotebookTag, getMetricOwnershipLayer, getReferenceMetadata, getTagReference, isNoteEditable, isNotebookTag, isWorkoutSectionType, lookupUnit, mapNoteBlockChanges, matchDialectFence, normalizeFieldComponent, normalizeFieldPath, notebookSlugFromId, ownershipRank, parseDocumentSections, patchFrontmatterProperty, reconcileNoteBlocks, resolveLayer, runAffordance, systemDefaultUnit, toNotebookId, toNotebookTag, validateNoteBlocks, valueKindOf };
package/dist/index.mjs CHANGED
@@ -961,6 +961,31 @@ var BlockKey = class {
961
961
  }
962
962
  };
963
963
 
964
+ // src/models/Tag.ts
965
+ function createTagIndex(tags) {
966
+ const bySlug = /* @__PURE__ */ new Map();
967
+ for (const tag of tags) {
968
+ bySlug.set(tag.slug, tag);
969
+ }
970
+ return {
971
+ resolve: (slug) => bySlug.get(slug),
972
+ list: () => [...bySlug.values()]
973
+ };
974
+ }
975
+
976
+ // src/models/TagReference.ts
977
+ var TAG_REFERENCE_METADATA_KEY = "tagReference";
978
+ function getTagReference(metadata) {
979
+ const value = metadata?.[TAG_REFERENCE_METADATA_KEY];
980
+ if (!value || typeof value !== "object") return void 0;
981
+ const candidate = value;
982
+ if (typeof candidate.slug !== "string" || !candidate.slug) return void 0;
983
+ if (typeof candidate.label !== "string") return void 0;
984
+ if (candidate.functions !== void 0 && !Array.isArray(candidate.functions)) return void 0;
985
+ if (candidate.soundProfileId !== void 0 && typeof candidate.soundProfileId !== "string") return void 0;
986
+ return value;
987
+ }
988
+
964
989
  // src/models/blockContentId.ts
965
990
  function blockContentId(content) {
966
991
  const normalized = content.trim();
@@ -1407,15 +1432,15 @@ function patchFrontmatterProperty(raw, path, value) {
1407
1432
  }
1408
1433
 
1409
1434
  // src/version.ts
1410
- var VERSION = "0.43.2153";
1411
- var GIT_SHA = "3bb3096";
1412
- var BUILD_TIME = "2026-10-22T21:06:18.747Z";
1435
+ var VERSION = "0.44.2155";
1436
+ var GIT_SHA = "6807397";
1437
+ var BUILD_TIME = "2026-10-24T03:58:47.392Z";
1413
1438
  var SEMVER = {
1414
- version: "0.43.2153",
1415
- gitSha: "3bb3096",
1416
- buildTime: "2026-10-22T21:06:18.747Z"
1439
+ version: "0.44.2155",
1440
+ gitSha: "6807397",
1441
+ buildTime: "2026-10-24T03:58:47.392Z"
1417
1442
  };
1418
1443
 
1419
- export { BUILD_TIME, BlockKey, CodeMetadata, CodeStatement, DEFAULT_NOTEBOOK_SLUGS, GIT_SHA, KNOWN_OUTPUT_TYPES, KNOWN_SECTION_WIDGETS, LEGACY_ORIGIN_TO_OWNERSHIP_LAYER, METRIC_OWNERSHIP_LAYER_CHAIN, Metric, MetricContainer, MetricType, NOTEBOOK_TAG_PREFIX, OutputStatement, OwnershipResolver, ParsedCodeStatement, REFERENCE_METADATA_KEY, SEMVER, SYSTEM_DEFAULT_OUTPUT_UNIT, UNIT_CATALOG, UnitConversionError, VALID_FENCE_DIALECTS, VERSION, actionableSectionKind, blockContentId, buildRawContent, calculateTotalLines, convertViaCatalog, createMetricOwnershipLedger, detectScriptBlocks, dimensionKeyOf, extractBlockContent, fieldRefFromKey, fieldRefKey, findBlockAtLine, flattenFieldLeaves, fromNotebookTag, getMetricOwnershipLayer, getReferenceMetadata, isNoteEditable, isNotebookTag, isWorkoutSectionType, lookupUnit, mapNoteBlockChanges, matchDialectFence, normalizeFieldComponent, normalizeFieldPath, notebookSlugFromId, ownershipRank, parseDocumentSections, patchFrontmatterProperty, reconcileNoteBlocks, resolveLayer, runAffordance, systemDefaultUnit, toNotebookId, toNotebookTag, validateNoteBlocks, valueKindOf };
1444
+ export { BUILD_TIME, BlockKey, CodeMetadata, CodeStatement, DEFAULT_NOTEBOOK_SLUGS, GIT_SHA, KNOWN_OUTPUT_TYPES, KNOWN_SECTION_WIDGETS, LEGACY_ORIGIN_TO_OWNERSHIP_LAYER, METRIC_OWNERSHIP_LAYER_CHAIN, Metric, MetricContainer, MetricType, NOTEBOOK_TAG_PREFIX, OutputStatement, OwnershipResolver, ParsedCodeStatement, REFERENCE_METADATA_KEY, SEMVER, SYSTEM_DEFAULT_OUTPUT_UNIT, TAG_REFERENCE_METADATA_KEY, UNIT_CATALOG, UnitConversionError, VALID_FENCE_DIALECTS, VERSION, actionableSectionKind, blockContentId, buildRawContent, calculateTotalLines, convertViaCatalog, createMetricOwnershipLedger, createTagIndex, detectScriptBlocks, dimensionKeyOf, extractBlockContent, fieldRefFromKey, fieldRefKey, findBlockAtLine, flattenFieldLeaves, fromNotebookTag, getMetricOwnershipLayer, getReferenceMetadata, getTagReference, isNoteEditable, isNotebookTag, isWorkoutSectionType, lookupUnit, mapNoteBlockChanges, matchDialectFence, normalizeFieldComponent, normalizeFieldPath, notebookSlugFromId, ownershipRank, parseDocumentSections, patchFrontmatterProperty, reconcileNoteBlocks, resolveLayer, runAffordance, systemDefaultUnit, toNotebookId, toNotebookTag, validateNoteBlocks, valueKindOf };
1420
1445
  //# sourceMappingURL=index.mjs.map
1421
1446
  //# sourceMappingURL=index.mjs.map