markupr 2.1.8

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.
Files changed (299) hide show
  1. package/.claude/commands/review-feedback.md +47 -0
  2. package/.eslintrc.json +35 -0
  3. package/.github/CODEOWNERS +16 -0
  4. package/.github/FUNDING.yml +1 -0
  5. package/.github/ISSUE_TEMPLATE/bug_report.md +56 -0
  6. package/.github/ISSUE_TEMPLATE/feature_request.md +54 -0
  7. package/.github/PULL_REQUEST_TEMPLATE.md +89 -0
  8. package/.github/dependabot.yml +70 -0
  9. package/.github/workflows/ci.yml +184 -0
  10. package/.github/workflows/deploy-landing.yml +134 -0
  11. package/.github/workflows/nightly.yml +288 -0
  12. package/.github/workflows/release.yml +318 -0
  13. package/CHANGELOG.md +127 -0
  14. package/CLAUDE.md +137 -0
  15. package/CODE_OF_CONDUCT.md +9 -0
  16. package/CONTRIBUTING.md +390 -0
  17. package/LICENSE +21 -0
  18. package/PRODUCT_VISION.md +277 -0
  19. package/README.md +517 -0
  20. package/SECURITY.md +51 -0
  21. package/SIGNING_INSTRUCTIONS.md +284 -0
  22. package/assets/DMG_BACKGROUND_INSTRUCTIONS.md +130 -0
  23. package/assets/svg-source/dmg-background.svg +70 -0
  24. package/assets/svg-source/icon.svg +20 -0
  25. package/assets/svg-source/tray-icon-processing.svg +7 -0
  26. package/assets/svg-source/tray-icon-recording.svg +7 -0
  27. package/assets/svg-source/tray-icon.svg +6 -0
  28. package/assets/tray-complete.png +0 -0
  29. package/assets/tray-complete@2x.png +0 -0
  30. package/assets/tray-completeTemplate.png +0 -0
  31. package/assets/tray-completeTemplate@2x.png +0 -0
  32. package/assets/tray-error.png +0 -0
  33. package/assets/tray-error@2x.png +0 -0
  34. package/assets/tray-errorTemplate.png +0 -0
  35. package/assets/tray-errorTemplate@2x.png +0 -0
  36. package/assets/tray-icon-processing.png +0 -0
  37. package/assets/tray-icon-processing@2x.png +0 -0
  38. package/assets/tray-icon-processingTemplate.png +0 -0
  39. package/assets/tray-icon-processingTemplate@2x.png +0 -0
  40. package/assets/tray-icon-recording.png +0 -0
  41. package/assets/tray-icon-recording@2x.png +0 -0
  42. package/assets/tray-icon-recordingTemplate.png +0 -0
  43. package/assets/tray-icon-recordingTemplate@2x.png +0 -0
  44. package/assets/tray-icon.png +0 -0
  45. package/assets/tray-icon@2x.png +0 -0
  46. package/assets/tray-iconTemplate.png +0 -0
  47. package/assets/tray-iconTemplate@2x.png +0 -0
  48. package/assets/tray-idle.png +0 -0
  49. package/assets/tray-idle@2x.png +0 -0
  50. package/assets/tray-idleTemplate.png +0 -0
  51. package/assets/tray-idleTemplate@2x.png +0 -0
  52. package/assets/tray-processing-0.png +0 -0
  53. package/assets/tray-processing-0@2x.png +0 -0
  54. package/assets/tray-processing-0Template.png +0 -0
  55. package/assets/tray-processing-0Template@2x.png +0 -0
  56. package/assets/tray-processing-1.png +0 -0
  57. package/assets/tray-processing-1@2x.png +0 -0
  58. package/assets/tray-processing-1Template.png +0 -0
  59. package/assets/tray-processing-1Template@2x.png +0 -0
  60. package/assets/tray-processing-2.png +0 -0
  61. package/assets/tray-processing-2@2x.png +0 -0
  62. package/assets/tray-processing-2Template.png +0 -0
  63. package/assets/tray-processing-2Template@2x.png +0 -0
  64. package/assets/tray-processing-3.png +0 -0
  65. package/assets/tray-processing-3@2x.png +0 -0
  66. package/assets/tray-processing-3Template.png +0 -0
  67. package/assets/tray-processing-3Template@2x.png +0 -0
  68. package/assets/tray-processing.png +0 -0
  69. package/assets/tray-processing@2x.png +0 -0
  70. package/assets/tray-processingTemplate.png +0 -0
  71. package/assets/tray-processingTemplate@2x.png +0 -0
  72. package/assets/tray-recording.png +0 -0
  73. package/assets/tray-recording@2x.png +0 -0
  74. package/assets/tray-recordingTemplate.png +0 -0
  75. package/assets/tray-recordingTemplate@2x.png +0 -0
  76. package/build/DMG_BACKGROUND_SPEC.md +50 -0
  77. package/build/dmg-background.png +0 -0
  78. package/build/dmg-background@2x.png +0 -0
  79. package/build/entitlements.mac.inherit.plist +27 -0
  80. package/build/entitlements.mac.plist +41 -0
  81. package/build/favicon-16.png +0 -0
  82. package/build/favicon-180.png +0 -0
  83. package/build/favicon-192.png +0 -0
  84. package/build/favicon-32.png +0 -0
  85. package/build/favicon-48.png +0 -0
  86. package/build/favicon-512.png +0 -0
  87. package/build/favicon-64.png +0 -0
  88. package/build/icon-128.png +0 -0
  89. package/build/icon-16.png +0 -0
  90. package/build/icon-24.png +0 -0
  91. package/build/icon-256.png +0 -0
  92. package/build/icon-32.png +0 -0
  93. package/build/icon-48.png +0 -0
  94. package/build/icon-64.png +0 -0
  95. package/build/icon.icns +0 -0
  96. package/build/icon.ico +0 -0
  97. package/build/icon.iconset/icon_128x128.png +0 -0
  98. package/build/icon.iconset/icon_128x128@2x.png +0 -0
  99. package/build/icon.iconset/icon_16x16.png +0 -0
  100. package/build/icon.iconset/icon_16x16@2x.png +0 -0
  101. package/build/icon.iconset/icon_256x256.png +0 -0
  102. package/build/icon.iconset/icon_256x256@2x.png +0 -0
  103. package/build/icon.iconset/icon_32x32.png +0 -0
  104. package/build/icon.iconset/icon_32x32@2x.png +0 -0
  105. package/build/icon.iconset/icon_512x512.png +0 -0
  106. package/build/icon.iconset/icon_512x512@2x.png +0 -0
  107. package/build/icon.png +0 -0
  108. package/build/installer-header.bmp +0 -0
  109. package/build/installer-header.png +0 -0
  110. package/build/installer-sidebar.bmp +0 -0
  111. package/build/installer-sidebar.png +0 -0
  112. package/build/installer.nsh +45 -0
  113. package/build/overlay-processing.png +0 -0
  114. package/build/overlay-recording.png +0 -0
  115. package/build/toolbar-record.png +0 -0
  116. package/build/toolbar-screenshot.png +0 -0
  117. package/build/toolbar-settings.png +0 -0
  118. package/build/toolbar-stop.png +0 -0
  119. package/dist/main/index.mjs +12612 -0
  120. package/dist/preload/index.mjs +907 -0
  121. package/dist/renderer/assets/index-CCmUjl9K.js +19495 -0
  122. package/dist/renderer/assets/index-CUqz_Gs6.css +2270 -0
  123. package/dist/renderer/index.html +27 -0
  124. package/docs/AI_AGENT_QUICKSTART.md +42 -0
  125. package/docs/AI_PIPELINE_DESIGN.md +595 -0
  126. package/docs/API.md +514 -0
  127. package/docs/ARCHITECTURE.md +460 -0
  128. package/docs/CONFIGURATION.md +336 -0
  129. package/docs/DEVELOPMENT.md +508 -0
  130. package/docs/EXPORT_FORMATS.md +451 -0
  131. package/docs/GETTING_STARTED.md +236 -0
  132. package/docs/KEYBOARD_SHORTCUTS.md +334 -0
  133. package/docs/TROUBLESHOOTING.md +418 -0
  134. package/docs/landing/index.html +672 -0
  135. package/docs/landing/script.js +342 -0
  136. package/docs/landing/styles.css +1543 -0
  137. package/electron-builder.yml +140 -0
  138. package/electron.vite.config.ts +63 -0
  139. package/package.json +108 -0
  140. package/railway.json +12 -0
  141. package/scripts/build.mjs +51 -0
  142. package/scripts/generate-icons.mjs +314 -0
  143. package/scripts/generate-installer-images.cjs +253 -0
  144. package/scripts/generate-tray-icons.mjs +258 -0
  145. package/scripts/notarize.cjs +180 -0
  146. package/scripts/one-click-clean-test.sh +147 -0
  147. package/scripts/postinstall.mjs +36 -0
  148. package/scripts/setup-markupr.sh +55 -0
  149. package/setup +17 -0
  150. package/site/index.html +1835 -0
  151. package/site/package.json +11 -0
  152. package/site/railway.json +12 -0
  153. package/site/server.js +31 -0
  154. package/src/main/AutoUpdater.ts +392 -0
  155. package/src/main/CrashRecovery.ts +655 -0
  156. package/src/main/ErrorHandler.ts +703 -0
  157. package/src/main/HotkeyManager.ts +399 -0
  158. package/src/main/MenuManager.ts +529 -0
  159. package/src/main/PermissionManager.ts +420 -0
  160. package/src/main/SessionController.ts +1465 -0
  161. package/src/main/TrayManager.ts +540 -0
  162. package/src/main/ai/AIPipelineManager.ts +199 -0
  163. package/src/main/ai/ClaudeAnalyzer.ts +339 -0
  164. package/src/main/ai/ImageOptimizer.ts +176 -0
  165. package/src/main/ai/StructuredMarkdownBuilder.ts +379 -0
  166. package/src/main/ai/index.ts +16 -0
  167. package/src/main/ai/types.ts +258 -0
  168. package/src/main/analysis/ClarificationGenerator.ts +385 -0
  169. package/src/main/analysis/FeedbackAnalyzer.ts +531 -0
  170. package/src/main/analysis/index.ts +19 -0
  171. package/src/main/audio/AudioCapture.ts +978 -0
  172. package/src/main/audio/audioUtils.ts +100 -0
  173. package/src/main/audio/index.ts +20 -0
  174. package/src/main/capture/index.ts +1 -0
  175. package/src/main/index.ts +1693 -0
  176. package/src/main/ipc/captureHandlers.ts +272 -0
  177. package/src/main/ipc/index.ts +45 -0
  178. package/src/main/ipc/outputHandlers.ts +302 -0
  179. package/src/main/ipc/sessionHandlers.ts +56 -0
  180. package/src/main/ipc/settingsHandlers.ts +471 -0
  181. package/src/main/ipc/types.ts +56 -0
  182. package/src/main/ipc/windowHandlers.ts +277 -0
  183. package/src/main/output/ClipboardService.ts +369 -0
  184. package/src/main/output/ExportService.ts +539 -0
  185. package/src/main/output/FileManager.ts +416 -0
  186. package/src/main/output/MarkdownGenerator.ts +791 -0
  187. package/src/main/output/MarkdownPatcher.ts +299 -0
  188. package/src/main/output/index.ts +186 -0
  189. package/src/main/output/sessionAdapter.ts +207 -0
  190. package/src/main/output/templates/html-template.ts +553 -0
  191. package/src/main/pipeline/FrameExtractor.ts +330 -0
  192. package/src/main/pipeline/PostProcessor.ts +399 -0
  193. package/src/main/pipeline/TranscriptAnalyzer.ts +226 -0
  194. package/src/main/pipeline/index.ts +36 -0
  195. package/src/main/platform/WindowsTaskbar.ts +600 -0
  196. package/src/main/platform/index.ts +16 -0
  197. package/src/main/settings/SettingsManager.ts +730 -0
  198. package/src/main/settings/index.ts +19 -0
  199. package/src/main/transcription/ModelDownloadManager.ts +494 -0
  200. package/src/main/transcription/TierManager.ts +219 -0
  201. package/src/main/transcription/TranscriptionRecoveryService.ts +340 -0
  202. package/src/main/transcription/WhisperService.ts +748 -0
  203. package/src/main/transcription/index.ts +56 -0
  204. package/src/main/transcription/types.ts +135 -0
  205. package/src/main/windows/PopoverManager.ts +284 -0
  206. package/src/main/windows/TaskbarIntegration.ts +452 -0
  207. package/src/main/windows/index.ts +23 -0
  208. package/src/preload/index.ts +1047 -0
  209. package/src/renderer/App.tsx +515 -0
  210. package/src/renderer/AppWrapper.tsx +28 -0
  211. package/src/renderer/assets/logo-dark.svg +7 -0
  212. package/src/renderer/assets/logo.svg +7 -0
  213. package/src/renderer/audio/AudioCaptureRenderer.ts +454 -0
  214. package/src/renderer/capture/ScreenRecordingRenderer.ts +492 -0
  215. package/src/renderer/components/AnnotationOverlay.tsx +836 -0
  216. package/src/renderer/components/AudioWaveform.tsx +811 -0
  217. package/src/renderer/components/ClarificationQuestions.tsx +656 -0
  218. package/src/renderer/components/CountdownTimer.tsx +495 -0
  219. package/src/renderer/components/CrashRecoveryDialog.tsx +632 -0
  220. package/src/renderer/components/DonateButton.tsx +127 -0
  221. package/src/renderer/components/ErrorBoundary.tsx +308 -0
  222. package/src/renderer/components/ExportDialog.tsx +872 -0
  223. package/src/renderer/components/HotkeyHint.tsx +261 -0
  224. package/src/renderer/components/KeyboardShortcuts.tsx +787 -0
  225. package/src/renderer/components/ModelDownloadDialog.tsx +844 -0
  226. package/src/renderer/components/Onboarding.tsx +1830 -0
  227. package/src/renderer/components/ProcessingOverlay.tsx +157 -0
  228. package/src/renderer/components/RecordingOverlay.tsx +423 -0
  229. package/src/renderer/components/SessionHistory.tsx +1746 -0
  230. package/src/renderer/components/SessionReview.tsx +1321 -0
  231. package/src/renderer/components/SettingsPanel.tsx +217 -0
  232. package/src/renderer/components/Skeleton.tsx +347 -0
  233. package/src/renderer/components/StatusIndicator.tsx +86 -0
  234. package/src/renderer/components/ThemeProvider.tsx +429 -0
  235. package/src/renderer/components/Tooltip.tsx +370 -0
  236. package/src/renderer/components/TranscriptionPreview.tsx +183 -0
  237. package/src/renderer/components/TranscriptionTierSelector.tsx +640 -0
  238. package/src/renderer/components/UpdateNotification.tsx +377 -0
  239. package/src/renderer/components/WindowSelector.tsx +947 -0
  240. package/src/renderer/components/index.ts +99 -0
  241. package/src/renderer/components/primitives/ApiKeyInput.tsx +98 -0
  242. package/src/renderer/components/primitives/ColorPicker.tsx +65 -0
  243. package/src/renderer/components/primitives/DangerButton.tsx +45 -0
  244. package/src/renderer/components/primitives/DirectoryPicker.tsx +41 -0
  245. package/src/renderer/components/primitives/Dropdown.tsx +34 -0
  246. package/src/renderer/components/primitives/KeyRecorder.tsx +117 -0
  247. package/src/renderer/components/primitives/SettingsSection.tsx +32 -0
  248. package/src/renderer/components/primitives/Slider.tsx +43 -0
  249. package/src/renderer/components/primitives/Toggle.tsx +36 -0
  250. package/src/renderer/components/primitives/index.ts +10 -0
  251. package/src/renderer/components/settings/AdvancedTab.tsx +174 -0
  252. package/src/renderer/components/settings/AppearanceTab.tsx +77 -0
  253. package/src/renderer/components/settings/GeneralTab.tsx +40 -0
  254. package/src/renderer/components/settings/HotkeysTab.tsx +79 -0
  255. package/src/renderer/components/settings/RecordingTab.tsx +84 -0
  256. package/src/renderer/components/settings/index.ts +9 -0
  257. package/src/renderer/components/settings/settingsStyles.ts +673 -0
  258. package/src/renderer/components/settings/tabConfig.tsx +85 -0
  259. package/src/renderer/components/settings/useSettingsPanel.ts +447 -0
  260. package/src/renderer/contexts/ProcessingContext.tsx +227 -0
  261. package/src/renderer/contexts/RecordingContext.tsx +683 -0
  262. package/src/renderer/contexts/UIContext.tsx +326 -0
  263. package/src/renderer/contexts/index.ts +24 -0
  264. package/src/renderer/donateMessages.ts +69 -0
  265. package/src/renderer/hooks/index.ts +75 -0
  266. package/src/renderer/hooks/useAnimation.tsx +544 -0
  267. package/src/renderer/hooks/useTheme.ts +313 -0
  268. package/src/renderer/index.html +26 -0
  269. package/src/renderer/main.tsx +52 -0
  270. package/src/renderer/styles/animations.css +1093 -0
  271. package/src/renderer/styles/app-shell.css +662 -0
  272. package/src/renderer/styles/globals.css +515 -0
  273. package/src/renderer/styles/theme.ts +578 -0
  274. package/src/renderer/types/electron.d.ts +385 -0
  275. package/src/shared/hotkeys.ts +283 -0
  276. package/src/shared/types.ts +809 -0
  277. package/tests/clipboard.test.ts +228 -0
  278. package/tests/e2e/criticalPaths.test.ts +594 -0
  279. package/tests/feedbackAnalyzer.test.ts +303 -0
  280. package/tests/integration/sessionFlow.test.ts +583 -0
  281. package/tests/markdownGenerator.test.ts +418 -0
  282. package/tests/output.test.ts +96 -0
  283. package/tests/setup.ts +486 -0
  284. package/tests/unit/appIntegration.test.ts +676 -0
  285. package/tests/unit/appViewState.test.ts +281 -0
  286. package/tests/unit/audioIpcChannels.test.ts +17 -0
  287. package/tests/unit/exportService.test.ts +492 -0
  288. package/tests/unit/hotkeys.test.ts +92 -0
  289. package/tests/unit/navigationPreload.test.ts +94 -0
  290. package/tests/unit/onboardingFlow.test.ts +345 -0
  291. package/tests/unit/permissionManager.test.ts +175 -0
  292. package/tests/unit/permissionManagerExpanded.test.ts +296 -0
  293. package/tests/unit/screenRecordingRenderer.test.ts +368 -0
  294. package/tests/unit/sessionController.test.ts +515 -0
  295. package/tests/unit/tierManager.test.ts +61 -0
  296. package/tests/unit/tierManagerExpanded.test.ts +142 -0
  297. package/tests/unit/transcriptAnalyzer.test.ts +64 -0
  298. package/tsconfig.json +25 -0
  299. package/vitest.config.ts +46 -0
@@ -0,0 +1,791 @@
1
+ /**
2
+ * MarkdownGenerator - AI-Ready Output Generator for markupr
3
+ *
4
+ * Generates structured Markdown documents following llms.txt-inspired format.
5
+ * Designed to be easily parsed by AI coding assistants like Claude Code.
6
+ *
7
+ * Features:
8
+ * - Full document with all feedback items, screenshots, and metadata
9
+ * - Clipboard summary (<1500 chars) for quick sharing
10
+ * - File references for images (no base64 bloat)
11
+ * - Consistent FB-XXX item numbering
12
+ */
13
+
14
+ import * as path from 'path';
15
+ import type { FeedbackSession, Screenshot, TranscriptionSegment } from '../../shared/types';
16
+ import type { PostProcessResult, TranscriptSegment, ExtractedFrame } from '../pipeline/PostProcessor';
17
+
18
+ const REPORT_SUPPORT_LINE = '*If this report saved you time, support development: [Ko-fi](https://ko-fi.com/eddiesanjuan)*';
19
+
20
+ // ============================================================================
21
+ // Types for Enhanced Output Generation
22
+ // ============================================================================
23
+
24
+ /**
25
+ * Category types for feedback items
26
+ */
27
+ export type FeedbackCategory = 'Bug' | 'UX Issue' | 'Suggestion' | 'Performance' | 'Question' | 'General';
28
+
29
+ /**
30
+ * Severity levels for prioritization
31
+ */
32
+ export type FeedbackSeverity = 'Critical' | 'High' | 'Medium' | 'Low';
33
+
34
+ /**
35
+ * A single feedback item with transcription and associated screenshots
36
+ */
37
+ export interface FeedbackItem {
38
+ id: string;
39
+ transcription: string;
40
+ timestamp: number;
41
+ screenshots: Screenshot[];
42
+ title?: string;
43
+ keywords?: string[];
44
+ category?: FeedbackCategory;
45
+ severity?: FeedbackSeverity;
46
+ }
47
+
48
+ /**
49
+ * Session metadata for context
50
+ */
51
+ export interface SessionMetadata {
52
+ os?: string;
53
+ sourceName?: string;
54
+ sourceType?: 'screen' | 'window';
55
+ }
56
+
57
+ /**
58
+ * Enhanced session structure for markdown generation
59
+ */
60
+ export interface Session {
61
+ id: string;
62
+ startTime: number;
63
+ endTime?: number;
64
+ feedbackItems: FeedbackItem[];
65
+ metadata?: SessionMetadata;
66
+ }
67
+
68
+ /**
69
+ * Options for generating the full markdown document
70
+ */
71
+ export interface GenerateOptions {
72
+ projectName: string;
73
+ screenshotDir: string; // Relative path for image references
74
+ }
75
+
76
+ /**
77
+ * The generated markdown document with metadata
78
+ */
79
+ export interface MarkdownDocument {
80
+ content: string;
81
+ filename: string;
82
+ metadata: {
83
+ itemCount: number;
84
+ screenshotCount: number;
85
+ duration: number;
86
+ types: Record<string, number>;
87
+ };
88
+ }
89
+
90
+ /**
91
+ * Interface for the MarkdownGenerator
92
+ */
93
+ export interface IMarkdownGenerator {
94
+ generateFullDocument(session: Session, options: GenerateOptions): MarkdownDocument;
95
+ generateFromPostProcess(result: PostProcessResult, sessionDir: string): string;
96
+ generateClipboardSummary(session: Session, projectName?: string): string;
97
+ generateFeedbackItemId(index: number): string;
98
+ }
99
+
100
+ // ============================================================================
101
+ // Adapter: Convert FeedbackSession to Session
102
+ // ============================================================================
103
+
104
+ /**
105
+ * Convert the existing FeedbackSession type to the enhanced Session type.
106
+ * Groups transcription segments with their associated screenshots.
107
+ */
108
+ export function adaptFeedbackSession(
109
+ feedbackSession: FeedbackSession,
110
+ options?: { pauseThresholdMs?: number }
111
+ ): Session {
112
+ const pauseThreshold = options?.pauseThresholdMs ?? 1500;
113
+ const { id, startedAt, endedAt, screenshots, transcription } = feedbackSession;
114
+
115
+ // Group transcription segments into feedback items
116
+ // A new item starts when there's a significant pause between segments
117
+ const feedbackItems: FeedbackItem[] = [];
118
+ let currentItem: FeedbackItem | null = null;
119
+
120
+ const sortedTranscription = [...transcription].sort((a, b) => a.startTime - b.startTime);
121
+ const sortedScreenshots = [...screenshots].sort((a, b) => a.timestamp - b.timestamp);
122
+
123
+ for (const segment of sortedTranscription) {
124
+ const shouldStartNewItem =
125
+ !currentItem ||
126
+ (segment.startTime - (currentItem.timestamp + getPreviousSegmentDuration(currentItem, sortedTranscription))) > pauseThreshold;
127
+
128
+ if (shouldStartNewItem) {
129
+ // Save previous item
130
+ if (currentItem) {
131
+ feedbackItems.push(currentItem);
132
+ }
133
+
134
+ // Start new item
135
+ currentItem = {
136
+ id: `item-${feedbackItems.length + 1}`,
137
+ transcription: segment.text,
138
+ timestamp: segment.startTime,
139
+ screenshots: [],
140
+ category: inferCategory(segment.text),
141
+ };
142
+ } else if (currentItem) {
143
+ // Continue current item
144
+ currentItem.transcription += ' ' + segment.text;
145
+ }
146
+ }
147
+
148
+ // Don't forget the last item
149
+ if (currentItem) {
150
+ feedbackItems.push(currentItem);
151
+ }
152
+
153
+ // Associate screenshots with feedback items
154
+ for (const screenshot of sortedScreenshots) {
155
+ // Find the feedback item that this screenshot belongs to
156
+ // (screenshot timestamp falls within or just after the item's timeframe)
157
+ const matchingItem = findMatchingItem(feedbackItems, screenshot.timestamp, pauseThreshold);
158
+ if (matchingItem) {
159
+ matchingItem.screenshots.push(screenshot);
160
+ } else if (feedbackItems.length > 0) {
161
+ // Associate with the last item if no match found
162
+ feedbackItems[feedbackItems.length - 1].screenshots.push(screenshot);
163
+ }
164
+ }
165
+
166
+ return {
167
+ id,
168
+ startTime: startedAt,
169
+ endTime: endedAt,
170
+ feedbackItems,
171
+ metadata: {
172
+ os: process?.platform || 'Unknown',
173
+ sourceName: 'markupr Session',
174
+ sourceType: 'screen',
175
+ },
176
+ };
177
+ }
178
+
179
+ function getPreviousSegmentDuration(item: FeedbackItem, _allSegments: TranscriptionSegment[]): number {
180
+ // Estimate duration based on transcription length (rough: 150 words/min)
181
+ const words = item.transcription.split(/\s+/).length;
182
+ return (words / 150) * 60 * 1000; // ms
183
+ }
184
+
185
+ function findMatchingItem(
186
+ items: FeedbackItem[],
187
+ timestamp: number,
188
+ threshold: number
189
+ ): FeedbackItem | undefined {
190
+ // Find item where screenshot timestamp is within item timeframe + threshold
191
+ for (let i = items.length - 1; i >= 0; i--) {
192
+ const item = items[i];
193
+ const estimatedDuration = (item.transcription.split(/\s+/).length / 150) * 60 * 1000;
194
+ const itemEnd = item.timestamp + estimatedDuration + threshold;
195
+
196
+ if (timestamp >= item.timestamp && timestamp <= itemEnd) {
197
+ return item;
198
+ }
199
+ }
200
+ return undefined;
201
+ }
202
+
203
+ function inferCategory(text: string): FeedbackCategory {
204
+ const lowerText = text.toLowerCase();
205
+
206
+ if (lowerText.includes('bug') || lowerText.includes('broken') || lowerText.includes('error') ||
207
+ lowerText.includes('crash') || lowerText.includes('doesn\'t work') || lowerText.includes('not working')) {
208
+ return 'Bug';
209
+ }
210
+
211
+ if (lowerText.includes('confusing') || lowerText.includes('hard to') || lowerText.includes('unclear') ||
212
+ lowerText.includes('ux') || lowerText.includes('user experience') || lowerText.includes('usability')) {
213
+ return 'UX Issue';
214
+ }
215
+
216
+ if (lowerText.includes('slow') || lowerText.includes('lag') || lowerText.includes('sluggish') ||
217
+ lowerText.includes('performance') || lowerText.includes('latency') || lowerText.includes('janky')) {
218
+ return 'Performance';
219
+ }
220
+
221
+ if (lowerText.includes('should') || lowerText.includes('could') || lowerText.includes('would be nice') ||
222
+ lowerText.includes('suggestion') || lowerText.includes('feature') || lowerText.includes('add')) {
223
+ return 'Suggestion';
224
+ }
225
+
226
+ if (lowerText.includes('?') || lowerText.includes('how') || lowerText.includes('why') ||
227
+ lowerText.includes('what') || lowerText.includes('question')) {
228
+ return 'Question';
229
+ }
230
+
231
+ return 'General';
232
+ }
233
+
234
+ // ============================================================================
235
+ // MarkdownGenerator Implementation
236
+ // ============================================================================
237
+
238
+ class MarkdownGeneratorImpl implements IMarkdownGenerator {
239
+ /**
240
+ * Generate a full markdown document with all feedback items and metadata.
241
+ * Follows llms.txt-inspired format for AI readability.
242
+ */
243
+ generateFullDocument(session: Session, options: GenerateOptions): MarkdownDocument {
244
+ const { projectName, screenshotDir } = options;
245
+ const items = session.feedbackItems;
246
+ const duration = session.endTime
247
+ ? this.formatDuration(session.endTime - session.startTime)
248
+ : 'In Progress';
249
+ const timestamp = this.formatTimestamp(session.endTime || Date.now());
250
+ const filename = this.generateFilename(projectName, session.startTime);
251
+
252
+ // Early return for empty sessions — produce a clean minimal document
253
+ if (items.length === 0) {
254
+ const content = `# ${projectName} Feedback Report
255
+ > Generated by markupr on ${timestamp}
256
+ > Duration: ${duration}
257
+
258
+ _No feedback items were captured during this session._
259
+
260
+ ---
261
+ *Generated by [markupr](https://markupr.com)*
262
+ ${REPORT_SUPPORT_LINE}
263
+ `;
264
+ return {
265
+ content,
266
+ filename,
267
+ metadata: {
268
+ itemCount: 0,
269
+ screenshotCount: 0,
270
+ duration: session.endTime ? session.endTime - session.startTime : 0,
271
+ types: {},
272
+ },
273
+ };
274
+ }
275
+
276
+ // Count types
277
+ const typeCounts = this.countTypes(items);
278
+ const severityCounts = this.countSeverities(items);
279
+ const screenshotCount = this.countScreenshots(items);
280
+ const topThemes = this.extractTopThemes(items);
281
+ const highImpactCount = (severityCounts.Critical || 0) + (severityCounts.High || 0);
282
+
283
+ let content = `# ${projectName} Feedback Report
284
+ > Generated by markupr on ${timestamp}
285
+ > Duration: ${duration} | Items: ${items.length} | Screenshots: ${screenshotCount}
286
+
287
+ ## Session Overview
288
+ - **Session ID:** \`${session.id}\`
289
+ - **Source:** ${session.metadata?.sourceName || 'Unknown'} (${session.metadata?.sourceType || 'screen'})
290
+ - **Environment:** ${session.metadata?.os || 'Unknown'}
291
+ - **High-impact items:** ${highImpactCount}
292
+
293
+ ---
294
+
295
+ ## Executive Summary
296
+
297
+ - ${items.length} total feedback items were captured.
298
+ - ${highImpactCount} items are categorized as **Critical** or **High** priority.
299
+ - ${screenshotCount} screenshots were aligned to spoken context.
300
+ `;
301
+
302
+ if (topThemes.length > 0) {
303
+ content += `- Top themes: ${topThemes.join(', ')}.\n`;
304
+ }
305
+
306
+ content += `
307
+ ---
308
+
309
+ ## Actionable Feedback
310
+
311
+ `;
312
+
313
+ items.forEach((item, index) => {
314
+ const id = this.generateFeedbackItemId(index);
315
+ const title = item.title || this.generateTitle(item.transcription);
316
+ const itemTimestamp = this.formatItemTimestamp(item.timestamp - session.startTime);
317
+ const category = item.category || 'General';
318
+ const severity = item.severity || this.defaultSeverityForCategory(category);
319
+ const signals = item.keywords?.slice(0, 5) || [];
320
+ const suggestedAction = this.suggestAction(category, severity, item.transcription);
321
+
322
+ content += `### ${id}: ${title}
323
+ - **Severity:** ${severity}
324
+ - **Type:** ${category}
325
+ - **Timestamp:** ${itemTimestamp}
326
+ `;
327
+
328
+ if (signals.length > 0) {
329
+ content += `- **Signals:** ${signals.join(', ')}\n`;
330
+ }
331
+
332
+ content += `
333
+ #### What Happened
334
+
335
+ > ${this.wrapTranscription(item.transcription)}
336
+
337
+ `;
338
+
339
+ if (item.screenshots.length > 0) {
340
+ content += `#### Evidence\n`;
341
+ item.screenshots.forEach((ss, ssIndex) => {
342
+ // Use the item's position index (not the FB-XXX display ID) for the
343
+ // filename so it stays aligned with FileManager.saveSession which
344
+ // names files by the original feedbackItems array index.
345
+ const screenshotFilename = this.generateScreenshotFilename(index, ssIndex, item.screenshots.length);
346
+ content += `![${id}${item.screenshots.length > 1 ? `-${ssIndex + 1}` : ''}](${screenshotDir}/${screenshotFilename})\n\n`;
347
+ });
348
+ } else {
349
+ content += `#### Evidence\n_No screenshot captured for this item._\n\n`;
350
+ }
351
+
352
+ content += `#### Suggested Next Step
353
+ - ${suggestedAction}
354
+
355
+ `;
356
+
357
+ content += `---
358
+
359
+ `;
360
+ });
361
+
362
+ // Summary tables
363
+ content += `## Summary
364
+
365
+ | Type | Count |
366
+ |------|-------|
367
+ `;
368
+ Object.entries(typeCounts).forEach(([type, count]) => {
369
+ content += `| ${type} | ${count} |\n`;
370
+ });
371
+ content += `| **Total** | **${items.length}** |\n`;
372
+
373
+ content += `
374
+ | Severity | Count |
375
+ |----------|-------|
376
+ `;
377
+ Object.entries(severityCounts).forEach(([severity, count]) => {
378
+ content += `| ${severity} | ${count} |\n`;
379
+ });
380
+ content += `| **Total** | **${items.length}** |\n`;
381
+
382
+ content += `
383
+ ---
384
+ *Generated by [markupr](https://markupr.com)*
385
+ ${REPORT_SUPPORT_LINE}
386
+ `;
387
+
388
+ return {
389
+ content,
390
+ filename,
391
+ metadata: {
392
+ itemCount: items.length,
393
+ screenshotCount,
394
+ duration: session.endTime ? session.endTime - session.startTime : 0,
395
+ types: typeCounts,
396
+ },
397
+ };
398
+ }
399
+
400
+ /**
401
+ * Generate markdown from a PostProcessResult (post-recording pipeline output).
402
+ *
403
+ * Produces a clean, AI-readable document with:
404
+ * - Session header with human-readable timestamp
405
+ * - Each transcript segment as a heading with [M:SS] timestamp
406
+ * - Blockquoted transcript text
407
+ * - Associated frame images referenced as relative paths
408
+ *
409
+ * @param result - The combined transcript + frame output from PostProcessor
410
+ * @param sessionDir - Absolute path to the session directory (used to compute relative frame paths)
411
+ * @returns The generated markdown string
412
+ */
413
+ generateFromPostProcess(result: PostProcessResult, sessionDir: string): string {
414
+ const { transcriptSegments, extractedFrames } = result;
415
+ const now = new Date();
416
+ const sessionTimestamp = now.toLocaleString('en-US', {
417
+ year: 'numeric',
418
+ month: 'short',
419
+ day: 'numeric',
420
+ hour: '2-digit',
421
+ minute: '2-digit',
422
+ });
423
+
424
+ let md = `# markupr Session — ${sessionTimestamp}\n\n`;
425
+
426
+ if (transcriptSegments.length === 0) {
427
+ md += `_No speech was detected during this recording._\n`;
428
+ return md;
429
+ }
430
+
431
+ md += `## Transcript\n\n`;
432
+
433
+ // Build a map from transcript segment index to associated frames.
434
+ // A frame is associated with the segment whose time range contains the
435
+ // frame timestamp, or the closest segment by start time.
436
+ const segmentFrameMap = this.mapFramesToSegments(transcriptSegments, extractedFrames);
437
+
438
+ for (let i = 0; i < transcriptSegments.length; i++) {
439
+ const segment = transcriptSegments[i];
440
+ const formattedTime = this.formatPostProcessTimestamp(segment.startTime);
441
+ const title = this.generateSegmentTitle(segment.text);
442
+
443
+ md += `### [${formattedTime}] ${title}\n`;
444
+ md += `> ${this.wrapTranscription(segment.text)}\n\n`;
445
+
446
+ // Append any frames associated with this segment
447
+ const frames = segmentFrameMap.get(i);
448
+ if (frames && frames.length > 0) {
449
+ for (const frame of frames) {
450
+ const frameTimestamp = this.formatPostProcessTimestamp(frame.timestamp);
451
+ const relativePath = this.computeRelativeFramePath(frame.path, sessionDir);
452
+ md += `![Frame at ${frameTimestamp}](${relativePath})\n\n`;
453
+ }
454
+ }
455
+ }
456
+
457
+ md += `---\n*Generated by [markupr](https://markupr.com)*\n${REPORT_SUPPORT_LINE}\n`;
458
+
459
+ return md;
460
+ }
461
+
462
+ /**
463
+ * Map extracted frames to their closest transcript segments.
464
+ * Returns a Map from segment index to an array of frames.
465
+ */
466
+ private mapFramesToSegments(
467
+ segments: TranscriptSegment[],
468
+ frames: ExtractedFrame[]
469
+ ): Map<number, ExtractedFrame[]> {
470
+ const map = new Map<number, ExtractedFrame[]>();
471
+
472
+ for (const frame of frames) {
473
+ let bestIndex = 0;
474
+ let bestDistance = Infinity;
475
+
476
+ for (let i = 0; i < segments.length; i++) {
477
+ const seg = segments[i];
478
+
479
+ // If the frame timestamp falls within the segment range, it is a direct match
480
+ if (frame.timestamp >= seg.startTime && frame.timestamp <= seg.endTime) {
481
+ bestIndex = i;
482
+ bestDistance = 0;
483
+ break;
484
+ }
485
+
486
+ // Otherwise track the closest segment by start time
487
+ const distance = Math.abs(frame.timestamp - seg.startTime);
488
+ if (distance < bestDistance) {
489
+ bestDistance = distance;
490
+ bestIndex = i;
491
+ }
492
+ }
493
+
494
+ const existing = map.get(bestIndex) || [];
495
+ existing.push(frame);
496
+ map.set(bestIndex, existing);
497
+ }
498
+
499
+ // Sort frames within each segment by timestamp
500
+ for (const [, frameList] of map) {
501
+ frameList.sort((a, b) => a.timestamp - b.timestamp);
502
+ }
503
+
504
+ return map;
505
+ }
506
+
507
+ /**
508
+ * Compute a relative path for a frame image from the session directory.
509
+ * If the frame path is already relative, return it as-is.
510
+ * If absolute, compute the relative path from sessionDir.
511
+ */
512
+ private computeRelativeFramePath(framePath: string, sessionDir: string): string {
513
+ if (!path.isAbsolute(framePath)) {
514
+ return framePath;
515
+ }
516
+ return path.relative(sessionDir, framePath);
517
+ }
518
+
519
+ /**
520
+ * Format a timestamp in seconds to M:SS format for post-process output.
521
+ * Examples: 0 -> "0:00", 15.3 -> "0:15", 125 -> "2:05"
522
+ */
523
+ private formatPostProcessTimestamp(seconds: number): string {
524
+ const totalSeconds = Math.max(0, Math.floor(seconds));
525
+ const mins = Math.floor(totalSeconds / 60);
526
+ const secs = totalSeconds % 60;
527
+ return `${mins}:${secs.toString().padStart(2, '0')}`;
528
+ }
529
+
530
+ /**
531
+ * Generate a short title from transcript text (first sentence, max 60 chars).
532
+ */
533
+ private generateSegmentTitle(text: string): string {
534
+ const firstSentence = text.split(/[.!?]/)[0].trim();
535
+ if (firstSentence.length <= 60) return firstSentence;
536
+ return firstSentence.slice(0, 57) + '...';
537
+ }
538
+
539
+ /**
540
+ * Generate a clipboard-friendly summary (<1500 chars).
541
+ * Includes priority items and a reference to the full report.
542
+ */
543
+ generateClipboardSummary(session: Session, projectName?: string): string {
544
+ const name = projectName || session.metadata?.sourceName || 'Project';
545
+ const items = session.feedbackItems;
546
+
547
+ let summary = `# Feedback: ${name} - ${items.length} items\n\n`;
548
+
549
+ // Priority items (first 3)
550
+ const maxPriorityItems = 3;
551
+ summary += `## Priority Items\n`;
552
+
553
+ items.slice(0, maxPriorityItems).forEach((item, index) => {
554
+ const id = this.generateFeedbackItemId(index);
555
+ const title = this.generateTitle(item.transcription);
556
+ const oneLineSummary = this.truncateText(item.transcription, 60);
557
+ summary += `- **${id}:** ${title} - ${oneLineSummary}\n`;
558
+ });
559
+
560
+ if (items.length > maxPriorityItems) {
561
+ const remainingIds = items
562
+ .slice(maxPriorityItems)
563
+ .map((_, i) => this.generateFeedbackItemId(i + maxPriorityItems))
564
+ .join(', ');
565
+ summary += `\n## Other\n- ${remainingIds} (see full report)\n`;
566
+ }
567
+
568
+ summary += `\n**Full report:** ./feedback-report.md`;
569
+
570
+ // Ensure we stay under 1500 chars
571
+ if (summary.length > 1500) {
572
+ summary = summary.slice(0, 1497) + '...';
573
+ }
574
+
575
+ return summary;
576
+ }
577
+
578
+ /**
579
+ * Generate a feedback item ID (FB-001, FB-002, etc.)
580
+ */
581
+ generateFeedbackItemId(index: number): string {
582
+ return `FB-${(index + 1).toString().padStart(3, '0')}`;
583
+ }
584
+
585
+ // ==========================================================================
586
+ // Private Helper Methods
587
+ // ==========================================================================
588
+
589
+ /**
590
+ * Generate a title from the transcription (first sentence or 50 chars)
591
+ */
592
+ private generateTitle(transcription: string): string {
593
+ // Extract first sentence
594
+ const firstSentence = transcription.split(/[.!?]/)[0].trim();
595
+ if (firstSentence.length <= 50) return firstSentence;
596
+ return firstSentence.slice(0, 47) + '...';
597
+ }
598
+
599
+ /**
600
+ * Truncate text to specified length
601
+ */
602
+ private truncateText(text: string, maxLength: number): string {
603
+ if (text.length <= maxLength) return text;
604
+ return text.slice(0, maxLength - 3) + '...';
605
+ }
606
+
607
+ /**
608
+ * Wrap transcription for markdown blockquote (handle multi-line)
609
+ */
610
+ private wrapTranscription(transcription: string): string {
611
+ // Split by natural sentence breaks for readability
612
+ const sentences = transcription.match(/[^.!?]+[.!?]+/g);
613
+ if (!sentences) return transcription;
614
+
615
+ // Append any trailing text that doesn't end with punctuation.
616
+ // Whisper transcripts frequently end mid-sentence.
617
+ const lastMatch = sentences[sentences.length - 1];
618
+ const lastMatchEnd = transcription.lastIndexOf(lastMatch) + lastMatch.length;
619
+ const remainder = transcription.slice(lastMatchEnd).trim();
620
+ if (remainder) {
621
+ sentences.push(remainder);
622
+ }
623
+
624
+ if (sentences.length <= 2) return transcription;
625
+
626
+ // For longer transcriptions, add line breaks between sentences
627
+ return sentences.map(s => s.trim()).join('\n> ');
628
+ }
629
+
630
+ /**
631
+ * Format duration from milliseconds to M:SS
632
+ */
633
+ private formatDuration(ms: number): string {
634
+ const totalSeconds = Math.floor(ms / 1000);
635
+ const mins = Math.floor(totalSeconds / 60);
636
+ const secs = totalSeconds % 60;
637
+ return `${mins}:${secs.toString().padStart(2, '0')}`;
638
+ }
639
+
640
+ /**
641
+ * Format timestamp to locale string
642
+ */
643
+ private formatTimestamp(ms: number): string {
644
+ return new Date(ms).toLocaleString('en-US', {
645
+ year: 'numeric',
646
+ month: 'short',
647
+ day: 'numeric',
648
+ hour: '2-digit',
649
+ minute: '2-digit',
650
+ });
651
+ }
652
+
653
+ /**
654
+ * Format item timestamp as MM:SS from session start
655
+ */
656
+ private formatItemTimestamp(ms: number): string {
657
+ const totalSeconds = Math.max(0, Math.floor(ms / 1000));
658
+ const mins = Math.floor(totalSeconds / 60);
659
+ const secs = totalSeconds % 60;
660
+ return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
661
+ }
662
+
663
+ /**
664
+ * Generate filename following pattern: {project}-feedback-{YYYYMMDD-HHmmss}.md
665
+ */
666
+ private generateFilename(projectName: string, startTime: number): string {
667
+ const date = new Date(startTime);
668
+ const year = date.getFullYear();
669
+ const month = (date.getMonth() + 1).toString().padStart(2, '0');
670
+ const day = date.getDate().toString().padStart(2, '0');
671
+ const hours = date.getHours().toString().padStart(2, '0');
672
+ const minutes = date.getMinutes().toString().padStart(2, '0');
673
+ const seconds = date.getSeconds().toString().padStart(2, '0');
674
+
675
+ const dateStr = `${year}${month}${day}`;
676
+ const timeStr = `${hours}${minutes}${seconds}`;
677
+ const safeName = projectName.toLowerCase().replace(/[^a-z0-9]/g, '-').replace(/-+/g, '-');
678
+
679
+ return `${safeName}-feedback-${dateStr}-${timeStr}.md`;
680
+ }
681
+
682
+ /**
683
+ * Generate screenshot filename for a feedback item.
684
+ * Uses the item's position index to produce `fb-{NNN}.png`, matching the
685
+ * naming convention in FileManager.saveSession.
686
+ */
687
+ private generateScreenshotFilename(itemIndex: number, screenshotIndex: number, total: number): string {
688
+ const num = (itemIndex + 1).toString().padStart(3, '0');
689
+ const suffix = total > 1 ? `-${screenshotIndex + 1}` : '';
690
+ return `fb-${num}${suffix}.png`;
691
+ }
692
+
693
+ /**
694
+ * Provide a severity fallback when upstream analysis is unavailable.
695
+ */
696
+ private defaultSeverityForCategory(category: FeedbackCategory): FeedbackSeverity {
697
+ switch (category) {
698
+ case 'Bug':
699
+ return 'High';
700
+ case 'Performance':
701
+ return 'High';
702
+ case 'UX Issue':
703
+ return 'Medium';
704
+ case 'Suggestion':
705
+ return 'Low';
706
+ case 'Question':
707
+ return 'Low';
708
+ default:
709
+ return 'Medium';
710
+ }
711
+ }
712
+
713
+ private countSeverities(items: FeedbackItem[]): Record<string, number> {
714
+ return items.reduce((acc, item) => {
715
+ const severity = item.severity || this.defaultSeverityForCategory(item.category || 'General');
716
+ acc[severity] = (acc[severity] || 0) + 1;
717
+ return acc;
718
+ }, {} as Record<string, number>);
719
+ }
720
+
721
+ private extractTopThemes(items: FeedbackItem[]): string[] {
722
+ const counts = new Map<string, number>();
723
+
724
+ items.forEach((item) => {
725
+ (item.keywords || []).forEach((keyword) => {
726
+ const normalized = keyword.toLowerCase();
727
+ counts.set(normalized, (counts.get(normalized) || 0) + 1);
728
+ });
729
+ });
730
+
731
+ return Array.from(counts.entries())
732
+ .sort((a, b) => b[1] - a[1])
733
+ .slice(0, 5)
734
+ .map(([keyword]) => keyword);
735
+ }
736
+
737
+ private suggestAction(
738
+ category: FeedbackCategory,
739
+ severity: FeedbackSeverity,
740
+ transcription: string
741
+ ): string {
742
+ const excerpt = this.truncateText(transcription, 120);
743
+
744
+ switch (category) {
745
+ case 'Bug':
746
+ return `Reproduce and patch this defect, then add a regression test that validates: "${excerpt}".`;
747
+ case 'Performance':
748
+ return `Profile this flow, target the slow step first, and validate before/after metrics for: "${excerpt}".`;
749
+ case 'UX Issue':
750
+ return `Revise the UI interaction and run a quick usability check focused on: "${excerpt}".`;
751
+ case 'Suggestion':
752
+ return severity === 'High' || severity === 'Critical'
753
+ ? `Treat this suggestion as near-term roadmap work and define implementation scope for: "${excerpt}".`
754
+ : `Track this as an enhancement request and prioritize against current sprint goals: "${excerpt}".`;
755
+ case 'Question':
756
+ return `Answer this explicitly in product/docs so future reviews don't block on: "${excerpt}".`;
757
+ default:
758
+ return `Investigate this item and convert it into a concrete engineering task: "${excerpt}".`;
759
+ }
760
+ }
761
+
762
+ /**
763
+ * Count feedback items by type/category
764
+ */
765
+ private countTypes(items: FeedbackItem[]): Record<string, number> {
766
+ return items.reduce((acc, item) => {
767
+ const type = item.category || 'General';
768
+ acc[type] = (acc[type] || 0) + 1;
769
+ return acc;
770
+ }, {} as Record<string, number>);
771
+ }
772
+
773
+ /**
774
+ * Count total screenshots across all items
775
+ */
776
+ private countScreenshots(items: FeedbackItem[]): number {
777
+ return items.reduce((sum, item) => sum + item.screenshots.length, 0);
778
+ }
779
+ }
780
+
781
+ // ============================================================================
782
+ // Exports
783
+ // ============================================================================
784
+
785
+ /**
786
+ * Singleton instance for easy import
787
+ */
788
+ export const markdownGenerator = new MarkdownGeneratorImpl();
789
+
790
+ // Re-export the class for testing
791
+ export { MarkdownGeneratorImpl as MarkdownGenerator };