@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
@@ -0,0 +1,300 @@
1
+ import { registerTool } from "../ToolRegistry.js";
2
+ import { getStringArg, getArrayArg } from "../ToolUtils.js";
3
+ import * as path from "path";
4
+ import * as fs from "fs/promises";
5
+ import { getWorkspaceRoot } from "../../../plumbing/utils/PlumbingCore.js";
6
+ /**
7
+ * PlanningTools - Tools for strategic planning, roadmapping, and pass management.
8
+ */
9
+ export function registerPlanningTools() {
10
+ registerTool({
11
+ name: "perform_strategic_planning",
12
+ description: "A mandatory planning ritual. Call this at the start of any complex task.",
13
+ input_schema: {
14
+ type: "object",
15
+ properties: {
16
+ intent: { type: "string" },
17
+ joyZone: {
18
+ type: "string",
19
+ enum: ["joyful", "infrastructure", "plumbing"],
20
+ },
21
+ projectName: { type: "string" },
22
+ lifecycleStage: {
23
+ type: "string",
24
+ enum: ["sprout", "bloom", "compost"],
25
+ },
26
+ objectives: {
27
+ type: "array",
28
+ items: {
29
+ type: "object",
30
+ properties: {
31
+ id: { type: "string" },
32
+ label: { type: "string" },
33
+ status: {
34
+ type: "string",
35
+ enum: ["pending", "in_progress", "completed", "blocked"],
36
+ },
37
+ },
38
+ required: ["id", "label", "status"],
39
+ },
40
+ },
41
+ ritualChecked: { type: "boolean" },
42
+ gratitudeMoment: { type: "string" },
43
+ dependencyRisk: { type: "string" },
44
+ totalPasses: {
45
+ type: "number",
46
+ description: "Total number of passes (1-4)",
47
+ },
48
+ passFocus: { type: "string", description: "Initial focus of Pass 1" },
49
+ },
50
+ required: [
51
+ "intent",
52
+ "joyZone",
53
+ "projectName",
54
+ "lifecycleStage",
55
+ "ritualChecked",
56
+ "gratitudeMoment",
57
+ "totalPasses",
58
+ "passFocus",
59
+ ],
60
+ },
61
+ execute: async (args, onProgress) => {
62
+ const intent = getStringArg(args, "intent");
63
+ const joyZone = getStringArg(args, "joyZone");
64
+ const projectName = getStringArg(args, "projectName");
65
+ const lifecycleStage = getStringArg(args, "lifecycleStage");
66
+ const objectives = getArrayArg(args, "objectives");
67
+ const gratitude = getStringArg(args, "gratitudeMoment");
68
+ onProgress?.({
69
+ context: `Mindfulness: ${intent} [Zone: ${joyZone}]`,
70
+ completedObjectiveIds: [],
71
+ activeObjectiveId: objectives[0]?.id,
72
+ achieved: [
73
+ `Aligned with ${joyZone} zone protocols`,
74
+ `Planning for ${projectName} (${lifecycleStage})`,
75
+ `Ritual: ${gratitude}`,
76
+ ],
77
+ lifecycleStage,
78
+ ritualComplete: true,
79
+ currentPass: 1,
80
+ totalPasses: args.totalPasses || 1,
81
+ passFocus: getStringArg(args, "passFocus"),
82
+ });
83
+ return `Strategic Plan for '${projectName}' accepted. The KonMari Waterfall (Domain -> Infrastructure -> Plumbing) has been aligned. ✨`;
84
+ },
85
+ });
86
+ registerTool({
87
+ name: "checkpoint_pass",
88
+ description: "Explicitly end a pass, summarize achievements, and orient for the next pass.",
89
+ input_schema: {
90
+ type: "object",
91
+ properties: {
92
+ summary: {
93
+ type: "string",
94
+ description: "What was achieved in this pass",
95
+ },
96
+ reflection: {
97
+ type: "string",
98
+ description: "What sparked joy or was learned in this pass? (KonMari Reflection)",
99
+ },
100
+ nextPassFocus: {
101
+ type: "string",
102
+ description: "The focus for the upcoming pass",
103
+ },
104
+ zoneSolidification: {
105
+ type: "boolean",
106
+ description: "Confirm that all new code follows JOY zoning protocols.",
107
+ },
108
+ tidyChecked: {
109
+ type: "boolean",
110
+ description: "Confirm that Joyful Tidying (fold_file) has been performed.",
111
+ },
112
+ isFinalPass: { type: "boolean" },
113
+ },
114
+ required: [
115
+ "summary",
116
+ "reflection",
117
+ "nextPassFocus",
118
+ "zoneSolidification",
119
+ "tidyChecked",
120
+ "isFinalPass",
121
+ ],
122
+ },
123
+ execute: async (args, onProgress) => {
124
+ const summary = getStringArg(args, "summary");
125
+ const reflection = getStringArg(args, "reflection");
126
+ const nextFocus = getStringArg(args, "nextPassFocus");
127
+ const solidified = args.zoneSolidification;
128
+ const isFinal = args.isFinalPass;
129
+ if (!solidified) {
130
+ return "Error: Zone Solidification check failed. Please ensure all new code is correctly zoned before ending the pass.";
131
+ }
132
+ if (!args.tidyChecked) {
133
+ return "Error: Joyful Tidying check failed. Please perform 'fold_file' on modified files to ensure code health.";
134
+ }
135
+ onProgress?.({
136
+ context: `Checkpoint: ${summary} (Reflection: ${reflection})`,
137
+ achieved: [`Completed Pass: ${summary}`],
138
+ passHistory: [
139
+ { pass: args.currentPass || 1, summary, reflection },
140
+ ],
141
+ currentPass: isFinal ? null : undefined,
142
+ passFocus: isFinal ? undefined : nextFocus,
143
+ });
144
+ return `Pass internal checkpoint reached. Focus shifting to: ${nextFocus}. Reflection: ${reflection}`;
145
+ },
146
+ });
147
+ registerTool({
148
+ name: "update_run_objectives",
149
+ description: "Update the current run's objectives and progress context.",
150
+ input_schema: {
151
+ type: "object",
152
+ properties: {
153
+ context: { type: "string" },
154
+ completedObjectiveIds: { type: "array", items: { type: "string" } },
155
+ activeObjectiveId: { type: "string" },
156
+ achieved: { type: "array", items: { type: "string" } },
157
+ totalPasses: { type: "number" },
158
+ },
159
+ required: ["context"],
160
+ },
161
+ execute: async (args, onProgress) => {
162
+ const context = getStringArg(args, "context");
163
+ const completedObjectiveIds = getArrayArg(args, "completedObjectiveIds");
164
+ const activeObjectiveId = getStringArg(args, "activeObjectiveId");
165
+ const achieved = getArrayArg(args, "achieved");
166
+ const totalPasses = args.totalPasses;
167
+ onProgress?.({
168
+ context,
169
+ completedObjectiveIds,
170
+ activeObjectiveId,
171
+ achieved,
172
+ totalPasses,
173
+ });
174
+ return `Progress updated: ${context}${totalPasses ? ` (Total Passes: ${totalPasses})` : ""}`;
175
+ },
176
+ });
177
+ registerTool({
178
+ name: "augment_roadmap",
179
+ description: "Insert a new pass into the current roadmap. Use this when significant unexpected complexity is discovered.",
180
+ input_schema: {
181
+ type: "object",
182
+ properties: {
183
+ addedPassCount: {
184
+ type: "number",
185
+ description: "How many passes to add (usually 1)",
186
+ },
187
+ newPassFocus: {
188
+ type: "string",
189
+ description: "The focus for the upcoming augmented pass",
190
+ },
191
+ reason: {
192
+ type: "string",
193
+ description: "Why is the roadmap being augmented? (Mindfulness discovery)",
194
+ },
195
+ },
196
+ required: ["addedPassCount", "newPassFocus", "reason"],
197
+ },
198
+ execute: async (args, onProgress) => {
199
+ const count = args.addedPassCount;
200
+ const focus = getStringArg(args, "newPassFocus");
201
+ const reason = getStringArg(args, "reason");
202
+ onProgress?.({
203
+ context: `Roadmap Augmented: ${reason}`,
204
+ achieved: [`Calibrated roadmap: +${count} pass(es)`],
205
+ totalPasses: count,
206
+ passFocus: focus,
207
+ });
208
+ return `Roadmap augmented with ${count} additional pass(es). Reason: ${reason}`;
209
+ },
210
+ });
211
+ registerTool({
212
+ name: "generate_migration_plan",
213
+ description: "Generate a step-by-step 'Blueprint' for migrating code from an old pattern to a new one.",
214
+ input_schema: {
215
+ type: "object",
216
+ properties: {
217
+ fromPattern: {
218
+ type: "string",
219
+ description: "The pattern being replaced",
220
+ },
221
+ toPattern: { type: "string", description: "The new target pattern" },
222
+ files: {
223
+ type: "array",
224
+ items: { type: "string" },
225
+ description: "List of files to migrate",
226
+ },
227
+ },
228
+ required: ["fromPattern", "toPattern", "files"],
229
+ },
230
+ execute: async (args) => {
231
+ const files = args.files;
232
+ let result = `# 📐 Migration Blueprint\n\n`;
233
+ result += `**Trajectory**: From \`${args.fromPattern}\` to \`${args.toPattern}\`\n\n`;
234
+ result += `## 🗺️ Execution Steps\n`;
235
+ result += `1. **Analysis**: Map all instances of old pattern in ${files.length} files.\n`;
236
+ result += `2. **Transformation**: Apply structural replacements using \`replace_in_file\`.\n`;
237
+ result += `3. **Verification**: Run \`check_ripple_health\` and \`run_test_suite\`.\n\n`;
238
+ result += `## 🗂️ Target Garden\n`;
239
+ files
240
+ .slice(0, 10)
241
+ .forEach((f) => (result += `- \`${f.split("/").pop()}\`\n`));
242
+ if (files.length > 10)
243
+ result += `- ... and ${files.length - 10} more.\n`;
244
+ return result;
245
+ },
246
+ });
247
+ registerTool({
248
+ name: "generate_architectural_decision",
249
+ description: "Generate a structured ADR (Architectural Decision Record) to document a major shift in the project.",
250
+ isDestructive: true,
251
+ input_schema: {
252
+ type: "object",
253
+ properties: {
254
+ title: { type: "string", description: "Concise title of the decision" },
255
+ context: {
256
+ type: "string",
257
+ description: "The problem or context driving this change",
258
+ },
259
+ decision: {
260
+ type: "string",
261
+ description: "The chosen solution and rationale",
262
+ },
263
+ consequences: {
264
+ type: "string",
265
+ description: "Impact on the system moving forward",
266
+ },
267
+ },
268
+ required: ["title", "context", "decision", "consequences"],
269
+ },
270
+ execute: async (args) => {
271
+ const root = getWorkspaceRoot();
272
+ if (!root)
273
+ return "No workspace detected.";
274
+ const id = `ADR-${Math.round(Date.now() / 1000)}`;
275
+ const adrDir = path.join(root, ".marie", "decisions");
276
+ const adrPath = path.join(adrDir, `${id}.md`);
277
+ const title = getStringArg(args, "title");
278
+ const historyContext = title.includes("Refactor")
279
+ ? `\n## Historical Context\n> This decision aligns with the trajectory identified in the Evolution Chronicle. ✨\n`
280
+ : "";
281
+ const adrContent = `# 🛡️ ${id}: ${title}\n\n` +
282
+ `**Date**: ${new Date().toLocaleDateString()}\n` +
283
+ `**Status**: Accepted\n\n` +
284
+ historyContext +
285
+ `## Context\n${getStringArg(args, "context")}\n\n` +
286
+ `## Decision\n${getStringArg(args, "decision")}\n\n` +
287
+ `## Consequences\n${getStringArg(args, "consequences")}\n\n` +
288
+ `--- \nGenerated by Marie Autonomous Agent ✨`;
289
+ try {
290
+ await fs.mkdir(adrDir, { recursive: true });
291
+ await fs.writeFile(adrPath, adrContent);
292
+ return `Architectural Decision Record saved to \`.marie/decisions/${id}.md\`. History preserved. 🛡️`;
293
+ }
294
+ catch (e) {
295
+ return `Failed to save ADR: ${e}`;
296
+ }
297
+ },
298
+ });
299
+ }
300
+ //# sourceMappingURL=PlanningTools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlanningTools.js","sourceRoot":"","sources":["../../../../../src/monolith/infrastructure/tools/definitions/PlanningTools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG5D,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G,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;gBAC/C,CAAC,CAAC,gHAAgH;gBAClH,CAAC,CAAC,EAAE,CAAC;YAEP,MAAM,UAAU,GACd,SAAS,EAAE,KAAK,KAAK,MAAM;gBAC3B,aAAa,IAAI,IAAI,EAAE,CAAC,kBAAkB,EAAE,IAAI;gBAChD,0BAA0B;gBAC1B,cAAc;gBACd,eAAe,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM;gBAClD,gBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM;gBACpD,oBAAoB,YAAY,CAAC,IAAI,EAAE,cAAc,CAAC,MAAM;gBAC5D,6CAA6C,CAAC;YAEhD,IAAI,CAAC;gBACH,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC5C,MAAM,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;gBACxC,OAAO,6DAA6D,EAAE,+BAA+B,CAAC;YACxG,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,OAAO,uBAAuB,CAAC,EAAE,CAAC;YACpC,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,238 @@
1
+ import * as path from "path";
2
+ import * as fs from "fs/promises";
3
+ import * as os from "os";
4
+ import { exec, spawn } from "child_process";
5
+ import { promisify } from "util";
6
+ import { getErrorMessage, getWorkspaceRoot } from "./utils/PlumbingCore.js";
7
+ import { getCapabilities } from "../infrastructure/Configuration.js";
8
+ import { register } from "./terminal/ProcessRegistry.js";
9
+ const execAsync = promisify(exec);
10
+ const textDecoder = new TextDecoder();
11
+ const textEncoder = new TextEncoder();
12
+ // --- 1. PATH RESOLUTION (Merged from PathResolver) ---
13
+ export function resolvePath(p) {
14
+ let resolvedPath = p;
15
+ if (p.startsWith("~"))
16
+ resolvedPath = path.join(os.homedir(), p.slice(1));
17
+ if (path.isAbsolute(resolvedPath))
18
+ return path.normalize(resolvedPath);
19
+ const workspaceRoot = getWorkspaceRoot();
20
+ if (workspaceRoot)
21
+ return path.join(workspaceRoot, resolvedPath);
22
+ return path.normalize(resolvedPath);
23
+ }
24
+ // --- 2. FILESYSTEM OPERATIONS (Merged from FileService) ---
25
+ export async function readFile(filePath, startLine, endLine, signal) {
26
+ if (signal?.aborted)
27
+ throw new Error(`AbortError: Read of ${filePath} aborted.`);
28
+ const fullPath = resolvePath(filePath);
29
+ try {
30
+ const buffer = await fs.readFile(fullPath);
31
+ if (signal?.aborted)
32
+ throw new Error("Aborted");
33
+ const text = textDecoder.decode(buffer);
34
+ if (startLine !== undefined || endLine !== undefined) {
35
+ const lines = text.split("\n");
36
+ const start = startLine !== undefined ? Math.max(0, startLine - 1) : 0;
37
+ const end = endLine !== undefined ? Math.min(lines.length, endLine) : lines.length;
38
+ return lines.slice(start, end).join("\n");
39
+ }
40
+ return text;
41
+ }
42
+ catch (error) {
43
+ throw new Error(`Failed to read file ${filePath}: ${error}`);
44
+ }
45
+ }
46
+ export async function writeFile(filePath, content, signal, onProgress) {
47
+ if (signal?.aborted)
48
+ throw new Error("Aborted");
49
+ const fullPath = resolvePath(filePath);
50
+ try {
51
+ const parentDir = path.dirname(fullPath);
52
+ await fs.mkdir(parentDir, { recursive: true });
53
+ const tmpPath = `${fullPath}.tmp.${Math.random().toString(36).substring(2, 9)}`;
54
+ const encoded = textEncoder.encode(content);
55
+ await fs.writeFile(tmpPath, encoded);
56
+ onProgress?.(encoded.length, encoded.length);
57
+ if (signal?.aborted) {
58
+ await fs.unlink(tmpPath).catch(() => { });
59
+ throw new Error("Aborted");
60
+ }
61
+ await fs.rename(tmpPath, fullPath);
62
+ }
63
+ catch (error) {
64
+ throw new Error(`Failed to write file ${filePath}: ${error}`);
65
+ }
66
+ }
67
+ export async function appendFile(filePath, content, signal, onProgress) {
68
+ if (signal?.aborted)
69
+ throw new Error("Aborted");
70
+ const fullPath = resolvePath(filePath);
71
+ try {
72
+ const buffer = Buffer.from(content, "utf-8");
73
+ await fs.appendFile(fullPath, buffer);
74
+ onProgress?.(buffer.length, buffer.length);
75
+ }
76
+ catch (error) {
77
+ throw new Error(`Failed to append to file ${filePath}: ${error}`);
78
+ }
79
+ }
80
+ export async function deleteFile(filePath) {
81
+ const fullPath = resolvePath(filePath);
82
+ await fs.rm(fullPath, { recursive: true, force: true });
83
+ }
84
+ export async function listFiles(dirPath) {
85
+ const fullPath = resolvePath(dirPath);
86
+ const entries = await fs.readdir(fullPath);
87
+ const results = await Promise.all(entries.map(async (name) => {
88
+ const entryPath = path.join(fullPath, name);
89
+ try {
90
+ const stat = await fs.stat(entryPath);
91
+ return `${stat.isDirectory() ? "DIR " : "FILE"} ${name}${!stat.isDirectory() ? ` (${(stat.size / 1024).toFixed(1)} KB)` : ""}`;
92
+ }
93
+ catch {
94
+ return "";
95
+ }
96
+ }));
97
+ return results.filter(Boolean).join("\n") || "Directory is empty.";
98
+ }
99
+ // --- 3. GIT OPERATIONS (Merged from GitService) ---
100
+ export async function gitStatus(cwd) {
101
+ try {
102
+ const { stdout } = await execAsync("git status --short", { cwd });
103
+ return stdout || "Clean workspace.";
104
+ }
105
+ catch (error) {
106
+ return `Git error: ${getErrorMessage(error)}`;
107
+ }
108
+ }
109
+ export async function getStagedDiff(cwd) {
110
+ const { stdout } = await execAsync("git diff --cached", { cwd });
111
+ return stdout || "No staged changes.";
112
+ }
113
+ export async function getUnstagedDiff(cwd) {
114
+ const { stdout } = await execAsync("git diff", { cwd });
115
+ return stdout || "No unstaged changes.";
116
+ }
117
+ // --- 4. TERMINAL OPERATIONS (Merged from TerminalService) ---
118
+ const MAX_OUTPUT_LENGTH = 10000;
119
+ const ANSI_REGEX = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
120
+ const stripAnsi = (t) => t.replace(ANSI_REGEX, "");
121
+ export async function runCommand(command, signal) {
122
+ if (!getCapabilities().includes("SHELL"))
123
+ return "Capability Breach: Shell disabled. 🛑";
124
+ if (/[;&|`$(){}]/.test(command))
125
+ return "Security Error: Suspicious characters detected. 🛑";
126
+ const rootPath = getWorkspaceRoot();
127
+ let childProcess;
128
+ const spawnPromise = new Promise((resolve, reject) => {
129
+ childProcess = spawn(command, { cwd: rootPath, shell: true, stdio: ["ignore", "pipe", "pipe"], detached: true });
130
+ register(childProcess);
131
+ let stdout = "", stderr = "";
132
+ childProcess.stdout?.on("data", (d) => stdout += d.toString());
133
+ childProcess.stderr?.on("data", (d) => stderr += d.toString());
134
+ childProcess.on("close", (code) => resolve({ stdout, stderr, code }));
135
+ childProcess.on("error", (err) => reject(err));
136
+ });
137
+ const { stdout, stderr, code } = await spawnPromise;
138
+ if (code !== 0)
139
+ return `Failed (${code}):\n${stripAnsi(stderr).slice(-MAX_OUTPUT_LENGTH)}`;
140
+ return `Success. ✨\n\n**Output:**\n\`\`\`\n${stripAnsi(stdout).slice(-MAX_OUTPUT_LENGTH)}\n\`\`\``;
141
+ }
142
+ export async function runLint(cwd, command = "npm run lint") {
143
+ try {
144
+ await execAsync(command, { cwd });
145
+ return [];
146
+ }
147
+ catch {
148
+ return [];
149
+ }
150
+ }
151
+ export async function runLintOnFile(cwd, filePath) {
152
+ try {
153
+ const { stdout } = await execAsync(`npx eslint "${filePath}" --format json`, { cwd });
154
+ const results = JSON.parse(stdout);
155
+ return results[0]?.messages.map((m) => ({
156
+ file: filePath, line: m.line, column: m.column, message: m.message, ruleId: m.ruleId, severity: m.severity === 2 ? "error" : "warning"
157
+ })) || [];
158
+ }
159
+ catch {
160
+ return [];
161
+ }
162
+ }
163
+ export function suggestFix(err) { if (err.ruleId === "prefer-const")
164
+ return "Replace 'let' with 'const'."; return null; }
165
+ export async function mend(filePath, errors) {
166
+ const content = await fs.readFile(filePath, "utf-8");
167
+ const lines = content.split("\n");
168
+ let fixed = 0;
169
+ for (const err of [...errors].sort((a, b) => b.line - a.line)) {
170
+ const idx = err.line - 1;
171
+ if (idx < 0 || idx >= lines.length)
172
+ continue;
173
+ if (err.ruleId === "prefer-const") {
174
+ lines[idx] = lines[idx].replace(/\blet\b/, "const");
175
+ fixed++;
176
+ }
177
+ }
178
+ if (fixed > 0)
179
+ await fs.writeFile(filePath, lines.join("\n"));
180
+ return fixed;
181
+ }
182
+ // --- 6. COMPLEXITY & HEALTH ---
183
+ export async function analyzeComplexity(filePath) {
184
+ const content = await fs.readFile(filePath, "utf-8");
185
+ const complexity = (content.match(/\b(if|for|while|case|catch|&&|\|\|)\b/g)?.length || 0) + 1;
186
+ return { cyclomaticComplexity: complexity, clutterLevel: complexity > 20 ? "Toxic" : "Healthy", loc: content.split("\n").length, suggestions: complexity > 20 ? ["Refactor into smaller functions."] : [] };
187
+ }
188
+ export async function checkCodeHealth(filePath) {
189
+ const content = await fs.readFile(filePath, "utf-8");
190
+ const lines = content.split("\n");
191
+ const todos = (content.match(/TODO|FIXME/g) || []).length;
192
+ const anys = (content.match(/: any|as any/g) || []).length;
193
+ let joyScore = 100 - (todos * 2) - (anys * 5) - (lines.length > 300 ? 10 : 0);
194
+ return { filePath, joyScore: Math.max(0, joyScore), todos, anys, zoningHealth: { isBackflowPresent: false, illegalImports: [] } };
195
+ }
196
+ // --- 7. DISCOVERY & DEPENDENCIES ---
197
+ export async function getFolderTree(folderPath, depth = 3) {
198
+ const entries = await fs.readdir(folderPath, { withFileTypes: true });
199
+ let tree = `# Tree: ${path.basename(folderPath)}\n`;
200
+ for (const e of entries.filter(e => !e.name.startsWith(".")))
201
+ tree += `${e.isDirectory() ? "📁" : "📄"} ${e.name}\n`;
202
+ return tree;
203
+ }
204
+ export async function getFileNetwork(filePath) {
205
+ const content = await fs.readFile(filePath, "utf-8");
206
+ const imports = content.match(/import\s+.*\s+from\s+['"](.*)['"]/g) || [];
207
+ const exports = content.match(/export\s+(const|class|function|type|interface|enum)\s+(\w+)/g) || [];
208
+ let res = `# Network: ${path.basename(filePath)}\n\n## Imports\n`;
209
+ imports.forEach(i => res += `- \`${i}\`\n`);
210
+ res += `\n## Exports\n`;
211
+ exports.forEach(e => res += `- \`${e}\`\n`);
212
+ return res;
213
+ }
214
+ // --- 8. SENTINEL & AUDIT ---
215
+ export async function evaluateQualityGuardrail(cwd, filePath) {
216
+ const errors = await runLintOnFile(cwd, filePath);
217
+ const health = await checkCodeHealth(filePath);
218
+ const complexity = await analyzeComplexity(filePath);
219
+ const passed = errors.length === 0 && complexity.clutterLevel !== "Toxic";
220
+ return { passed, score: health.joyScore, errors: errors.length };
221
+ }
222
+ export async function audit(workingDir) { return { passed: true, entropy: 0 }; }
223
+ export async function checkPlanetaryHealth() {
224
+ const deps = ["rg", "fd", "npm"];
225
+ const results = await Promise.all(deps.map(async (d) => { try {
226
+ await execAsync(`${d} --version`, { timeout: 2000 });
227
+ return true;
228
+ }
229
+ catch {
230
+ return false;
231
+ } }));
232
+ const missing = deps.filter((_, i) => !results[i]);
233
+ if (missing.length)
234
+ console.warn(`Stability Warning: Missing ${missing.join(", ")}`);
235
+ else
236
+ console.log("[Plumbing] Planetary health verified. 🌍");
237
+ }
238
+ //# sourceMappingURL=Plumbing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Plumbing.js","sourceRoot":"","sources":["../../../src/monolith/plumbing/Plumbing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAEzB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAiB,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAmB,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,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