@noorm/marie-cli 0.1.17 → 0.1.25

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/README.md +7 -15
  2. package/SENTINEL.md +4 -7
  3. package/dist/cli-new/components/AgenticSpinner.js +28 -0
  4. package/dist/cli-new/components/AgenticSpinner.js.map +1 -0
  5. package/dist/cli-new/components/App.js +16 -63
  6. package/dist/cli-new/components/App.js.map +1 -1
  7. package/dist/cli-new/components/ApprovalDialog.js +3 -2
  8. package/dist/cli-new/components/ApprovalDialog.js.map +1 -1
  9. package/dist/cli-new/components/Banner.js +16 -5
  10. package/dist/cli-new/components/Banner.js.map +1 -1
  11. package/dist/cli-new/components/ChatArea.js +6 -7
  12. package/dist/cli-new/components/ChatArea.js.map +1 -1
  13. package/dist/cli-new/components/Header.js +14 -8
  14. package/dist/cli-new/components/Header.js.map +1 -1
  15. package/dist/cli-new/components/InputArea.js +98 -31
  16. package/dist/cli-new/components/InputArea.js.map +1 -1
  17. package/dist/cli-new/components/MessageBubble.js +28 -19
  18. package/dist/cli-new/components/MessageBubble.js.map +1 -1
  19. package/dist/cli-new/components/SessionSwitcher.js +6 -9
  20. package/dist/cli-new/components/SessionSwitcher.js.map +1 -1
  21. package/dist/cli-new/components/SetupWizard.js +80 -257
  22. package/dist/cli-new/components/SetupWizard.js.map +1 -1
  23. package/dist/cli-new/components/ToolCallDisplay.js +20 -5
  24. package/dist/cli-new/components/ToolCallDisplay.js.map +1 -1
  25. package/dist/cli-new/components/WizardSteps.js +22 -0
  26. package/dist/cli-new/components/WizardSteps.js.map +1 -0
  27. package/dist/cli-new/constants/SetupConstants.js +42 -0
  28. package/dist/cli-new/constants/SetupConstants.js.map +1 -0
  29. package/dist/cli-new/hooks/useGit.js +19 -62
  30. package/dist/cli-new/hooks/useGit.js.map +1 -1
  31. package/dist/cli-new/hooks/useMarie.js +26 -18
  32. package/dist/cli-new/hooks/useMarie.js.map +1 -1
  33. package/dist/cli-new/hooks/useSessions.js +1 -1
  34. package/dist/cli-new/hooks/useSessions.js.map +1 -1
  35. package/dist/cli-new/hooks/useSetupWizard.js +88 -0
  36. package/dist/cli-new/hooks/useSetupWizard.js.map +1 -0
  37. package/dist/cli-new/hooks/useUpdateCheck.js +4 -3
  38. package/dist/cli-new/hooks/useUpdateCheck.js.map +1 -1
  39. package/dist/cli-new/index.js +2 -4
  40. package/dist/cli-new/index.js.map +1 -1
  41. package/dist/cli-new/services/CommandService.js +104 -0
  42. package/dist/cli-new/services/CommandService.js.map +1 -0
  43. package/dist/cli-new/services/GitService.js +91 -0
  44. package/dist/cli-new/services/GitService.js.map +1 -0
  45. package/dist/cli-new/services/MarieService.js +77 -0
  46. package/dist/cli-new/services/MarieService.js.map +1 -0
  47. package/dist/cli-new/services/auth-server.js +128 -0
  48. package/dist/cli-new/services/auth-server.js.map +1 -0
  49. package/dist/cli-new/styles/theme.js +17 -17
  50. package/dist/cli-new/styles/theme.js.map +1 -1
  51. package/dist/cli-new/utils/version.js +24 -0
  52. package/dist/cli-new/utils/version.js.map +1 -0
  53. package/dist/monolith/adapters/CliMarieAdapter.js +19 -18
  54. package/dist/monolith/adapters/CliMarieAdapter.js.map +1 -1
  55. package/dist/monolith/cli/CliFileSystemPort.js +17 -3
  56. package/dist/monolith/cli/CliFileSystemPort.js.map +1 -1
  57. package/dist/monolith/cli/MarieToolDefinitionsCLI.js +44 -33
  58. package/dist/monolith/cli/MarieToolDefinitionsCLI.js.map +1 -1
  59. package/dist/monolith/cli/index.js +11 -20
  60. package/dist/monolith/cli/index.js.map +1 -1
  61. package/dist/monolith/cli/services/JoyAutomationServiceCLI.js +15 -62
  62. package/dist/monolith/cli/services/JoyAutomationServiceCLI.js.map +1 -1
  63. package/dist/monolith/cli/storage.js +154 -65
  64. package/dist/monolith/cli/storage.js.map +1 -1
  65. package/dist/monolith/domain/joy/RitualService.js +44 -46
  66. package/dist/monolith/domain/joy/RitualService.js.map +1 -1
  67. package/dist/monolith/domain/marie/MarieCortex.js +148 -0
  68. package/dist/monolith/domain/marie/MarieCortex.js.map +1 -0
  69. package/dist/monolith/domain/marie/PersonalityRenderer.js +97 -0
  70. package/dist/monolith/domain/marie/PersonalityRenderer.js.map +1 -0
  71. package/dist/monolith/infrastructure/Configuration.js +68 -0
  72. package/dist/monolith/infrastructure/Configuration.js.map +1 -0
  73. package/dist/monolith/infrastructure/CoreInfrastructure.js +204 -0
  74. package/dist/monolith/infrastructure/CoreInfrastructure.js.map +1 -0
  75. package/dist/monolith/infrastructure/ai/agents/MarieAscendant.js +3 -3
  76. package/dist/monolith/infrastructure/ai/agents/MarieAscendant.js.map +1 -1
  77. package/dist/monolith/infrastructure/ai/context/ContextArchiveService.js +51 -57
  78. package/dist/monolith/infrastructure/ai/context/ContextArchiveService.js.map +1 -1
  79. package/dist/monolith/infrastructure/ai/context/ContextManager.js +142 -98
  80. package/dist/monolith/infrastructure/ai/context/ContextManager.js.map +1 -1
  81. package/dist/monolith/infrastructure/ai/core/MarieEngine.js +104 -556
  82. package/dist/monolith/infrastructure/ai/core/MarieEngine.js.map +1 -1
  83. package/dist/monolith/infrastructure/ai/core/MarieEventDispatcher.js +1 -37
  84. package/dist/monolith/infrastructure/ai/core/MarieEventDispatcher.js.map +1 -1
  85. package/dist/monolith/infrastructure/ai/core/MarieLockManager.js +30 -5
  86. package/dist/monolith/infrastructure/ai/core/MarieLockManager.js.map +1 -1
  87. package/dist/monolith/infrastructure/ai/core/MarieProgressTracker.js +176 -196
  88. package/dist/monolith/infrastructure/ai/core/MarieProgressTracker.js.map +1 -1
  89. package/dist/monolith/infrastructure/ai/core/MariePulseService.js +41 -7
  90. package/dist/monolith/infrastructure/ai/core/MariePulseService.js.map +1 -1
  91. package/dist/monolith/infrastructure/ai/core/MarieSanitizer.js +303 -63
  92. package/dist/monolith/infrastructure/ai/core/MarieSanitizer.js.map +1 -1
  93. package/dist/monolith/infrastructure/ai/core/MarieSemaphore.js +47 -4
  94. package/dist/monolith/infrastructure/ai/core/MarieSemaphore.js.map +1 -1
  95. package/dist/monolith/infrastructure/ai/core/MarieSession.js +95 -15
  96. package/dist/monolith/infrastructure/ai/core/MarieSession.js.map +1 -1
  97. package/dist/monolith/infrastructure/ai/core/MarieStabilityMonitor.js +21 -0
  98. package/dist/monolith/infrastructure/ai/core/MarieStabilityMonitor.js.map +1 -1
  99. package/dist/monolith/infrastructure/ai/core/MarieToolMender.js +12 -0
  100. package/dist/monolith/infrastructure/ai/core/MarieToolMender.js.map +1 -1
  101. package/dist/monolith/infrastructure/ai/core/MarieToolProcessor.js +339 -481
  102. package/dist/monolith/infrastructure/ai/core/MarieToolProcessor.js.map +1 -1
  103. package/dist/monolith/infrastructure/ai/core/MarieVitality.js +238 -0
  104. package/dist/monolith/infrastructure/ai/core/MarieVitality.js.map +1 -0
  105. package/dist/monolith/infrastructure/ai/core/ReasoningBudget.js +23 -12
  106. package/dist/monolith/infrastructure/ai/core/ReasoningBudget.js.map +1 -1
  107. package/dist/monolith/infrastructure/ai/core/SessionLogService.js +9 -2
  108. package/dist/monolith/infrastructure/ai/core/SessionLogService.js.map +1 -1
  109. package/dist/monolith/infrastructure/ai/providers/AIProvider.js +402 -1
  110. package/dist/monolith/infrastructure/ai/providers/AIProvider.js.map +1 -1
  111. package/dist/monolith/infrastructure/ai/providers/DreamBeesProvider.js +114 -0
  112. package/dist/monolith/infrastructure/ai/providers/DreamBeesProvider.js.map +1 -0
  113. package/dist/monolith/infrastructure/ai/providers/OpenRouterProvider.js +426 -370
  114. package/dist/monolith/infrastructure/ai/providers/OpenRouterProvider.js.map +1 -1
  115. package/dist/monolith/infrastructure/ai/providers/OpenRouterStreamParser.js +235 -241
  116. package/dist/monolith/infrastructure/ai/providers/OpenRouterStreamParser.js.map +1 -1
  117. package/dist/monolith/infrastructure/ai/workerAi.js +185 -0
  118. package/dist/monolith/infrastructure/ai/workerAi.js.map +1 -0
  119. package/dist/monolith/infrastructure/config/ConfigService.js +216 -359
  120. package/dist/monolith/infrastructure/config/ConfigService.js.map +1 -1
  121. package/dist/monolith/infrastructure/joy/CognitiveRituals.js +8 -0
  122. package/dist/monolith/infrastructure/joy/CognitiveRituals.js.map +1 -0
  123. package/dist/monolith/infrastructure/joy/JoyTools.js +23 -43
  124. package/dist/monolith/infrastructure/joy/JoyTools.js.map +1 -1
  125. package/dist/monolith/infrastructure/persistence/MarieMindAutonomics.js +4 -0
  126. package/dist/monolith/infrastructure/persistence/MarieMindAutonomics.js.map +1 -0
  127. package/dist/monolith/infrastructure/persistence/MarieMindEngine.js +11 -0
  128. package/dist/monolith/infrastructure/persistence/MarieMindEngine.js.map +1 -0
  129. package/dist/monolith/infrastructure/persistence/NoormmeAutonomics.js +135 -0
  130. package/dist/monolith/infrastructure/persistence/NoormmeAutonomics.js.map +1 -0
  131. package/dist/monolith/infrastructure/persistence/NoormmeEngine.js +523 -0
  132. package/dist/monolith/infrastructure/persistence/NoormmeEngine.js.map +1 -0
  133. package/dist/monolith/infrastructure/persistence/NoormmeSchema.js +179 -0
  134. package/dist/monolith/infrastructure/persistence/NoormmeSchema.js.map +1 -0
  135. package/dist/monolith/infrastructure/persistence/NoormmeSeeder.js +94 -0
  136. package/dist/monolith/infrastructure/persistence/NoormmeSeeder.js.map +1 -0
  137. package/dist/monolith/infrastructure/persistence/NoormmeTools.js +371 -0
  138. package/dist/monolith/infrastructure/persistence/NoormmeTools.js.map +1 -0
  139. package/dist/monolith/infrastructure/services/MarieMemoryStore.js +133 -134
  140. package/dist/monolith/infrastructure/services/MarieMemoryStore.js.map +1 -1
  141. package/dist/monolith/infrastructure/tools/MarieToolDefinitions.js +6 -1578
  142. package/dist/monolith/infrastructure/tools/MarieToolDefinitions.js.map +1 -1
  143. package/dist/monolith/infrastructure/tools/PureStreamParser.js +68 -80
  144. package/dist/monolith/infrastructure/tools/PureStreamParser.js.map +1 -1
  145. package/dist/monolith/infrastructure/tools/SharedToolDefinitions.js +12 -11
  146. package/dist/monolith/infrastructure/tools/SharedToolDefinitions.js.map +1 -1
  147. package/dist/monolith/infrastructure/tools/SovereignTools.js +326 -0
  148. package/dist/monolith/infrastructure/tools/SovereignTools.js.map +1 -0
  149. package/dist/monolith/infrastructure/tools/ToolRegistry.js +45 -26
  150. package/dist/monolith/infrastructure/tools/ToolRegistry.js.map +1 -1
  151. package/dist/monolith/infrastructure/tools/definitions/AnalysisTools.js +232 -0
  152. package/dist/monolith/infrastructure/tools/definitions/AnalysisTools.js.map +1 -0
  153. package/dist/monolith/infrastructure/tools/definitions/AutomationTools.js +274 -0
  154. package/dist/monolith/infrastructure/tools/definitions/AutomationTools.js.map +1 -0
  155. package/dist/monolith/infrastructure/tools/definitions/ContextTools.js +71 -0
  156. package/dist/monolith/infrastructure/tools/definitions/ContextTools.js.map +1 -0
  157. package/dist/monolith/infrastructure/tools/definitions/CoreTools.js +37 -0
  158. package/dist/monolith/infrastructure/tools/definitions/CoreTools.js.map +1 -0
  159. package/dist/monolith/infrastructure/tools/definitions/DiagnosticTools.js +154 -0
  160. package/dist/monolith/infrastructure/tools/definitions/DiagnosticTools.js.map +1 -0
  161. package/dist/monolith/infrastructure/tools/definitions/NavigationTools.js +197 -0
  162. package/dist/monolith/infrastructure/tools/definitions/NavigationTools.js.map +1 -0
  163. package/dist/monolith/infrastructure/tools/definitions/PlanningTools.js +300 -0
  164. package/dist/monolith/infrastructure/tools/definitions/PlanningTools.js.map +1 -0
  165. package/dist/monolith/plumbing/Plumbing.js +238 -0
  166. package/dist/monolith/plumbing/Plumbing.js.map +1 -0
  167. package/dist/monolith/plumbing/PlumbingAnalysis.js +109 -0
  168. package/dist/monolith/plumbing/PlumbingAnalysis.js.map +1 -0
  169. package/dist/monolith/plumbing/PlumbingSystem.js +169 -0
  170. package/dist/monolith/plumbing/PlumbingSystem.js.map +1 -0
  171. package/dist/monolith/plumbing/analysis/ComplexityService.js +30 -34
  172. package/dist/monolith/plumbing/analysis/ComplexityService.js.map +1 -1
  173. package/dist/monolith/plumbing/analysis/DependencyService.js +55 -44
  174. package/dist/monolith/plumbing/analysis/DependencyService.js.map +1 -1
  175. package/dist/monolith/plumbing/analysis/DiscoveryService.js +40 -42
  176. package/dist/monolith/plumbing/analysis/DiscoveryService.js.map +1 -1
  177. package/dist/monolith/plumbing/analysis/JoyMapService.js +52 -56
  178. package/dist/monolith/plumbing/analysis/JoyMapService.js.map +1 -1
  179. package/dist/monolith/plumbing/analysis/LintService.js +118 -118
  180. package/dist/monolith/plumbing/analysis/LintService.js.map +1 -1
  181. package/dist/monolith/plumbing/analysis/MarieSentinelService.js +278 -269
  182. package/dist/monolith/plumbing/analysis/MarieSentinelService.js.map +1 -1
  183. package/dist/monolith/plumbing/analysis/QualityGuardrailService.js +116 -114
  184. package/dist/monolith/plumbing/analysis/QualityGuardrailService.js.map +1 -1
  185. package/dist/monolith/plumbing/analysis/SurgicalMender.js +57 -59
  186. package/dist/monolith/plumbing/analysis/SurgicalMender.js.map +1 -1
  187. package/dist/monolith/plumbing/analysis/TestService.js +89 -89
  188. package/dist/monolith/plumbing/analysis/TestService.js.map +1 -1
  189. package/dist/monolith/plumbing/filesystem/FileService.js +123 -195
  190. package/dist/monolith/plumbing/filesystem/FileService.js.map +1 -1
  191. package/dist/monolith/plumbing/filesystem/PathResolver.js +7 -8
  192. package/dist/monolith/plumbing/filesystem/PathResolver.js.map +1 -1
  193. package/dist/monolith/plumbing/git/GitService.js +4 -4
  194. package/dist/monolith/plumbing/git/GitService.js.map +1 -1
  195. package/dist/monolith/plumbing/lsp/SymbolService.js +5 -34
  196. package/dist/monolith/plumbing/lsp/SymbolService.js.map +1 -1
  197. package/dist/monolith/plumbing/terminal/ProcessRegistry.js +20 -22
  198. package/dist/monolith/plumbing/terminal/ProcessRegistry.js.map +1 -1
  199. package/dist/monolith/plumbing/terminal/TerminalService.js +127 -136
  200. package/dist/monolith/plumbing/terminal/TerminalService.js.map +1 -1
  201. package/dist/monolith/plumbing/utils/EnvironmentUtils.js +3 -23
  202. package/dist/monolith/plumbing/utils/EnvironmentUtils.js.map +1 -1
  203. package/dist/monolith/plumbing/utils/JsonUtils.js +252 -311
  204. package/dist/monolith/plumbing/utils/JsonUtils.js.map +1 -1
  205. package/dist/monolith/plumbing/utils/MutexUtils.js.map +1 -1
  206. package/dist/monolith/plumbing/utils/PlumbingCore.js +549 -0
  207. package/dist/monolith/plumbing/utils/PlumbingCore.js.map +1 -0
  208. package/dist/monolith/plumbing/utils/PrefixTree.js +61 -114
  209. package/dist/monolith/plumbing/utils/PrefixTree.js.map +1 -1
  210. package/dist/monolith/plumbing/utils/StreamTagDetector.js +89 -127
  211. package/dist/monolith/plumbing/utils/StreamTagDetector.js.map +1 -1
  212. package/dist/monolith/plumbing/utils/StringUtils.js +87 -89
  213. package/dist/monolith/plumbing/utils/StringUtils.js.map +1 -1
  214. package/dist/monolith/runtime/MarieRuntime.js +76 -417
  215. package/dist/monolith/runtime/MarieRuntime.js.map +1 -1
  216. package/dist/monolith/runtime/RuntimeAdapterBase.js +1 -1
  217. package/dist/monolith/runtime/RuntimeAdapterBase.js.map +1 -1
  218. package/dist/monolith/runtime/providerFactory.js +1 -7
  219. package/dist/monolith/runtime/providerFactory.js.map +1 -1
  220. package/dist/monolith/services/HealthService.js +29 -32
  221. package/dist/monolith/services/HealthService.js.map +1 -1
  222. package/dist/monolith/services/JoyAutomationService.js +58 -95
  223. package/dist/monolith/services/JoyAutomationService.js.map +1 -1
  224. package/dist/monolith/services/MarieAutomationService.js +59 -0
  225. package/dist/monolith/services/MarieAutomationService.js.map +1 -0
  226. package/dist/monolith/services/MarieGhostService.js +46 -161
  227. package/dist/monolith/services/MarieGhostService.js.map +1 -1
  228. package/dist/monolith/services/MarieServices.js +102 -0
  229. package/dist/monolith/services/MarieServices.js.map +1 -0
  230. package/dist/monolith/services/MarieTypes.js +2 -0
  231. package/dist/monolith/services/MarieTypes.js.map +1 -0
  232. package/dist/monolith/services/UpdateService.js +47 -49
  233. package/dist/monolith/services/UpdateService.js.map +1 -1
  234. package/dist/prompts.js +11 -5
  235. package/dist/prompts.js.map +1 -1
  236. package/dist/test_prefix_tree.js +9 -9
  237. package/dist/test_prefix_tree.js.map +1 -1
  238. package/package.json +18 -88
  239. package/run_test.js +5 -0
  240. package/.marie_visual_verify_1771225696548/progress_bar_check.txt +0 -1
  241. package/dist/extension.cjs +0 -635
  242. package/dist/extension.js +0 -473
  243. package/dist/extension.js.map +0 -1
  244. package/dist/monolith/adapters/VscodeMarieAdapter.js +0 -81
  245. package/dist/monolith/adapters/VscodeMarieAdapter.js.map +0 -1
  246. package/dist/monolith/domain/joy/JoyTools.js +0 -535
  247. package/dist/monolith/domain/joy/JoyTools.js.map +0 -1
  248. package/dist/monolith/infrastructure/ai/agents/MarieYOLO.js +0 -207
  249. package/dist/monolith/infrastructure/ai/agents/MarieYOLO.js.map +0 -1
  250. package/dist/monolith/infrastructure/ai/core/GhostPort.js +0 -2
  251. package/dist/monolith/infrastructure/ai/core/GhostPort.js.map +0 -1
  252. package/dist/monolith/infrastructure/ai/core/MarieYOLOTypes.js +0 -2
  253. package/dist/monolith/infrastructure/ai/core/MarieYOLOTypes.js.map +0 -1
  254. package/dist/monolith/infrastructure/ai/core/VscodeFileSystemPort.js +0 -33
  255. package/dist/monolith/infrastructure/ai/core/VscodeFileSystemPort.js.map +0 -1
  256. package/dist/monolith/infrastructure/ai/providers/AnthropicProvider.js +0 -148
  257. package/dist/monolith/infrastructure/ai/providers/AnthropicProvider.js.map +0 -1
  258. package/dist/monolith/infrastructure/ai/providers/CerebrasProvider.js +0 -208
  259. package/dist/monolith/infrastructure/ai/providers/CerebrasProvider.js.map +0 -1
  260. package/dist/monolith/plumbing/ui/DecorationService.js +0 -54
  261. package/dist/monolith/plumbing/ui/DecorationService.js.map +0 -1
  262. package/dist/monolith/services/JoyLogService.js +0 -48
  263. package/dist/monolith/services/JoyLogService.js.map +0 -1
  264. package/dist/monolith/services/JoyService.js +0 -209
  265. package/dist/monolith/services/JoyService.js.map +0 -1
  266. package/dist/monolith/services/MarieSCMProvider.js +0 -41
  267. package/dist/monolith/services/MarieSCMProvider.js.map +0 -1
  268. package/dist/test_agent_stream_control_plane.js +0 -170
  269. package/dist/test_agent_stream_control_plane.js.map +0 -1
  270. package/dist/test_strategy_integration.js +0 -114
  271. package/dist/test_strategy_integration.js.map +0 -1
  272. package/dist/test_streaming_fragility.js +0 -191
  273. package/dist/test_streaming_fragility.js.map +0 -1
  274. package/dist/webview-ui/App.js +0 -16
  275. package/dist/webview-ui/App.js.map +0 -1
  276. package/dist/webview-ui/Providers.js +0 -6
  277. package/dist/webview-ui/Providers.js.map +0 -1
  278. package/dist/webview-ui/components/ApprovalPanel.js +0 -8
  279. package/dist/webview-ui/components/ApprovalPanel.js.map +0 -1
  280. package/dist/webview-ui/components/ChatPanel.js +0 -19
  281. package/dist/webview-ui/components/ChatPanel.js.map +0 -1
  282. package/dist/webview-ui/components/Composer.js +0 -19
  283. package/dist/webview-ui/components/Composer.js.map +0 -1
  284. package/dist/webview-ui/components/HeaderBar.js +0 -5
  285. package/dist/webview-ui/components/HeaderBar.js.map +0 -1
  286. package/dist/webview-ui/components/SessionList.js +0 -14
  287. package/dist/webview-ui/components/SessionList.js.map +0 -1
  288. package/dist/webview-ui/context/WebviewStateContext.js +0 -146
  289. package/dist/webview-ui/context/WebviewStateContext.js.map +0 -1
  290. package/dist/webview-ui/main.css +0 -1
  291. package/dist/webview-ui/main.js +0 -108
  292. package/dist/webview-ui/main.js.map +0 -1
  293. package/dist/webview-ui/types.js +0 -2
  294. package/dist/webview-ui/types.js.map +0 -1
  295. package/dist/webview-ui/vscode.js +0 -4
  296. package/dist/webview-ui/vscode.js.map +0 -1
  297. package/lint_output.txt +0 -705
  298. package/lint_output_v2.txt +0 -711
  299. package/marie-coder-0.1.16.vsix +0 -0
@@ -4,63 +4,59 @@ import { checkCodeHealth } from "./CodeHealthService.js";
4
4
  /**
5
5
  * Generates a project-wide "Joy Map" to help Marie prioritize tidying.
6
6
  */
7
- export class JoyMapService {
8
- static async generate(workspaceRoot) {
9
- const srcPath = path.join(workspaceRoot, "src");
10
- const files = await this.findTsFiles(srcPath);
11
- const results = [];
12
- let totalScore = 0;
13
- // Limit scan to 50 files for performance
14
- const targetFiles = files.slice(0, 50);
15
- for (const file of targetFiles) {
16
- try {
17
- const health = await checkCodeHealth(file);
18
- results.push({
19
- path: path.relative(workspaceRoot, file),
20
- joyScore: health.joyScore,
21
- clutterLevel: health.joyScore < 60
22
- ? "Toxic"
23
- : health.joyScore < 80
24
- ? "Tangled"
25
- : "Clean",
26
- });
27
- totalScore += health.joyScore;
28
- }
29
- catch (e) {
30
- console.error(`Failed to scan ${file}`, e);
31
- }
7
+ export async function generateJoyMap(workspaceRoot) {
8
+ const srcPath = path.join(workspaceRoot, "src");
9
+ const files = await findTsFiles(srcPath);
10
+ const results = [];
11
+ let totalScore = 0;
12
+ // Limit scan to 50 files for performance
13
+ const targetFiles = files.slice(0, 50);
14
+ for (const file of targetFiles) {
15
+ try {
16
+ const health = await checkCodeHealth(file);
17
+ results.push({
18
+ path: path.relative(workspaceRoot, file),
19
+ joyScore: health.joyScore,
20
+ clutterLevel: health.joyScore < 60
21
+ ? "Toxic"
22
+ : health.joyScore < 80
23
+ ? "Tangled"
24
+ : "Clean",
25
+ });
26
+ totalScore += health.joyScore;
27
+ }
28
+ catch (e) {
29
+ console.error(`Failed to scan ${file}`, e);
32
30
  }
33
- const averageScore = targetFiles.length > 0
34
- ? Math.floor(totalScore / targetFiles.length)
35
- : 100;
36
- const hotspots = results
37
- .sort((a, b) => a.joyScore - b.joyScore)
38
- .filter((r) => r.joyScore < 70)
39
- .slice(0, 5);
40
- return {
41
- overallJoyScore: averageScore,
42
- totalFilesScanned: targetFiles.length,
43
- hotspots,
44
- summary: `The project has an average Joy Score of ${averageScore}. ` +
45
- (hotspots.length > 0
46
- ? `We found ${hotspots.length} hotspots that need immediate attention.`
47
- : "The Garden is looking pristine! ✨"),
48
- };
49
- }
50
- static async findTsFiles(dir) {
51
- const entries = await fs.readdir(dir, { withFileTypes: true });
52
- const files = await Promise.all(entries.map(async (entry) => {
53
- const res = path.resolve(dir, entry.name);
54
- if (entry.isDirectory()) {
55
- if (entry.name === "node_modules" || entry.name.startsWith("."))
56
- return [];
57
- return this.findTsFiles(res);
58
- }
59
- else {
60
- return res.endsWith(".ts") || res.endsWith(".tsx") ? [res] : [];
61
- }
62
- }));
63
- return files.flat();
64
31
  }
32
+ const averageScore = targetFiles.length > 0 ? Math.floor(totalScore / targetFiles.length) : 100;
33
+ const hotspots = results
34
+ .sort((a, b) => a.joyScore - b.joyScore)
35
+ .filter((r) => r.joyScore < 70)
36
+ .slice(0, 5);
37
+ return {
38
+ overallJoyScore: averageScore,
39
+ totalFilesScanned: targetFiles.length,
40
+ hotspots,
41
+ summary: `The project has an average Joy Score of ${averageScore}. ` +
42
+ (hotspots.length > 0
43
+ ? `We found ${hotspots.length} hotspots that need immediate attention.`
44
+ : "The Garden is looking pristine! ✨"),
45
+ };
46
+ }
47
+ async function findTsFiles(dir) {
48
+ const entries = await fs.readdir(dir, { withFileTypes: true });
49
+ const files = await Promise.all(entries.map(async (entry) => {
50
+ const res = path.resolve(dir, entry.name);
51
+ if (entry.isDirectory()) {
52
+ if (entry.name === "node_modules" || entry.name.startsWith("."))
53
+ return [];
54
+ return findTsFiles(res);
55
+ }
56
+ else {
57
+ return res.endsWith(".ts") || res.endsWith(".tsx") ? [res] : [];
58
+ }
59
+ }));
60
+ return files.flat();
65
61
  }
66
62
  //# sourceMappingURL=JoyMapService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"JoyMapService.js","sourceRoot":"","sources":["../../../../src/monolith/plumbing/analysis/JoyMapService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AASzD;;GAEG;AACH,MAAM,OAAO,aAAa;IACjB,MA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,EAAE,CAAC;YACxB,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;gBAC7D,OAAO,EAAE,CAAC;YACZ,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC;QAC1B,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAClE,CAAC;IACH,CAAC,CAAC,CACH,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC"}
@@ -2,138 +2,138 @@ import { exec } from "node:child_process";
2
2
  import { promisify } from "node:util";
3
3
  import * as path from "node:path";
4
4
  const execAsync = promisify(exec);
5
- export class LintService {
6
- /**
7
- * Executes a lint command and parses the output into structured LintError objects.
8
- */
9
- static async runLint(cwd, command = "npm run lint") {
5
+ /**
6
+ * Executes a lint command and parses the output into structured LintError objects.
7
+ */
8
+ export async function runLint(cwd, command = "npm run lint") {
9
+ try {
10
+ const { stdout, stderr } = await execAsync(command, { cwd });
11
+ return [];
12
+ }
13
+ catch (e) {
14
+ const output = (e.stdout || "") + (e.stderr || "");
15
+ return parseLintOutput(output, cwd);
16
+ }
17
+ }
18
+ /**
19
+ * Performs targeted linting on a specific file.
20
+ * Attempts to detect the best tool (ESLint, TSC) for the job.
21
+ */
22
+ export async function runLintOnFile(cwd, filePath) {
23
+ const relativePath = path.isAbsolute(filePath)
24
+ ? path.relative(cwd, filePath)
25
+ : filePath;
26
+ // 1. Try ESLint first if it's a TS/JS file
27
+ if (/\.(ts|js|tsx|jsx)$/.test(relativePath)) {
10
28
  try {
11
- const { stdout, stderr } = await execAsync(command, { cwd });
29
+ // Try to use the project's own lint script if it supports passing files,
30
+ // otherwise use npx eslint directly.
31
+ const { stdout, stderr } = await execAsync(`npx eslint "${relativePath}" --format stylish`, { cwd });
12
32
  return [];
13
33
  }
14
34
  catch (e) {
15
35
  const output = (e.stdout || "") + (e.stderr || "");
16
- return this.parseLintOutput(output, cwd);
17
- }
18
- }
19
- /**
20
- * Performs targeted linting on a specific file.
21
- * Attempts to detect the best tool (ESLint, TSC) for the job.
22
- */
23
- static async runLintOnFile(cwd, filePath) {
24
- const relativePath = path.isAbsolute(filePath)
25
- ? path.relative(cwd, filePath)
26
- : filePath;
27
- // 1. Try ESLint first if it's a TS/JS file
28
- if (/\.(ts|js|tsx|jsx)$/.test(relativePath)) {
29
- try {
30
- // Try to use the project's own lint script if it supports passing files,
31
- // otherwise use npx eslint directly.
32
- const { stdout, stderr } = await execAsync(`npx eslint "${relativePath}" --format stylish`, { cwd });
33
- return [];
34
- }
35
- catch (e) {
36
- const output = (e.stdout || "") + (e.stderr || "");
37
- const errors = this.parseLintOutput(output, cwd);
38
- if (errors.length > 0)
39
- return errors;
40
- }
36
+ const errors = parseLintOutput(output, cwd);
37
+ if (errors.length > 0)
38
+ return errors;
41
39
  }
42
- // 2. Fallback to full project lint if targeted failed or was unavailable
43
- return this.runLint(cwd);
44
40
  }
45
- /**
46
- * Attempts to automatically fix lint errors in a file.
47
- */
48
- static async fixFile(cwd, filePath) {
49
- const relativePath = path.isAbsolute(filePath)
50
- ? path.relative(cwd, filePath)
51
- : filePath;
52
- if (/\.(ts|js|tsx|jsx)$/.test(relativePath)) {
53
- try {
54
- // Prefer npm run lint:fix if available, but ESLint --fix is more precise for single files
55
- const { stdout } = await execAsync(`npx eslint "${relativePath}" --fix`, { cwd });
56
- return { success: true, output: stdout };
57
- }
58
- catch (e) {
59
- return { success: false, output: (e.stdout || "") + (e.stderr || "") };
60
- }
41
+ // 2. Fallback to full project lint if targeted failed or was unavailable
42
+ return runLint(cwd);
43
+ }
44
+ /**
45
+ * Attempts to automatically fix lint errors in a file.
46
+ */
47
+ export async function fixFile(cwd, filePath) {
48
+ const relativePath = path.isAbsolute(filePath)
49
+ ? path.relative(cwd, filePath)
50
+ : filePath;
51
+ if (/\.(ts|js|tsx|jsx)$/.test(relativePath)) {
52
+ try {
53
+ // Prefer npm run lint:fix if available, but ESLint --fix is more precise for single files
54
+ const { stdout } = await execAsync(`npx eslint "${relativePath}" --fix`, {
55
+ cwd,
56
+ });
57
+ return { success: true, output: stdout };
61
58
  }
62
- return {
63
- success: false,
64
- output: "Auto-fix not supported for this file type.",
65
- };
66
- }
67
- /**
68
- * Parses various lint output formats (ESLint, TSC).
69
- */
70
- static parseLintOutput(output, cwd) {
71
- const errors = [];
72
- const lines = output.split("\n");
73
- let currentFile = "";
74
- for (const line of lines) {
75
- // ESLint stylish file header
76
- const fileMatch = line.match(/^(\/[^ ]+|\w:[/][^ ]+)$/);
77
- if (fileMatch) {
78
- currentFile = fileMatch[1];
79
- continue;
80
- }
81
- // ESLint stylish error line
82
- const errorMatch = line.match(/^\s+(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+([a-z0-9\-/]+|)$/i);
83
- if (errorMatch && currentFile) {
84
- errors.push({
85
- file: path.relative(cwd, currentFile),
86
- line: parseInt(errorMatch[1]),
87
- column: parseInt(errorMatch[2]),
88
- severity: errorMatch[3].toLowerCase(),
89
- message: errorMatch[4].trim(),
90
- ruleId: errorMatch[5] || undefined,
91
- });
92
- }
93
- // TSC format
94
- const tscMatch = line.match(/^(.+)\((\d+),(\d+)\): (error|warning) (TS\d+): (.+)$/);
95
- if (tscMatch) {
96
- errors.push({
97
- file: tscMatch[1],
98
- line: parseInt(tscMatch[2]),
99
- column: parseInt(tscMatch[3]),
100
- severity: tscMatch[4].toLowerCase(),
101
- ruleId: tscMatch[5],
102
- message: tscMatch[6].trim(),
103
- });
104
- }
105
- // Generic unix format
106
- const genericMatch = line.match(/^([^:]+):(\d+):(\d+): (error|warning): (.+)$/);
107
- if (genericMatch) {
108
- errors.push({
109
- file: genericMatch[1],
110
- line: parseInt(genericMatch[2]),
111
- column: parseInt(genericMatch[3]),
112
- severity: genericMatch[4].toLowerCase(),
113
- message: genericMatch[5].trim(),
114
- });
115
- }
59
+ catch (e) {
60
+ return { success: false, output: (e.stdout || "") + (e.stderr || "") };
116
61
  }
117
- return errors;
118
62
  }
119
- /**
120
- * Heuristically suggests a fix for common lint errors.
121
- */
122
- static suggestFix(error) {
123
- const msg = error.message.toLowerCase();
124
- if (msg.includes("unused") || msg.includes("is defined but never used")) {
125
- return `Remove unused declaration or prefix with underscore.`;
63
+ return {
64
+ success: false,
65
+ output: "Auto-fix not supported for this file type.",
66
+ };
67
+ }
68
+ /**
69
+ * Parses various lint output formats (ESLint, TSC).
70
+ */
71
+ function parseLintOutput(output, cwd) {
72
+ const errors = [];
73
+ const lines = output.split("\n");
74
+ let currentFile = "";
75
+ for (const line of lines) {
76
+ // ESLint stylish file header
77
+ const fileMatch = line.match(/^(\/[^ ]+|\w:[/][^ ]+)$/);
78
+ if (fileMatch) {
79
+ currentFile = fileMatch[1];
80
+ continue;
126
81
  }
127
- if (msg.includes("missing semicolon") || msg.includes("extra semicolon")) {
128
- return `Add or remove semicolon.`;
82
+ // ESLint stylish error line
83
+ const errorMatch = line.match(/^\s+(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+([a-z0-9\-/]+|)$/i);
84
+ if (errorMatch && currentFile) {
85
+ errors.push({
86
+ file: path.relative(cwd, currentFile),
87
+ line: parseInt(errorMatch[1]),
88
+ column: parseInt(errorMatch[2]),
89
+ severity: errorMatch[3].toLowerCase(),
90
+ message: errorMatch[4].trim(),
91
+ ruleId: errorMatch[5] || undefined,
92
+ });
129
93
  }
130
- if (msg.includes("prefer-const") || msg.includes("should be a const")) {
131
- return `Change 'let' to 'const'.`;
94
+ // TSC format
95
+ const tscMatch = line.match(/^(.+)\((\d+),(\d+)\): (error|warning) (TS\d+): (.+)$/);
96
+ if (tscMatch) {
97
+ errors.push({
98
+ file: tscMatch[1],
99
+ line: parseInt(tscMatch[2]),
100
+ column: parseInt(tscMatch[3]),
101
+ severity: tscMatch[4].toLowerCase(),
102
+ ruleId: tscMatch[5],
103
+ message: tscMatch[6].trim(),
104
+ });
132
105
  }
133
- if (msg.includes("no-var") || msg.includes("unexpected var")) {
134
- return `Change 'var' to 'let' or 'const'.`;
106
+ // Generic unix format
107
+ const genericMatch = line.match(/^([^:]+):(\d+):(\d+): (error|warning): (.+)$/);
108
+ if (genericMatch) {
109
+ errors.push({
110
+ file: genericMatch[1],
111
+ line: parseInt(genericMatch[2]),
112
+ column: parseInt(genericMatch[3]),
113
+ severity: genericMatch[4].toLowerCase(),
114
+ message: genericMatch[5].trim(),
115
+ });
135
116
  }
136
- return null;
137
117
  }
118
+ return errors;
119
+ }
120
+ /**
121
+ * Heuristically suggests a fix for common lint errors.
122
+ */
123
+ export function suggestFix(error) {
124
+ const msg = error.message.toLowerCase();
125
+ if (msg.includes("unused") || msg.includes("is defined but never used")) {
126
+ return `Remove unused declaration or prefix with underscore.`;
127
+ }
128
+ if (msg.includes("missing semicolon") || msg.includes("extra semicolon")) {
129
+ return `Add or remove semicolon.`;
130
+ }
131
+ if (msg.includes("prefer-const") || msg.includes("should be a const")) {
132
+ return `Change 'let' to 'const'.`;
133
+ }
134
+ if (msg.includes("no-var") || msg.includes("unexpected var")) {
135
+ return `Change 'var' to 'let' or 'const'.`;
136
+ }
137
+ return null;
138
138
  }
139
139
  //# sourceMappingURL=LintService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LintService.js","sourceRoot":"","sources":["../../../../src/monolith/plumbing/analysis/LintService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAGlC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAYlC,MAAM,OAAO,WAAW;IACtB;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,OAAO,CACzB,GAAW,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