@bitcobblers/wod-wiki-core 0.52.2198 → 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 +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/dist/testing.cjs +576 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.cts +735 -0
- package/dist/testing.d.ts +735 -0
- package/dist/testing.mjs +569 -0
- package/dist/testing.mjs.map +1 -0
- package/package.json +6 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/models/blockContentId.ts","../src/sections/sectionParser.ts","../src/testing.ts"],"names":["end","section","blockContentId"],"mappings":";AACO,SAAS,eAAe,OAAA,EAAyB;AACtD,EAAA,MAAM,UAAA,GAAa,QAAQ,IAAA,EAAK;AAChC,EAAA,IAAI,IAAA,GAAO,UAAA;AACX,EAAA,KAAA,IAAS,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,UAAA,CAAW,QAAQ,CAAA,EAAA,EAAK;AAC1C,IAAA,IAAA,IAAQ,UAAA,CAAW,WAAW,CAAC,CAAA;AAC/B,IAAA,IAAA,GAAO,IAAA,CAAK,IAAA,CAAK,IAAA,EAAM,QAAU,CAAA;AAAA,EACnC;AACA,EAAA,OAAO,CAAA,GAAA,EAAA,CAAO,SAAS,CAAA,EAAG,QAAA,CAAS,EAAE,CAAA,CAAE,QAAA,CAAS,CAAA,EAAG,GAAG,CAAC,CAAA,CAAA;AACzD;;;ACJO,IAAM,qBAAA,GAA2C,CAAC,oBAAA,EAAsB,WAAA,EAAa,gBAAgB,cAAc,CAAA;AAC1H,IAAM,wBAAA,GAA2D;AAAA,EAC/D,KAAA,EAAO,IAAA;AAAA,EACP,IAAA,EAAM,IAAA;AAAA,EACN,KAAA,EAAO,IAAA;AAAA,EACP,UA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,EAAAA,eAAAA,EAAe,GAAI,EAAC,EAAG;AAC3F,IAAA,KAAA,CAAM,QAAA,CAAS,KAAK,OAAO,CAAA;AAC3B,IAAA,KAAA,CAAM,MAAA,CAAO,IAAA,CAAK,GAAG,KAAA,CAAM,MAAM,CAAA;AACjC,IAAA,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAG,KAAA,CAAM,aAAa,CAAA;AAAA,EACjD;AAGA,EAAA,MAAM,mBAAA,uBAA0B,GAAA,EAAY;AAC5C,EAAA,KAAA,MAAW,QAAQ,KAAA,CAAM,aAAA,EAAe,mBAAA,CAAoB,GAAA,CAAI,KAAK,UAAU,CAAA;AAC/E,EAAA,KAAA,MAAW,QAAQ,mBAAA,EAAqB;AACtC,IAAA,IAAI,CAAC,KAAA,CAAM,SAAA,CAAU,IAAA,CAAK,QAAM,EAAA,CAAG,EAAA,KAAO,IAAI,CAAA,EAAG,KAAA,CAAM,SAAA,CAAU,IAAA,CAAK,mBAAA,CAAoB,IAAI,CAAC,CAAA;AAAA,EACjG;AAEA,EAAA,OAAO,KAAA;AACT;AAGA,SAAS,oBAAoB,UAAA,EAA0B;AACrD,EAAA,MAAM,IAAA,GAAO,WAAW,UAAA,CAAW,WAAW,IAAI,UAAA,CAAW,KAAA,CAAM,WAAA,CAAY,MAAM,CAAA,GAAI,UAAA;AACzF,EAAA,OAAO;AAAA,IACL,EAAA,EAAI,UAAA;AAAA,IACJ,KAAA,EAAO,KAAK,MAAA,CAAO,CAAC,EAAE,WAAA,EAAY,GAAI,IAAA,CAAK,KAAA,CAAM,CAAC,CAAA;AAAA,IAClD,UAAA,EAAY,EAAA;AAAA,IACZ,cAAA,EAAgB,CAAA;AAAA,IAChB,QAAQ,EAAC;AAAA,IACT,SAAA,EAAW;AAAA,GACb;AACF","file":"testing.mjs","sourcesContent":["/** Cross-note fingerprint of the trimmed, unfenced workout body. Never an occurrence ID. */\nexport function blockContentId(content: string): string {\n const normalized = content.trim();\n let hash = 0x811c9dc5;\n for (let i = 0; i < normalized.length; i++) {\n hash ^= normalized.charCodeAt(i);\n hash = Math.imul(hash, 0x01000193);\n }\n return `bc-${(hash >>> 0).toString(16).padStart(8, '0')}`;\n}\n","import { blockContentId } from '../models/blockContentId';\nimport type { NoteBlock } from '../types/storage';\nimport type { FrontMatterSubtype, Section } from '../types/section';\n\nexport { blockContentId };\nexport const KNOWN_SECTION_WIDGETS: readonly string[] = ['playground-run-tip', 'attention', 'code-example', 'syntax-group'];\nconst KNOWN_QUERY_WIDGET_TYPES: Readonly<Record<string, true>> = {\n table: true,\n list: true,\n value: true,\n timeseries: true,\n bar: true,\n donut: true,\n toplist: true,\n 'stacked-bar': true,\n 'goal-rings': true,\n 'zone-distribution': true,\n};\n\nexport function matchDialectFence(trimmedLine: string): { dialect: 'time' | 'log'; sport?: string } | null {\n const match = trimmedLine.match(/^`{3,}(time|log)(?::([\\w-]+))?\\s*$/i);\n if (!match) return null;\n return { dialect: match[1].toLowerCase() === 'time' ? 'time' : 'log', ...(match[2] ? { sport: match[2] } : {}) };\n}\n\nexport interface SectionRecognitionOptions {\n registeredWidgets?: ReadonlySet<string> | readonly string[];\n}\n\nexport interface ReconcileNoteBlocksOptions extends SectionRecognitionOptions {\n sourceRevision: number;\n /** Current-source occurrence lineage, not a previous document's locations. */\n blocks?: Record<string, NoteBlock>;\n createId?: () => string;\n}\n\n\nfunction frontmatterSubtype(properties: Record<string, string>): FrontMatterSubtype {\n const type = properties.type?.toLowerCase();\n if (type === 'youtube' || type === 'strava' || type === 'amazon' || type === 'file' || type === 'effort' || type === 'equipment') return type;\n const url = properties.url || properties.link || '';\n const host = url.replace(/^[a-z][a-z0-9+.-]*:\\/\\//i, '').split(/[/?#:]/, 1)[0].toLowerCase();\n if (host === 'youtu.be' || host === 'youtube.com' || host.endsWith('.youtube.com')) return 'youtube';\n if (host === 'strava.com' || host.endsWith('.strava.com')) return 'strava';\n if (host === 'amzn.to' || host === 'amazon.com' || host.endsWith('.amazon.com')) return 'amazon';\n if (['baseAttributes', 'metrics.met', 'discipline', 'effortType', 'targetRPE', 'equipment', 'aliases', 'derivation'].some(key => key in properties)) return 'effort';\n if (['slug', 'label', 'registrySource', 'ownerNoteId', 'sourcePath'].some(key => key in properties)) return 'equipment';\n return 'default';\n}\n\nfunction markdownSubtype(text: string): string {\n if (/^#{1,6}\\s/.test(text)) return 'heading';\n if (/^[-*+]\\s|^\\d+\\.\\s/.test(text)) return 'list';\n if (/^>\\s?/.test(text)) return 'blockquote';\n if (text.startsWith('|') && /^\\|[\\s:]*-+/m.test(text)) return 'table';\n return 'paragraph';\n}\n\nexport function parseDocumentSections(content: string, options: SectionRecognitionOptions = {}): Section[] {\n if (!content) return [];\n const lines = content.split(/\\r\\n|\\n|\\r/);\n const offsets: number[] = [];\n const separators: string[] = [];\n let offset = 0;\n for (const text of lines) {\n offsets.push(offset);\n offset += text.length;\n const separator = content.startsWith('\\r\\n', offset) ? '\\r\\n' : /[\\r\\n]/.test(content[offset] ?? '') ? content[offset] : '';\n separators.push(separator);\n offset += separator.length;\n }\n const sections: Section[] = [];\n const createdAt = Date.now();\n let firstText = true;\n let line = 0;\n\n function make(type: Section['type'], start: number, end: number): Section {\n const from = offsets[start];\n const to = offsets[end] + lines[end].length;\n return {\n id: crypto.randomUUID(), type, from, to,\n rawContent: content.slice(from, to), displayContent: content.slice(from, to),\n startLine: start, endLine: end, lineCount: end - start + 1,\n version: 1, createdAt, separatorAfter: separators[end],\n };\n }\n\n while (line < lines.length) {\n const text = lines[line].trim();\n const fence = text.match(/^(`{3,}|~{3,})(.*)$/);\n if (fence) {\n const marker = fence[1];\n let close = line + 1;\n const closing = new RegExp(`^${marker[0]}{${marker.length},}\\\\s*$`);\n while (close < lines.length && !closing.test(lines[close].trim())) close++;\n const closed = close < lines.length;\n const end = closed ? close : lines.length - 1;\n const tag = fence[2].trim();\n const dialect = marker[0] === '`' ? matchDialectFence(`\\`\\`\\`${tag}`) : null;\n const widget = marker[0] === '`' ? tag.match(/^widget:([\\w-]+)$/) : null;\n const names = options.registeredWidgets ?? KNOWN_SECTION_WIDGETS;\n const knownWidget = widget && ('has' in names ? names.has(widget[1]) : names.includes(widget[1]));\n const widgetChartMatch = marker[0] === '`' && !knownWidget\n ? tag.match(/^widget:([a-zA-Z-]+)(?:-(?:full|\\d+))?(?:\\s+.*)?$/i)\n : null;\n const isWidgetChart = Boolean(widgetChartMatch && KNOWN_QUERY_WIDGET_TYPES[widgetChartMatch[1].toLowerCase()]);\n const query = marker[0] === '`'\n ? (tag.match(/^query(?:[:\\s](.*))?$/i) ?? (isWidgetChart ? tag.match(/^widget:?(.*)$/i) : null))\n : null;\n const type = closed && dialect ? dialect.dialect : closed && knownWidget ? 'widget' : closed && query ? 'query' : 'code';\n const section = make(type, line, end);\n section.contentFrom = offsets[line] + lines[line].length + separators[line].length;\n section.contentTo = closed ? offsets[close] : section.to;\n section.displayContent = content.slice(section.contentFrom, section.contentTo);\n if (dialect && closed) {\n section.sport = dialect.sport;\n section.contentId = blockContentId(section.displayContent);\n section.scriptBlock = {\n id: section.id, contentId: section.contentId, dialect: dialect.dialect, sport: dialect.sport,\n startLine: line, endLine: end, content: section.displayContent,\n state: 'idle', version: 1, createdAt,\n };\n }\n if (type === 'widget' && widget) section.widgetName = widget[1];\n if (type === 'query' && query) section.querySuffix = (query[1] ?? '').trim();\n sections.push(section);\n line = end + 1;\n continue;\n }\n if (text === '---' && lines[line + 1]?.trim()) {\n let close = line + 1;\n while (close < lines.length && lines[close].trim() !== '---' && !/^(`{3,}|~{3,})/.test(lines[close].trim())) close++;\n const inner = lines.slice(line + 1, close);\n if (lines[close]?.trim() === '---' && inner.some(value => /^[A-Za-z_][\\w.-]*\\s*:/.test(value.trim()))) {\n const section = make('frontmatter', line, close);\n section.contentFrom = offsets[line + 1];\n section.contentTo = offsets[close];\n section.displayContent = content.slice(section.contentFrom, section.contentTo);\n section.properties = {};\n for (const value of inner) {\n const pair = value.match(/^([^:]+):\\s*(.*)$/);\n if (pair) section.properties[pair[1].trim()] = pair[2].trim();\n }\n section.frontmatterType = frontmatterSubtype(section.properties);\n sections.push(section);\n line = close + 1;\n continue;\n }\n }\n const embed = text.match(/^(!)?\\[([^\\]]*)\\]\\((https?:\\/\\/[^)\\s]+|\\/[^)\\s]+)\\)$/);\n if (embed) {\n const section = make('embed', line, line);\n const isImage = !!embed[1];\n section.embed = { type: isImage ? 'image' : /(?:youtube\\.com|youtu\\.be)/i.test(embed[3]) ? 'youtube' : 'link', label: embed[2], url: embed[3], isImage };\n sections.push(section);\n line++;\n continue;\n }\n let end = line;\n if (text) {\n while (end + 1 < lines.length && lines[end + 1].trim() && !/^(?:`{3,}|~{3,}|---\\s*$|!?\\[[^\\]]*\\]\\()/.test(lines[end + 1].trim())) end++;\n }\n const section = make(text && firstText ? 'title' : 'markdown', line, end);\n section.subtype = markdownSubtype(section.displayContent.trim());\n if (text) firstText = false;\n sections.push(section);\n line = end + 1;\n }\n return sections;\n}\n\nexport function actionableSectionKind(section: Section): NoteBlock['kind'] | null {\n if (section.type === 'time' || section.type === 'log') return 'wod';\n if (section.type === 'query' || section.type === 'widget' || section.type === 'embed') return section.type;\n return null;\n}\n\nexport function reconcileNoteBlocks(rawContent: string, options: ReconcileNoteBlocksOptions): Record<string, NoteBlock> {\n if (!Number.isSafeInteger(options.sourceRevision) || options.sourceRevision < 1) throw new Error('Invalid source revision');\n const result: Record<string, NoteBlock> = Object.create(null);\n const lineage = Object.values(options.blocks ?? {}).filter(block => block && typeof block === 'object');\n const createId = options.createId ?? (() => crypto.randomUUID());\n for (const section of parseDocumentSections(rawContent, options)) {\n const kind = actionableSectionKind(section);\n if (!kind) continue;\n const matches = lineage.filter(block => block.from === section.from && block.to === section.to && block.kind === kind);\n const prior = matches.length === 1 ? matches[0] : undefined;\n const id = prior?.id ?? createId();\n if (!id || Object.hasOwn(result, id)) throw new Error('Duplicate block occurrence ID');\n result[id] = { id, kind, from: section.from, to: section.to, sourceRevision: options.sourceRevision, version: prior?.version ?? 1,\n ...(kind === 'wod' && (section.type === 'time' || section.type === 'log') ? { dialect: section.type, ...(section.sport ? { sport: section.sport } : {}) } : {}),\n };\n }\n return result;\n}\n\nexport function validateNoteBlocks(rawContent: string, blocks: Record<string, NoteBlock>, sourceRevision: number, options: SectionRecognitionOptions = {}): void {\n if (typeof rawContent !== 'string' || !blocks || typeof blocks !== 'object' || Array.isArray(blocks)) throw new Error('Invalid Note source or blocks');\n for (const [id, block] of Object.entries(blocks)) {\n if (!block || block.id !== id || !id || !Number.isSafeInteger(block.version) || block.version < 1 || block.sourceRevision !== sourceRevision || !Number.isSafeInteger(block.from) || !Number.isSafeInteger(block.to)) throw new Error('Invalid block identity, version or source revision');\n }\n const expected = reconcileNoteBlocks(rawContent, { ...options, sourceRevision, blocks });\n if (Object.keys(expected).length !== Object.keys(blocks).length) throw new Error('Incomplete actionable block map');\n for (const [id, block] of Object.entries(blocks)) {\n const recognized = expected[id];\n if (!recognized || recognized.from !== block.from || recognized.to !== block.to || recognized.kind !== block.kind || recognized.dialect !== block.dialect || recognized.sport !== block.sport) throw new Error('Block does not match authored source');\n }\n}\n\nexport interface NoteBlockChange { from: number; to: number; insert: string }\n\nexport function mapNoteBlockChanges(blocks: Record<string, NoteBlock>, changes: readonly NoteBlockChange[]): Record<string, NoteBlock> {\n let previousEnd = 0;\n for (const change of changes) {\n if (!Number.isSafeInteger(change.from) || !Number.isSafeInteger(change.to) || change.from < previousEnd || change.to < change.from || typeof change.insert !== 'string') throw new Error('Invalid source changes');\n previousEnd = change.to;\n }\n const result: Record<string, NoteBlock> = {};\n for (const block of Object.values(blocks)) {\n let from = block.from;\n let to = block.to;\n let removed = false;\n for (const change of changes) {\n const delta = change.insert.length - (change.to - change.from);\n if (change.from <= block.from && change.to >= block.to || change.from < block.from && change.to > block.from || change.from < block.to && change.to > block.to) { removed = true; break; }\n if (change.to <= block.from) { from += delta; to += delta; }\n else if (change.from < block.to) to += delta;\n }\n if (!removed) result[block.id] = { ...block, from, to };\n }\n return result;\n}\n\nexport function buildRawContent(sections: Section[]): string {\n return sections.filter(section => !section.deleted).map(section => section.rawContent + (section.separatorAfter ?? '')).join('');\n}\n\nexport function calculateTotalLines(sections: Section[]): number {\n const visible = sections.filter(section => !section.deleted);\n return visible.length ? visible[visible.length - 1].endLine + 1 : 0;\n}\n","/**\n * Canonical GLOSSARY.md domain fixture builders.\n *\n * Pure TypeScript — zero DOM/Node/libsql dependencies, safe for every host\n * (browser, Node, Storybook, headless vitest). All ids and timestamps are\n * deterministic functions of the inputs so `buildDomainWorld` snapshots are\n * reproducible: no `Date.now()`, no `crypto.randomUUID()`.\n */\nimport { blockContentId, parseDocumentSections, reconcileNoteBlocks } from './sections';\nimport type { FeedOrigin } from './types/feed';\nimport type {\n BlockEquipment,\n BlockEffort,\n BlockIndexRow,\n BlockRevision,\n EventRecord,\n Note,\n NoteBlock,\n NoteProvenance,\n NoteTag,\n NotebookLink,\n OverridePropertyKind,\n Page,\n PageNote,\n ResultOrigin,\n ScopedPropertyOverride,\n Session,\n Tag,\n} from './types/storage';\n\n/** Fixed epoch (2024-01-01T00:00:00Z) for every derived timestamp. */\nexport const TEST_EPOCH = 1704067200000 as const;\n\n// ---------------------------------------------------------------------------\n// buildTestNote\n// ---------------------------------------------------------------------------\n\nexport interface TestNoteInput {\n id?: string;\n title?: string;\n rawContent: string;\n type?: Note['type'];\n date?: number;\n createdAt?: number;\n sourceRevision?: number;\n seedOrigin?: 'seed' | 'user';\n feedOrigin?: FeedOrigin;\n sourceId?: string;\n sourcePath?: string;\n feedSourceId?: string;\n priorBlocks?: Record<string, NoteBlock>;\n notebookId?: string;\n notebookIds?: string[];\n tags?: string[];\n provenance?: NoteProvenance;\n}\n\nexport interface BuiltTestNote {\n note: Note;\n revisions: BlockRevision[];\n blockIndex: BlockIndexRow[];\n blockEfforts: BlockEffort[];\n blockEquipment: BlockEquipment[];\n tags: Tag[];\n noteTags: NoteTag[];\n notebookLinks: NotebookLink[];\n}\n\n/** One resolvable effort/equipment mention: canonical slug + matching phrases. */\ninterface MentionEntry {\n slug: string;\n phrases: string[];\n}\n\n/**\n * Effort/equipment vocabulary registered by `buildPropertyNote` in this\n * process. Mirrors runtime mention resolution (words are matched against the\n * registry), simplified to exact word-boundary phrase matches.\n * ponytail: process-global vocabulary — reset via `resetTestingVocabulary()`\n * in test setup if cross-suite leakage ever matters.\n */\nconst EFFORT_VOCABULARY: MentionEntry[] = [];\nconst EQUIPMENT_VOCABULARY: MentionEntry[] = [];\n\n/** Clear the process-global property vocabulary (test isolation helper). */\nexport function resetTestingVocabulary(): void {\n EFFORT_VOCABULARY.length = 0;\n EQUIPMENT_VOCABULARY.length = 0;\n}\n\nfunction slugifyText(text: string): string {\n return text.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');\n}\n\nfunction yamlScalar(value: string): string {\n return /^[A-Za-z0-9][^:#]*$/.test(value) ? value : JSON.stringify(value);\n}\n\nfunction yamlMapEntries(record: Record<string, unknown>): string[] {\n return Object.entries(record).map(([key, value]) =>\n ` ${key}: ${typeof value === 'string' ? yamlScalar(value) : typeof value === 'number' || typeof value === 'boolean' ? String(value) : JSON.stringify(value)}`,\n );\n}\n\nfunction yamlListLines(key: string, items: readonly string[]): string[] {\n return items.length > 0 ? [`${key}:`, ...items.map(item => ` - ${yamlScalar(item)}`)] : [`${key}: []`];\n}\n\nfunction mentionPhraseRegex(entry: MentionEntry): RegExp {\n const alternatives = [...new Set(entry.phrases.map(phrase => phrase.trim()).filter(Boolean))]\n .map(phrase => phrase.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'))\n .join('|');\n return new RegExp(`(?<![\\\\w-])(?:${alternatives})(?![\\\\w-])`, 'i');\n}\n\nfunction scanMentions(content: string, vocabulary: readonly MentionEntry[]): string[] {\n const slugs: string[] = [];\n for (const entry of vocabulary) {\n if (slugs.includes(entry.slug)) continue;\n if (mentionPhraseRegex(entry).test(content)) slugs.push(entry.slug);\n }\n return slugs;\n}\n\nfunction slugToMentionEntry(slug: string, label: string, aliases: readonly string[]): MentionEntry {\n return { slug, phrases: [slug, label, ...aliases] };\n}\n\n/**\n * Build a full Note aggregate: the Note itself, its block revision history,\n * WQL block-index projections, effort/equipment containment rows, tag rows\n * and notebook membership links.\n *\n * Block occurrence ids are deterministic (`blk-0`, `blk-1`, … in document\n * order) and `BlockIndexRow.blockContentId` carries the real content\n * fingerprint for wod blocks, so sessions can pin by content.\n */\nexport function buildTestNote(input: TestNoteInput): BuiltTestNote {\n const noteId = input.id ?? `note-${input.title ? slugifyText(input.title) : blockContentId(input.rawContent)}`;\n const createdAt = input.createdAt ?? TEST_EPOCH;\n const sourceRevision = input.sourceRevision ?? 1;\n const rawContent = input.rawContent;\n const title = input.title ?? 'Untitled';\n\n let ordinal = 0;\n const blocks: Record<string, NoteBlock> = reconcileNoteBlocks(rawContent, {\n sourceRevision,\n blocks: input.priorBlocks,\n createId: () => {\n let candidate = `blk-${ordinal++}`;\n while (input.priorBlocks && Object.hasOwn(input.priorBlocks, candidate)) {\n candidate = `blk-${ordinal++}`;\n }\n return candidate;\n },\n });\n\n const effectiveFeedOrigin = input.feedOrigin ?? (input.feedSourceId ? 'feed' : undefined);\n const effectiveSeedOrigin = input.seedOrigin ?? (effectiveFeedOrigin === 'feed' ? 'seed' : undefined);\n const sections = parseDocumentSections(rawContent);\n const revisions: BlockRevision[] = [];\n const blockIndex: BlockIndexRow[] = [];\n const blockEfforts: BlockEffort[] = [];\n const blockEquipment: BlockEquipment[] = [];\n const isStatic = effectiveSeedOrigin === 'seed';\n for (const [position, block] of Object.values(blocks).entries()) {\n const slice = rawContent.slice(block.from, block.to);\n // With prior lineage, only newly added or version-bumped blocks emit a\n // revision — unchanged blocks already hold their immutable row.\n if (input.priorBlocks?.[block.id]?.version !== block.version) {\n revisions.push({\n noteId,\n blockId: block.id,\n version: block.version,\n kind: block.kind,\n rawContent: slice,\n savedAt: createdAt,\n ...(block.dialect ? { dialect: block.dialect } : {}),\n ...(block.sport ? { sport: block.sport } : {}),\n });\n }\n\n const section = sections.find(s => s.from === block.from && s.to === block.to);\n const contentId = block.kind === 'wod' ? (section?.scriptBlock?.contentId ?? blockContentId(slice)) : undefined;\n blockIndex.push({\n id: `${noteId}:${block.id}`,\n noteId,\n blockId: block.id,\n blockVersion: block.version,\n sourceRevision,\n from: block.from,\n to: block.to,\n position,\n dataType: block.kind,\n ...(contentId ? { blockContentId: contentId } : {}),\n rawContent: slice,\n noteTitle: title,\n createdAt,\n isStatic,\n ...(input.sourceId ? { sourceId: input.sourceId } : {}),\n ...(input.sourcePath ? { sourcePath: input.sourcePath } : {}),\n ...(input.notebookId ? { notebookId: input.notebookId } : {}),\n });\n\n if (block.kind === 'wod') {\n const body = section?.scriptBlock?.content ?? slice;\n for (const slug of scanMentions(body, EFFORT_VOCABULARY)) {\n blockEfforts.push({\n id: `${noteId}:${block.id}:${slug}`,\n noteId,\n blockId: block.id,\n ...(contentId ? { blockContentId: contentId } : {}),\n effortSlug: slug,\n isStatic,\n ...(input.sourcePath ? { sourcePath: input.sourcePath } : {}),\n createdAt,\n });\n }\n for (const slug of scanMentions(body, EQUIPMENT_VOCABULARY)) {\n blockEquipment.push({\n id: `${noteId}:${block.id}:${slug}`,\n noteId,\n blockId: block.id,\n ...(contentId ? { blockContentId: contentId } : {}),\n equipmentSlug: slug,\n isStatic,\n ...(input.sourcePath ? { sourcePath: input.sourcePath } : {}),\n createdAt,\n });\n }\n }\n }\n\n const tags: Tag[] = [];\n const noteTags: NoteTag[] = [];\n for (const label of input.tags ?? []) {\n const tag: Tag = { id: `tag:${label}`, label, createdAt };\n if (!tags.some(t => t.id === tag.id)) tags.push(tag);\n noteTags.push({ id: `${noteId}:${tag.id}`, noteId, tagId: tag.id });\n }\n\n const notebookIds = input.notebookIds ?? (input.notebookId ? [input.notebookId] : undefined);\n const primaryNotebookId = input.notebookId ?? notebookIds?.[0];\n const notebookLinks: NotebookLink[] = (notebookIds ?? []).map(nbId => ({\n id: `${nbId}:note:${noteId}`,\n notebookId: nbId,\n targetKind: 'note',\n targetId: noteId,\n noteId,\n createdAt,\n }));\n\n const note: Note = {\n id: noteId,\n title,\n rawContent,\n sourceRevision,\n blocks,\n ...(input.date !== undefined ? { date: input.date } : {}),\n createdAt,\n ...(input.type ? { type: input.type } : {}),\n ...(input.sourceId ? { sourceId: input.sourceId } : {}),\n ...(primaryNotebookId ? { notebookId: primaryNotebookId } : {}),\n ...(notebookIds ? { notebookIds } : {}),\n ...(input.provenance ? { provenance: input.provenance } : {}),\n ...(input.tags?.length ? { tags: input.tags } : {}),\n ...(effectiveSeedOrigin ? { seedOrigin: effectiveSeedOrigin } : {}),\n ...(effectiveFeedOrigin ? { feedOrigin: effectiveFeedOrigin } : {}),\n ...(input.feedSourceId ? { feedSourceId: input.feedSourceId } : {}),\n ...(input.sourcePath ? { sourcePath: input.sourcePath } : {}),\n };\n\n return { note, revisions, blockIndex, blockEfforts, blockEquipment, tags, noteTags, notebookLinks };\n}\n\n// ---------------------------------------------------------------------------\n// buildPropertyNote\n// ---------------------------------------------------------------------------\n\nexport interface TestPropertyNoteInput {\n id?: string;\n kind: OverridePropertyKind;\n slug: string;\n label: string;\n notebookId?: string;\n aliases?: string[];\n metrics?: Record<string, string | number>;\n summaries?: Record<string, string | number>;\n baseAttributes?: Record<string, unknown>;\n body?: string;\n seedOrigin?: 'seed' | 'user';\n feedSourceId?: string;\n asOverride?: boolean;\n}\n\nexport interface BuiltPropertyNote {\n note: Note;\n override?: ScopedPropertyOverride;\n}\n\n/**\n * Build a Property Note (effort | equipment | tag | tag-type) with valid\n * YAML frontmatter — `parseEffortFile` / `parseEquipmentFile` /\n * `documentToTag` can consume the result unchanged. When `asOverride` is set\n * (or a notebook scope other than `notebook/defaults` is given) the matching\n * `ScopedPropertyOverride` row is emitted alongside the Note.\n *\n * Effort/equipment slugs register into the mention vocabulary so later\n * `buildTestNote` calls link containing blocks automatically.\n */\nexport function buildPropertyNote(input: TestPropertyNoteInput): BuiltPropertyNote {\n const slug = input.slug.trim().toLowerCase();\n if (!slug) throw new Error('Property note requires a non-empty canonical slug.');\n const kind = input.kind;\n const aliases = input.aliases ?? [];\n const entityId = input.id ?? `${kind}-${slug}`;\n\n const lines: string[] = ['---'];\n lines.push(`id: ${yamlScalar(entityId)}`);\n if (kind === 'equipment') lines.push('type: equipment');\n if (kind === 'tag-type') lines.push('type: tag-type');\n lines.push(`slug: ${yamlScalar(slug)}`);\n lines.push(`label: ${yamlScalar(input.label)}`);\n lines.push(...yamlListLines('aliases', aliases));\n if (input.metrics && Object.keys(input.metrics).length > 0) {\n lines.push('metrics:', ...yamlMapEntries(input.metrics));\n }\n if (input.summaries && Object.keys(input.summaries).length > 0) {\n lines.push('summaries:', ...yamlMapEntries(input.summaries));\n }\n // Effort definitions require a positive `baseAttributes.met` to parse.\n const baseAttributes: Record<string, unknown> = {\n ...(kind === 'effort' ? { met: 5.0 } : {}),\n ...input.baseAttributes,\n };\n if (Object.keys(baseAttributes).length > 0) {\n lines.push('baseAttributes:', ...yamlMapEntries(baseAttributes));\n }\n lines.push('---');\n if (input.body?.trim()) {\n lines.push('', input.body.trim(), '');\n }\n const rawContent = lines.join('\\n');\n\n const createdAt = TEST_EPOCH;\n const seedOrigin = input.seedOrigin ?? 'user';\n const notebookId = input.notebookId !== undefined ? input.notebookId : input.asOverride ? 'notebook/custom' : undefined;\n const wantsOverride = input.asOverride === true || (notebookId !== undefined && notebookId !== 'notebook/defaults');\n const nbSlug = notebookId !== undefined && notebookId.startsWith('notebook/') ? notebookId.slice('notebook/'.length) : notebookId;\n const ownerNoteId = `override/${nbSlug}/${kind}/${slug}`;\n const note: Note = {\n id: input.id ?? (wantsOverride && notebookId ? ownerNoteId : `property/${kind}/${slug}`),\n title: input.label,\n rawContent,\n sourceRevision: 1,\n blocks: {},\n createdAt,\n seedOrigin,\n ...(input.feedSourceId ? { feedSourceId: input.feedSourceId, feedOrigin: 'feed' as const } : {}),\n };\n\n if (kind === 'effort') {\n EFFORT_VOCABULARY.push(slugToMentionEntry(slug, input.label, aliases));\n } else if (kind === 'equipment') {\n EQUIPMENT_VOCABULARY.push(slugToMentionEntry(slug, input.label, aliases));\n }\n\n let override: ScopedPropertyOverride | undefined;\n if (wantsOverride && notebookId !== undefined) {\n const payload: Record<string, unknown> =\n kind === 'effort'\n ? { id: entityId, slug, label: input.label, aliases, baseAttributes, registrySource: 'user', ownerNoteId, sourceId: notebookId, updatedAt: new Date(createdAt).toISOString() }\n : kind === 'equipment'\n ? { id: entityId, slug, label: input.label, aliases, registrySource: 'user', ownerNoteId, sourceId: notebookId, updatedAt: new Date(createdAt).toISOString() }\n : kind === 'tag'\n ? { id: entityId, label: slug, type: 'tag', contributions: [], createdAt }\n : { id: entityId, name: slug, label: input.label, createdAt };\n override = {\n id: `${notebookId}:${kind}:${slug}`,\n notebookId,\n kind,\n slug,\n label: input.label,\n ownerNoteId,\n rawContent,\n payload,\n seedOrigin,\n ...(input.feedSourceId ? { feedSourceId: input.feedSourceId } : {}),\n updatedAt: createdAt,\n };\n }\n\n return { note, override };\n}\n\n// ---------------------------------------------------------------------------\n// buildTestSession\n// ---------------------------------------------------------------------------\n\nexport interface TestSessionInput {\n id?: string;\n noteId: string;\n blockId?: string;\n blockVersion?: number;\n startedAt?: number;\n completedAt?: number;\n durationMs?: number;\n origin?: ResultOrigin;\n isPublic?: boolean;\n notebookIds?: string[];\n events?: Array<Partial<EventRecord> & { id?: string }>;\n}\n\nexport interface BuiltTestSession {\n session: Session;\n events: EventRecord[];\n notebookLinks: NotebookLink[];\n}\n\n/**\n * Build a Session execution log plus its EventRecord rows, pinned to\n * `noteId`/`blockId`/`blockVersion`. Without an explicit block pin the first\n * wod occurrence (`blk-0`) of a `buildTestNote` note is assumed. Session ids\n * default to `session-${noteId}:1`; pass explicit ids when authoring several\n * sessions against one note outside a `buildDomainWorld` sequence.\n */\nexport function buildTestSession(input: TestSessionInput): BuiltTestSession {\n return buildTestSessionAt(input, 1);\n}\n\n/** World-aware variant: `sequence` disambiguates default session ids. */\nfunction buildTestSessionAt(input: TestSessionInput, sequence: number): BuiltTestSession {\n const noteId = input.noteId;\n const blockId = input.blockId ?? 'blk-0';\n const blockVersion = input.blockVersion ?? 1;\n const startedAt = input.startedAt ?? TEST_EPOCH;\n const durationMs = input.durationMs ?? 3_600_000;\n const endTime = input.completedAt ?? startedAt + durationMs;\n\n const session: Session = {\n id: input.id ?? `session-${noteId}:${sequence}`,\n noteId,\n blockId,\n blockVersion,\n origin: input.origin ?? 'journal',\n status: 'completed',\n startTime: startedAt,\n endTime,\n duration: endTime - startedAt,\n completed: true,\n createdAt: startedAt,\n ...(input.isPublic !== undefined ? { public: input.isPublic } : {}),\n ...(input.notebookIds ? { notebookIds: input.notebookIds } : {}),\n };\n\n const events: EventRecord[] = (input.events ?? []).map((event, index) => {\n const record: EventRecord = {\n id: event.id ?? `${session.id}:${index}`,\n resultId: session.id,\n noteId,\n timestamp: startedAt,\n grain: 'event',\n outputType: 'event',\n metrics: [],\n ...event,\n };\n if (record.blockId === undefined) record.blockId = blockId;\n if (record.blockVersion === undefined) record.blockVersion = blockVersion;\n return record;\n });\n\n const notebookLinks: NotebookLink[] = (input.notebookIds ?? []).map(nbId => ({\n id: `${nbId}:session:${session.id}`,\n notebookId: nbId,\n targetKind: 'session',\n targetId: session.id,\n noteId,\n createdAt: startedAt,\n }));\n\n return { session, events, notebookLinks };\n}\n\n// ---------------------------------------------------------------------------\n// buildDomainWorld\n// ---------------------------------------------------------------------------\n\nexport interface DomainWorldInput {\n notes?: TestNoteInput[];\n propertyNotes?: TestPropertyNoteInput[];\n sessions?: TestSessionInput[];\n pages?: Page[];\n pageNotes?: PageNote[];\n}\n\nexport interface DomainWorld {\n notes: Note[];\n revisions: BlockRevision[];\n blockIndex: BlockIndexRow[];\n blockEfforts: BlockEffort[];\n blockEquipment: BlockEquipment[];\n tags: Tag[];\n noteTags: NoteTag[];\n notebooks: Note[];\n notebookLinks: NotebookLink[];\n propertyOverrides: ScopedPropertyOverride[];\n pages: Page[];\n pageNotes: PageNote[];\n sessions: Session[];\n events: EventRecord[];\n}\n\n/**\n * Aggregate a complete deterministic domain snapshot: Notes, Property Notes\n * with their Scoped Property Overrides, notebook landing notes for every\n * referenced notebook, NotebookLinks, pages, sessions and events.\n *\n * Property notes are built FIRST so effort/equipment mentions in note\n * content resolve against their vocabulary; sessions then pin to the first\n * wod block of their note (real block id, version and content fingerprint).\n */\nexport function buildDomainWorld(input: DomainWorldInput = {}): DomainWorld {\n // Property notes first: their slugs feed the mention vocabulary used by\n // every subsequent buildTestNote call below.\n const builtProperties = (input.propertyNotes ?? []).map(buildPropertyNote);\n\n const builtNotes = (input.notes ?? []).map(buildTestNote);\n\n const world: DomainWorld = {\n notes: [],\n revisions: [],\n blockIndex: [],\n blockEfforts: [],\n blockEquipment: [],\n tags: [],\n noteTags: [],\n notebooks: [],\n notebookLinks: [],\n propertyOverrides: [],\n pages: input.pages ?? [],\n pageNotes: input.pageNotes ?? [],\n sessions: [],\n events: [],\n };\n\n const firstWodBlockByNote = new Map<string, { blockId: string; blockVersion: number; blockContentId?: string }>();\n for (const built of builtNotes) {\n world.notes.push(built.note);\n world.revisions.push(...built.revisions);\n world.blockIndex.push(...built.blockIndex);\n world.blockEfforts.push(...built.blockEfforts);\n world.blockEquipment.push(...built.blockEquipment);\n world.tags.push(...built.tags);\n world.noteTags.push(...built.noteTags);\n world.notebookLinks.push(...built.notebookLinks);\n const firstWod = built.blockIndex.find(row => row.dataType === 'wod');\n if (firstWod) {\n firstWodBlockByNote.set(built.note.id, {\n blockId: firstWod.blockId,\n blockVersion: firstWod.blockVersion,\n ...(firstWod.blockContentId ? { blockContentId: firstWod.blockContentId } : {}),\n });\n }\n }\n\n for (const { note, override } of builtProperties) {\n world.notes.push(note);\n if (override) {\n world.propertyOverrides.push(override);\n if (!world.notebooks.some(nb => nb.id === override.notebookId)) world.notebooks.push(notebookLandingNote(override.notebookId));\n }\n }\n\n let sessionSequence = 0;\n for (const sessionInput of input.sessions ?? []) {\n sessionSequence++;\n const pin = firstWodBlockByNote.get(sessionInput.noteId);\n const built = buildTestSessionAt(\n {\n ...sessionInput,\n ...(sessionInput.blockId === undefined && pin ? { blockId: pin.blockId, blockVersion: pin.blockVersion } : {}),\n },\n sessionSequence,\n );\n const blockContentId = built.session.blockContentId ?? pin?.blockContentId;\n const session: Session = { ...built.session, ...(blockContentId ? { blockContentId } : {}) };\n world.sessions.push(session);\n world.events.push(...built.events);\n world.notebookLinks.push(...built.notebookLinks);\n }\n\n // Landing notes for every notebook referenced by notes or sessions.\n const referencedNotebooks = new Set<string>();\n for (const link of world.notebookLinks) referencedNotebooks.add(link.notebookId);\n for (const nbId of referencedNotebooks) {\n if (!world.notebooks.some(nb => nb.id === nbId)) world.notebooks.push(notebookLandingNote(nbId));\n }\n\n return world;\n}\n\n/** Deterministic notebook landing note (`notebook/{slug}` id convention). */\nfunction notebookLandingNote(notebookId: string): Note {\n const slug = notebookId.startsWith('notebook/') ? notebookId.slice('notebook/'.length) : notebookId;\n return {\n id: notebookId,\n title: slug.charAt(0).toUpperCase() + slug.slice(1),\n rawContent: '',\n sourceRevision: 1,\n blocks: {},\n createdAt: TEST_EPOCH,\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitcobblers/wod-wiki-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.2203",
|
|
4
4
|
"description": "Shared data vocabulary for Whiteboard Language & WQL engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"import": "./dist/index.mjs",
|
|
13
13
|
"require": "./dist/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./testing": {
|
|
16
|
+
"types": "./dist/testing.d.ts",
|
|
17
|
+
"import": "./dist/testing.mjs",
|
|
18
|
+
"require": "./dist/testing.cjs"
|
|
14
19
|
}
|
|
15
20
|
},
|
|
16
21
|
"files": [
|