@noorm/marie-cli 0.1.18 → 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 (251) hide show
  1. package/README.md +7 -15
  2. package/SENTINEL.md +4 -7
  3. package/dist/cli-new/components/App.js +16 -63
  4. package/dist/cli-new/components/App.js.map +1 -1
  5. package/dist/cli-new/components/ApprovalDialog.js +2 -1
  6. package/dist/cli-new/components/ApprovalDialog.js.map +1 -1
  7. package/dist/cli-new/components/Banner.js +4 -3
  8. package/dist/cli-new/components/Banner.js.map +1 -1
  9. package/dist/cli-new/components/ChatArea.js +6 -7
  10. package/dist/cli-new/components/ChatArea.js.map +1 -1
  11. package/dist/cli-new/components/Header.js +13 -7
  12. package/dist/cli-new/components/Header.js.map +1 -1
  13. package/dist/cli-new/components/InputArea.js +73 -12
  14. package/dist/cli-new/components/InputArea.js.map +1 -1
  15. package/dist/cli-new/components/MessageBubble.js +26 -18
  16. package/dist/cli-new/components/MessageBubble.js.map +1 -1
  17. package/dist/cli-new/components/SessionSwitcher.js +4 -7
  18. package/dist/cli-new/components/SessionSwitcher.js.map +1 -1
  19. package/dist/cli-new/components/SetupWizard.js +80 -257
  20. package/dist/cli-new/components/SetupWizard.js.map +1 -1
  21. package/dist/cli-new/components/ToolCallDisplay.js +20 -5
  22. package/dist/cli-new/components/ToolCallDisplay.js.map +1 -1
  23. package/dist/cli-new/components/WizardSteps.js +22 -0
  24. package/dist/cli-new/components/WizardSteps.js.map +1 -0
  25. package/dist/cli-new/constants/SetupConstants.js +42 -0
  26. package/dist/cli-new/constants/SetupConstants.js.map +1 -0
  27. package/dist/cli-new/hooks/useGit.js +19 -62
  28. package/dist/cli-new/hooks/useGit.js.map +1 -1
  29. package/dist/cli-new/hooks/useMarie.js +26 -18
  30. package/dist/cli-new/hooks/useMarie.js.map +1 -1
  31. package/dist/cli-new/hooks/useSessions.js +1 -1
  32. package/dist/cli-new/hooks/useSessions.js.map +1 -1
  33. package/dist/cli-new/hooks/useSetupWizard.js +88 -0
  34. package/dist/cli-new/hooks/useSetupWizard.js.map +1 -0
  35. package/dist/cli-new/hooks/useUpdateCheck.js +4 -3
  36. package/dist/cli-new/hooks/useUpdateCheck.js.map +1 -1
  37. package/dist/cli-new/index.js +2 -4
  38. package/dist/cli-new/index.js.map +1 -1
  39. package/dist/cli-new/services/CommandService.js +104 -0
  40. package/dist/cli-new/services/CommandService.js.map +1 -0
  41. package/dist/cli-new/services/GitService.js +91 -0
  42. package/dist/cli-new/services/GitService.js.map +1 -0
  43. package/dist/cli-new/services/MarieService.js +77 -0
  44. package/dist/cli-new/services/MarieService.js.map +1 -0
  45. package/dist/cli-new/services/auth-server.js +128 -0
  46. package/dist/cli-new/services/auth-server.js.map +1 -0
  47. package/dist/cli-new/utils/version.js +24 -0
  48. package/dist/cli-new/utils/version.js.map +1 -0
  49. package/dist/monolith/adapters/CliMarieAdapter.js +12 -11
  50. package/dist/monolith/adapters/CliMarieAdapter.js.map +1 -1
  51. package/dist/monolith/cli/CliFileSystemPort.js +17 -3
  52. package/dist/monolith/cli/CliFileSystemPort.js.map +1 -1
  53. package/dist/monolith/cli/MarieToolDefinitionsCLI.js +39 -31
  54. package/dist/monolith/cli/MarieToolDefinitionsCLI.js.map +1 -1
  55. package/dist/monolith/cli/index.js +5 -20
  56. package/dist/monolith/cli/index.js.map +1 -1
  57. package/dist/monolith/cli/services/JoyAutomationServiceCLI.js +15 -62
  58. package/dist/monolith/cli/services/JoyAutomationServiceCLI.js.map +1 -1
  59. package/dist/monolith/cli/storage.js +142 -72
  60. package/dist/monolith/cli/storage.js.map +1 -1
  61. package/dist/monolith/domain/joy/RitualService.js +44 -46
  62. package/dist/monolith/domain/joy/RitualService.js.map +1 -1
  63. package/dist/monolith/domain/marie/MarieCortex.js +148 -0
  64. package/dist/monolith/domain/marie/MarieCortex.js.map +1 -0
  65. package/dist/monolith/domain/marie/PersonalityRenderer.js +97 -0
  66. package/dist/monolith/domain/marie/PersonalityRenderer.js.map +1 -0
  67. package/dist/monolith/infrastructure/Configuration.js +68 -0
  68. package/dist/monolith/infrastructure/Configuration.js.map +1 -0
  69. package/dist/monolith/infrastructure/CoreInfrastructure.js +204 -0
  70. package/dist/monolith/infrastructure/CoreInfrastructure.js.map +1 -0
  71. package/dist/monolith/infrastructure/ai/agents/MarieAscendant.js +3 -3
  72. package/dist/monolith/infrastructure/ai/agents/MarieAscendant.js.map +1 -1
  73. package/dist/monolith/infrastructure/ai/context/ContextArchiveService.js +6 -27
  74. package/dist/monolith/infrastructure/ai/context/ContextArchiveService.js.map +1 -1
  75. package/dist/monolith/infrastructure/ai/context/ContextManager.js +142 -131
  76. package/dist/monolith/infrastructure/ai/context/ContextManager.js.map +1 -1
  77. package/dist/monolith/infrastructure/ai/core/MarieEngine.js +115 -1077
  78. package/dist/monolith/infrastructure/ai/core/MarieEngine.js.map +1 -1
  79. package/dist/monolith/infrastructure/ai/core/MarieEventDispatcher.js +1 -37
  80. package/dist/monolith/infrastructure/ai/core/MarieEventDispatcher.js.map +1 -1
  81. package/dist/monolith/infrastructure/ai/core/MarieLockManager.js +6 -1
  82. package/dist/monolith/infrastructure/ai/core/MarieLockManager.js.map +1 -1
  83. package/dist/monolith/infrastructure/ai/core/MarieProgressTracker.js +172 -221
  84. package/dist/monolith/infrastructure/ai/core/MarieProgressTracker.js.map +1 -1
  85. package/dist/monolith/infrastructure/ai/core/MarieSanitizer.js +292 -141
  86. package/dist/monolith/infrastructure/ai/core/MarieSanitizer.js.map +1 -1
  87. package/dist/monolith/infrastructure/ai/core/MarieToolProcessor.js +331 -614
  88. package/dist/monolith/infrastructure/ai/core/MarieToolProcessor.js.map +1 -1
  89. package/dist/monolith/infrastructure/ai/core/MarieVitality.js +238 -0
  90. package/dist/monolith/infrastructure/ai/core/MarieVitality.js.map +1 -0
  91. package/dist/monolith/infrastructure/ai/core/SessionLogService.js +9 -2
  92. package/dist/monolith/infrastructure/ai/core/SessionLogService.js.map +1 -1
  93. package/dist/monolith/infrastructure/ai/providers/AIProvider.js +402 -1
  94. package/dist/monolith/infrastructure/ai/providers/AIProvider.js.map +1 -1
  95. package/dist/monolith/infrastructure/ai/providers/DreamBeesProvider.js +114 -0
  96. package/dist/monolith/infrastructure/ai/providers/DreamBeesProvider.js.map +1 -0
  97. package/dist/monolith/infrastructure/ai/providers/OpenRouterProvider.js +426 -392
  98. package/dist/monolith/infrastructure/ai/providers/OpenRouterProvider.js.map +1 -1
  99. package/dist/monolith/infrastructure/ai/providers/OpenRouterStreamParser.js +235 -241
  100. package/dist/monolith/infrastructure/ai/providers/OpenRouterStreamParser.js.map +1 -1
  101. package/dist/monolith/infrastructure/ai/workerAi.js +185 -0
  102. package/dist/monolith/infrastructure/ai/workerAi.js.map +1 -0
  103. package/dist/monolith/infrastructure/config/ConfigService.js +216 -503
  104. package/dist/monolith/infrastructure/config/ConfigService.js.map +1 -1
  105. package/dist/monolith/infrastructure/joy/CognitiveRituals.js +4 -165
  106. package/dist/monolith/infrastructure/joy/CognitiveRituals.js.map +1 -1
  107. package/dist/monolith/infrastructure/joy/JoyTools.js +14 -47
  108. package/dist/monolith/infrastructure/joy/JoyTools.js.map +1 -1
  109. package/dist/monolith/infrastructure/persistence/MarieMindAutonomics.js +4 -0
  110. package/dist/monolith/infrastructure/persistence/MarieMindAutonomics.js.map +1 -0
  111. package/dist/monolith/infrastructure/persistence/MarieMindEngine.js +11 -0
  112. package/dist/monolith/infrastructure/persistence/MarieMindEngine.js.map +1 -0
  113. package/dist/monolith/infrastructure/persistence/NoormmeAutonomics.js +123 -106
  114. package/dist/monolith/infrastructure/persistence/NoormmeAutonomics.js.map +1 -1
  115. package/dist/monolith/infrastructure/persistence/NoormmeEngine.js +508 -63
  116. package/dist/monolith/infrastructure/persistence/NoormmeEngine.js.map +1 -1
  117. package/dist/monolith/infrastructure/persistence/NoormmeSchema.js +68 -39
  118. package/dist/monolith/infrastructure/persistence/NoormmeSchema.js.map +1 -1
  119. package/dist/monolith/infrastructure/persistence/NoormmeSeeder.js +80 -67
  120. package/dist/monolith/infrastructure/persistence/NoormmeSeeder.js.map +1 -1
  121. package/dist/monolith/infrastructure/persistence/NoormmeTools.js +122 -75
  122. package/dist/monolith/infrastructure/persistence/NoormmeTools.js.map +1 -1
  123. package/dist/monolith/infrastructure/services/MarieMemoryStore.js +133 -134
  124. package/dist/monolith/infrastructure/services/MarieMemoryStore.js.map +1 -1
  125. package/dist/monolith/infrastructure/tools/MarieToolDefinitions.js +6 -30
  126. package/dist/monolith/infrastructure/tools/MarieToolDefinitions.js.map +1 -1
  127. package/dist/monolith/infrastructure/tools/PureStreamParser.js +68 -80
  128. package/dist/monolith/infrastructure/tools/PureStreamParser.js.map +1 -1
  129. package/dist/monolith/infrastructure/tools/SharedToolDefinitions.js +12 -11
  130. package/dist/monolith/infrastructure/tools/SharedToolDefinitions.js.map +1 -1
  131. package/dist/monolith/infrastructure/tools/SovereignTools.js +326 -0
  132. package/dist/monolith/infrastructure/tools/SovereignTools.js.map +1 -0
  133. package/dist/monolith/infrastructure/tools/ToolRegistry.js +45 -26
  134. package/dist/monolith/infrastructure/tools/ToolRegistry.js.map +1 -1
  135. package/dist/monolith/infrastructure/tools/definitions/AnalysisTools.js +39 -153
  136. package/dist/monolith/infrastructure/tools/definitions/AnalysisTools.js.map +1 -1
  137. package/dist/monolith/infrastructure/tools/definitions/AutomationTools.js +31 -46
  138. package/dist/monolith/infrastructure/tools/definitions/AutomationTools.js.map +1 -1
  139. package/dist/monolith/infrastructure/tools/definitions/ContextTools.js +41 -13
  140. package/dist/monolith/infrastructure/tools/definitions/ContextTools.js.map +1 -1
  141. package/dist/monolith/infrastructure/tools/definitions/CoreTools.js +10 -14
  142. package/dist/monolith/infrastructure/tools/definitions/CoreTools.js.map +1 -1
  143. package/dist/monolith/infrastructure/tools/definitions/DiagnosticTools.js +39 -70
  144. package/dist/monolith/infrastructure/tools/definitions/DiagnosticTools.js.map +1 -1
  145. package/dist/monolith/infrastructure/tools/definitions/NavigationTools.js +30 -181
  146. package/dist/monolith/infrastructure/tools/definitions/NavigationTools.js.map +1 -1
  147. package/dist/monolith/infrastructure/tools/definitions/PlanningTools.js +12 -9
  148. package/dist/monolith/infrastructure/tools/definitions/PlanningTools.js.map +1 -1
  149. package/dist/monolith/plumbing/Plumbing.js +238 -0
  150. package/dist/monolith/plumbing/Plumbing.js.map +1 -0
  151. package/dist/monolith/plumbing/PlumbingAnalysis.js +109 -0
  152. package/dist/monolith/plumbing/PlumbingAnalysis.js.map +1 -0
  153. package/dist/monolith/plumbing/PlumbingSystem.js +169 -0
  154. package/dist/monolith/plumbing/PlumbingSystem.js.map +1 -0
  155. package/dist/monolith/plumbing/analysis/ComplexityService.js +30 -34
  156. package/dist/monolith/plumbing/analysis/ComplexityService.js.map +1 -1
  157. package/dist/monolith/plumbing/analysis/DependencyService.js +55 -44
  158. package/dist/monolith/plumbing/analysis/DependencyService.js.map +1 -1
  159. package/dist/monolith/plumbing/analysis/DiscoveryService.js +40 -42
  160. package/dist/monolith/plumbing/analysis/DiscoveryService.js.map +1 -1
  161. package/dist/monolith/plumbing/analysis/JoyMapService.js +52 -56
  162. package/dist/monolith/plumbing/analysis/JoyMapService.js.map +1 -1
  163. package/dist/monolith/plumbing/analysis/LintService.js +118 -118
  164. package/dist/monolith/plumbing/analysis/LintService.js.map +1 -1
  165. package/dist/monolith/plumbing/analysis/MarieSentinelService.js +278 -268
  166. package/dist/monolith/plumbing/analysis/MarieSentinelService.js.map +1 -1
  167. package/dist/monolith/plumbing/analysis/QualityGuardrailService.js +116 -114
  168. package/dist/monolith/plumbing/analysis/QualityGuardrailService.js.map +1 -1
  169. package/dist/monolith/plumbing/analysis/SurgicalMender.js +57 -59
  170. package/dist/monolith/plumbing/analysis/SurgicalMender.js.map +1 -1
  171. package/dist/monolith/plumbing/analysis/TestService.js +89 -89
  172. package/dist/monolith/plumbing/analysis/TestService.js.map +1 -1
  173. package/dist/monolith/plumbing/filesystem/FileService.js +123 -195
  174. package/dist/monolith/plumbing/filesystem/FileService.js.map +1 -1
  175. package/dist/monolith/plumbing/filesystem/PathResolver.js +7 -8
  176. package/dist/monolith/plumbing/filesystem/PathResolver.js.map +1 -1
  177. package/dist/monolith/plumbing/git/GitService.js +4 -4
  178. package/dist/monolith/plumbing/git/GitService.js.map +1 -1
  179. package/dist/monolith/plumbing/lsp/SymbolService.js +5 -34
  180. package/dist/monolith/plumbing/lsp/SymbolService.js.map +1 -1
  181. package/dist/monolith/plumbing/terminal/ProcessRegistry.js +20 -22
  182. package/dist/monolith/plumbing/terminal/ProcessRegistry.js.map +1 -1
  183. package/dist/monolith/plumbing/terminal/TerminalService.js +127 -141
  184. package/dist/monolith/plumbing/terminal/TerminalService.js.map +1 -1
  185. package/dist/monolith/plumbing/utils/EnvironmentUtils.js +3 -23
  186. package/dist/monolith/plumbing/utils/EnvironmentUtils.js.map +1 -1
  187. package/dist/monolith/plumbing/utils/JsonUtils.js +252 -311
  188. package/dist/monolith/plumbing/utils/JsonUtils.js.map +1 -1
  189. package/dist/monolith/plumbing/utils/PlumbingCore.js +549 -0
  190. package/dist/monolith/plumbing/utils/PlumbingCore.js.map +1 -0
  191. package/dist/monolith/plumbing/utils/PrefixTree.js +61 -114
  192. package/dist/monolith/plumbing/utils/PrefixTree.js.map +1 -1
  193. package/dist/monolith/plumbing/utils/StreamTagDetector.js +89 -127
  194. package/dist/monolith/plumbing/utils/StreamTagDetector.js.map +1 -1
  195. package/dist/monolith/plumbing/utils/StringUtils.js +87 -89
  196. package/dist/monolith/plumbing/utils/StringUtils.js.map +1 -1
  197. package/dist/monolith/runtime/MarieRuntime.js +76 -499
  198. package/dist/monolith/runtime/MarieRuntime.js.map +1 -1
  199. package/dist/monolith/runtime/RuntimeAdapterBase.js +1 -1
  200. package/dist/monolith/runtime/RuntimeAdapterBase.js.map +1 -1
  201. package/dist/monolith/runtime/providerFactory.js +1 -7
  202. package/dist/monolith/runtime/providerFactory.js.map +1 -1
  203. package/dist/monolith/services/HealthService.js +29 -32
  204. package/dist/monolith/services/HealthService.js.map +1 -1
  205. package/dist/monolith/services/JoyAutomationService.js +58 -95
  206. package/dist/monolith/services/JoyAutomationService.js.map +1 -1
  207. package/dist/monolith/services/MarieAutomationService.js +59 -0
  208. package/dist/monolith/services/MarieAutomationService.js.map +1 -0
  209. package/dist/monolith/services/MarieGhostService.js +46 -173
  210. package/dist/monolith/services/MarieGhostService.js.map +1 -1
  211. package/dist/monolith/services/MarieServices.js +102 -0
  212. package/dist/monolith/services/MarieServices.js.map +1 -0
  213. package/dist/monolith/services/MarieTypes.js +2 -0
  214. package/dist/monolith/services/MarieTypes.js.map +1 -0
  215. package/dist/monolith/services/UpdateService.js +47 -49
  216. package/dist/monolith/services/UpdateService.js.map +1 -1
  217. package/dist/prompts.js +11 -5
  218. package/dist/prompts.js.map +1 -1
  219. package/dist/test_prefix_tree.js +9 -9
  220. package/dist/test_prefix_tree.js.map +1 -1
  221. package/package.json +18 -89
  222. package/run_test.js +5 -0
  223. package/.marie_visual_verify_1771225696548/progress_bar_check.txt +0 -1
  224. package/dist/extension.cjs +0 -1155
  225. package/dist/extension.js +0 -474
  226. package/dist/extension.js.map +0 -1
  227. package/dist/monolith/adapters/VscodeMarieAdapter.js +0 -81
  228. package/dist/monolith/adapters/VscodeMarieAdapter.js.map +0 -1
  229. package/dist/monolith/infrastructure/ai/core/GhostPort.js +0 -2
  230. package/dist/monolith/infrastructure/ai/core/GhostPort.js.map +0 -1
  231. package/dist/monolith/infrastructure/ai/core/VscodeFileSystemPort.js +0 -33
  232. package/dist/monolith/infrastructure/ai/core/VscodeFileSystemPort.js.map +0 -1
  233. package/dist/monolith/infrastructure/ai/providers/AnthropicProvider.js +0 -154
  234. package/dist/monolith/infrastructure/ai/providers/AnthropicProvider.js.map +0 -1
  235. package/dist/monolith/infrastructure/ai/providers/CerebrasProvider.js +0 -214
  236. package/dist/monolith/infrastructure/ai/providers/CerebrasProvider.js.map +0 -1
  237. package/dist/monolith/plumbing/ui/DecorationService.js +0 -54
  238. package/dist/monolith/plumbing/ui/DecorationService.js.map +0 -1
  239. package/dist/monolith/services/JoyLogService.js +0 -48
  240. package/dist/monolith/services/JoyLogService.js.map +0 -1
  241. package/dist/monolith/services/JoyService.js +0 -209
  242. package/dist/monolith/services/JoyService.js.map +0 -1
  243. package/dist/monolith/services/MarieSCMProvider.js +0 -41
  244. package/dist/monolith/services/MarieSCMProvider.js.map +0 -1
  245. package/dist/webview-ui/main.css +0 -1
  246. package/dist/webview-ui/main.js +0 -108
  247. package/lint_output.txt +0 -705
  248. package/lint_output_v2.txt +0 -711
  249. package/test-mind-p6.sqlite +0 -0
  250. package/test-mind-p6.sqlite-shm +0 -0
  251. package/test-mind-p6.sqlite-wal +0 -0
@@ -1,48 +1,8 @@
1
- // ConfigService - Environment-aware configuration
2
- // Works in both VSCode extension and CLI environments
3
- import { isVsCodeExtension, nodeRequire, } from "../../plumbing/utils/EnvironmentUtils.js";
4
- let vscodeModule = null;
5
- let hasAttemptedVscodeLoad = false;
6
- function isLikelyVscodeExtensionHost() {
7
- return isVsCodeExtension();
8
- }
9
- function getVscode() {
10
- // In CLI runtime, a local vscode shim may be resolvable as "vscode".
11
- // Only treat vscode as available when running inside VS Code extension host.
12
- if (!isLikelyVscodeExtensionHost()) {
13
- return null;
14
- }
15
- if (!hasAttemptedVscodeLoad) {
16
- hasAttemptedVscodeLoad = true;
17
- try {
18
- const loaded = nodeRequire("vscode");
19
- // Guard against the CLI vscode shim which doesn't include the full VS Code API.
20
- const version = loaded.version;
21
- const isShim = Boolean(loaded.marieShim);
22
- if (isShim ||
23
- !version ||
24
- typeof version !== "string" ||
25
- !version.startsWith("1.")) {
26
- vscodeModule = null;
27
- }
28
- else {
29
- vscodeModule = loaded;
30
- }
31
- }
32
- catch {
33
- // VSCode not available - we're in CLI mode
34
- vscodeModule = null;
35
- }
36
- }
37
- return vscodeModule;
38
- }
1
+ import * as fs from "fs";
2
+ import * as path from "path";
3
+ import * as os from "os";
39
4
  function getCliConfig() {
40
5
  try {
41
- // Prefer loading the CLI config directly from ~/.marie to avoid module resolution issues
42
- // when running the globally installed CLI.
43
- const fs = nodeRequire("fs");
44
- const path = nodeRequire("path");
45
- const os = nodeRequire("os");
46
6
  const configPath = path.join(os.homedir(), ".marie", "config.json");
47
7
  if (!fs.existsSync(configPath)) {
48
8
  return {};
@@ -50,473 +10,226 @@ function getCliConfig() {
50
10
  const raw = fs.readFileSync(configPath, "utf-8");
51
11
  return JSON.parse(raw) || {};
52
12
  }
53
- catch {
54
- try {
55
- // Fallback when ConfigService is loaded from the CLI entrypoint path.
56
- const { Storage } = nodeRequire("../monolith/cli/storage.js");
57
- return Storage.getConfig() || {};
58
- }
59
- catch {
60
- return {};
61
- }
13
+ catch (error) {
14
+ // console.warn("[ConfigService] Failed to read CLI config:", error);
15
+ return {};
62
16
  }
63
17
  }
64
- export class ConfigService {
65
- /** Cached excluded files list — invalidated on config change */
66
- static _excludedFilesCache = null;
67
- static getVscodeConfig() {
68
- const vscode = getVscode();
69
- if (!vscode)
70
- return null;
71
- return vscode.workspace.getConfiguration("marie");
72
- }
73
- static isVscode() {
74
- return getVscode() !== null;
75
- }
76
- static getApiKey() {
77
- const vscode = getVscode();
78
- if (vscode) {
79
- return vscode.workspace.getConfiguration("marie").get("apiKey");
80
- }
81
- return process.env.ANTHROPIC_API_KEY;
82
- }
83
- static getOpenRouterApiKey() {
84
- const vscode = getVscode();
85
- if (vscode) {
86
- return vscode.workspace
87
- .getConfiguration("marie")
88
- .get("openrouterApiKey");
89
- }
90
- return process.env.OPENROUTER_API_KEY;
91
- }
92
- static getCerebrasApiKey() {
93
- const vscode = getVscode();
94
- if (vscode) {
95
- return vscode.workspace
96
- .getConfiguration("marie")
97
- .get("cerebrasApiKey");
98
- }
99
- return process.env.CEREBRAS_API_KEY;
100
- }
101
- static getAiProvider() {
102
- const vscode = getVscode();
103
- if (vscode) {
104
- return vscode.workspace
105
- .getConfiguration("marie")
106
- .get("aiProvider", "anthropic");
107
- }
108
- const config = getCliConfig();
109
- return (config.aiProvider ||
110
- "anthropic");
111
- }
112
- static getFailoverPriority() {
113
- const primary = this.getAiProvider();
114
- const vscode = getVscode();
115
- if (vscode) {
116
- const configured = vscode.workspace
117
- .getConfiguration("marie")
118
- .get("failoverPriority");
119
- if (configured && Array.isArray(configured) && configured.length > 0) {
120
- return configured;
121
- }
122
- }
123
- // Default rotation based on primary
124
- if (primary === "anthropic")
125
- return ["anthropic", "openrouter", "cerebras"];
126
- if (primary === "openrouter")
127
- return ["openrouter", "cerebras", "anthropic"];
128
- return ["cerebras", "openrouter", "anthropic"];
129
- }
130
- static getModel() {
131
- const vscode = getVscode();
132
- if (vscode) {
133
- return vscode.workspace
134
- .getConfiguration("marie")
135
- .get("model", "claude-3-5-sonnet-20241022");
136
- }
137
- const config = getCliConfig();
138
- return config.model || "claude-3-5-sonnet-20241022";
139
- }
140
- static getLlmFast() {
141
- const vscode = getVscode();
142
- if (vscode) {
143
- return vscode.workspace
144
- .getConfiguration("marie")
145
- .get("modelFast", this.getModel());
146
- }
147
- const config = getCliConfig();
148
- return config.modelFast || this.getModel();
149
- }
150
- static getLlmPremium() {
151
- const vscode = getVscode();
152
- if (vscode) {
153
- return vscode.workspace
154
- .getConfiguration("marie")
155
- .get("modelPremium", this.getModel());
156
- }
157
- const config = getCliConfig();
158
- return config.modelPremium || this.getModel();
159
- }
160
- static getAutonomyMode() {
161
- const vscode = getVscode();
162
- if (vscode) {
163
- const configured = vscode.workspace
164
- .getConfiguration("marie")
165
- .get("autonomyMode");
166
- if (configured)
167
- return configured;
168
- return "high";
169
- }
170
- const config = getCliConfig();
171
- const configured = config.autonomyMode;
172
- if (configured)
173
- return configured;
174
- return "high";
175
- }
176
- static getMaxContextTokens() {
177
- const vscode = getVscode();
178
- if (vscode) {
179
- return vscode.workspace
180
- .getConfiguration("marie")
181
- .get("maxContextTokens", 100000);
182
- }
183
- return 100000;
184
- }
185
- static getExcludedFiles() {
186
- const vscode = getVscode();
187
- if (vscode) {
188
- if (this._excludedFilesCache) {
189
- return this._excludedFilesCache;
190
- }
191
- const filesExclude = vscode.workspace
192
- .getConfiguration("files")
193
- .get("exclude", {});
194
- const userExclusions = Object.keys(filesExclude).filter((key) => filesExclude[key]);
195
- const defaultExclusions = [
196
- "node_modules",
197
- "dist",
198
- "build",
199
- "out",
200
- "coverage",
201
- ".git",
202
- ".vscode",
203
- ".idea",
204
- ".DS_Store",
205
- ];
206
- this._excludedFilesCache = Array.from(new Set([...defaultExclusions, ...userExclusions]));
207
- return this._excludedFilesCache;
208
- }
209
- // CLI default exclusions
210
- return [
211
- "node_modules",
212
- "dist",
213
- "build",
214
- "out",
215
- "coverage",
216
- ".git",
217
- ".vscode",
218
- ".idea",
219
- ".DS_Store",
220
- ];
221
- }
222
- static getKeepRecentMessages() {
223
- const vscode = getVscode();
224
- if (vscode) {
225
- return vscode.workspace
226
- .getConfiguration("marie")
227
- .get("keepRecentMessages", 30);
228
- }
229
- return 30;
230
- }
231
- static getTokensPerChar() {
232
- const vscode = getVscode();
233
- if (vscode) {
234
- return vscode.workspace
235
- .getConfiguration("marie")
236
- .get("tokensPerChar", 0.35);
237
- }
238
- return 0.35;
239
- }
240
- static isAscensionEnabled() {
241
- const vscode = getVscode();
242
- if (vscode) {
243
- return vscode.workspace
244
- .getConfiguration("marie")
245
- .get("ascensionEnabled", true);
246
- }
247
- return true;
248
- }
249
- static getAscensionProfile() {
250
- const vscode = getVscode();
251
- if (vscode) {
252
- return vscode.workspace
253
- .getConfiguration("marie")
254
- .get("ascensionProfile", "balanced");
255
- }
256
- return "balanced";
257
- }
258
- static getAscensionIntensity() {
259
- const vscode = getVscode();
260
- let value = 1.0;
261
- if (vscode) {
262
- value = vscode.workspace
263
- .getConfiguration("marie")
264
- .get("ascensionIntensity", 1.2);
265
- }
266
- return Math.max(0.5, Math.min(1.5, value));
267
- }
268
- static getAscensionMaxRequiredActions() {
269
- const vscode = getVscode();
270
- let value = 2;
271
- if (vscode) {
272
- value = vscode.workspace
273
- .getConfiguration("marie")
274
- .get("ascensionMaxRequiredActions", 2);
275
- }
276
- return Math.max(0, Math.min(5, value));
277
- }
278
- static isAgentStreamsEnabled() {
279
- const vscode = getVscode();
280
- if (vscode) {
281
- return vscode.workspace
282
- .getConfiguration("marie")
283
- .get("agentStreamsEnabled", false);
284
- }
285
- const config = getCliConfig();
286
- const fromConfig = config.agentStreamsEnabled;
287
- if (typeof fromConfig === "boolean")
288
- return fromConfig;
289
- return process.env.MARIE_AGENT_STREAMS_ENABLED === "1";
290
- }
291
- static getAgentStreamMaxConcurrent() {
292
- const vscode = getVscode();
293
- let value = 2;
294
- if (vscode) {
295
- value = vscode.workspace
296
- .getConfiguration("marie")
297
- .get("agentStreamMaxConcurrent", 2);
298
- }
299
- else {
300
- const config = getCliConfig();
301
- if (typeof config.agentStreamMaxConcurrent === "number") {
302
- value = config.agentStreamMaxConcurrent;
303
- }
304
- }
305
- return Math.max(1, Math.min(8, value));
306
- }
307
- static getAgentStreamSpawnThreshold() {
308
- const vscode = getVscode();
309
- let value = 1.25;
310
- if (vscode) {
311
- value = vscode.workspace
312
- .getConfiguration("marie")
313
- .get("agentStreamSpawnThreshold", 1.25);
314
- }
315
- else {
316
- const config = getCliConfig();
317
- if (typeof config.agentStreamSpawnThreshold === "number") {
318
- value = config.agentStreamSpawnThreshold;
319
- }
320
- }
321
- return Math.max(0.25, Math.min(5, value));
322
- }
323
- static getAgentStreamTimeoutMs() {
324
- const vscode = getVscode();
325
- let value = 20000;
326
- if (vscode) {
327
- value = vscode.workspace
328
- .getConfiguration("marie")
329
- .get("agentStreamTimeoutMs", 60000);
330
- }
331
- else {
332
- const config = getCliConfig();
333
- if (typeof config.agentStreamTimeoutMs === "number") {
334
- value = config.agentStreamTimeoutMs;
335
- }
336
- }
337
- return Math.max(3000, Math.min(120000, value));
338
- }
339
- static getAgentStreamPilotAgents() {
340
- const normalize = (value) => {
341
- if (Array.isArray(value)) {
342
- return value
343
- .filter((v) => typeof v === "string")
344
- .map((v) => v.trim())
345
- .filter(Boolean);
346
- }
347
- if (typeof value === "string") {
348
- return value
349
- .split(",")
350
- .map((v) => v.trim())
351
- .filter(Boolean);
352
- }
353
- return [];
354
- };
355
- const vscode = getVscode();
356
- if (vscode) {
357
- const configured = vscode.workspace
358
- .getConfiguration("marie")
359
- .get("agentStreamPilotAgents", ["QASRE"]);
360
- return normalize(configured).length > 0
361
- ? normalize(configured)
362
- : ["QASRE"];
363
- }
364
- const config = getCliConfig();
365
- const fromConfig = normalize(config.agentStreamPilotAgents);
366
- if (fromConfig.length > 0)
367
- return fromConfig;
368
- const fromEnv = normalize(process.env.MARIE_AGENT_STREAM_PILOT_AGENTS);
369
- if (fromEnv.length > 0)
370
- return fromEnv;
371
- return ["QASRE"];
372
- }
373
- static getAgentStreamMaxSpawnsPerTurn() {
374
- const vscode = getVscode();
375
- let value = 3;
376
- if (vscode) {
377
- value = vscode.workspace
378
- .getConfiguration("marie")
379
- .get("agentStreamMaxSpawnsPerTurn", 3);
380
- }
381
- else {
382
- const config = getCliConfig();
383
- if (typeof config.agentStreamMaxSpawnsPerTurn === "number") {
384
- value = config.agentStreamMaxSpawnsPerTurn;
385
- }
386
- }
387
- return Math.max(1, Math.min(16, value));
388
- }
389
- static isAgentStreamPressureSheddingEnabled() {
390
- const vscode = getVscode();
391
- if (vscode) {
392
- return vscode.workspace
393
- .getConfiguration("marie")
394
- .get("agentStreamPressureSheddingEnabled", true);
395
- }
396
- const config = getCliConfig();
397
- if (typeof config.agentStreamPressureSheddingEnabled === "boolean") {
398
- return config.agentStreamPressureSheddingEnabled;
399
- }
400
- if (process.env.MARIE_AGENT_STREAM_PRESSURE_SHEDDING_ENABLED === "0") {
401
- return false;
402
- }
403
- return true;
404
- }
405
- static getAutoRepair() {
406
- const vscode = getVscode();
407
- if (vscode) {
408
- return vscode.workspace
409
- .getConfiguration("marie")
410
- .get("autoRepair", false);
411
- }
412
- const config = getCliConfig();
413
- return config.autoRepair || false;
414
- }
415
- // PHASE 14: Cognitive & Hygiene Config
416
- static getMaxReflections() {
417
- const vscode = getVscode();
418
- if (vscode) {
419
- return vscode.workspace
420
- .getConfiguration("marie")
421
- .get("maxReflections", 3);
422
- }
423
- return 3;
424
- }
425
- static getSanitizationMaxDepth() {
426
- return 10;
427
- }
428
- static getSanitizationStringLimit() {
429
- return 5000;
430
- }
431
- static getSanitizationBreadthLimit() {
432
- return 100;
433
- }
434
- static getSanitizationGlobalMaxSize() {
435
- return 512 * 1024; // 512KB
436
- }
437
- static getWatchdogTimeoutMs() {
438
- const vscode = getVscode();
439
- if (vscode) {
440
- return vscode.workspace
441
- .getConfiguration("marie")
442
- .get("watchdogTimeoutMs", 300000);
443
- }
444
- return 300000; // 300s
445
- }
446
- static getHeartbeatTimeoutMs() {
447
- const vscode = getVscode();
448
- if (vscode) {
449
- return vscode.workspace
450
- .getConfiguration("marie")
451
- .get("heartbeatTimeoutMs", 120000);
452
- }
453
- return 120000; // 120s
454
- }
455
- // PHASE 16: Concurrency & Sync Config
456
- static getLockTimeoutMs() {
457
- const vscode = getVscode();
458
- if (vscode) {
459
- return vscode.workspace
460
- .getConfiguration("marie")
461
- .get("lockTimeoutMs", 30000);
462
- }
463
- return 30000; // 30s
464
- }
465
- static getSemaphoreTimeoutMs() {
466
- const vscode = getVscode();
467
- if (vscode) {
468
- return vscode.workspace
469
- .getConfiguration("marie")
470
- .get("semaphoreTimeoutMs", 60000);
471
- }
472
- return 60000; // 60s
18
+ /** Cached excluded files list — invalidated on config change */
19
+ let _excludedFilesCache = null;
20
+ export function getApiKey() {
21
+ return getOpenRouterApiKey() || process.env.OPENROUTER_API_KEY;
22
+ }
23
+ export function getOpenRouterApiKey() {
24
+ const config = getCliConfig();
25
+ const keys = [
26
+ config.openrouterApiKey,
27
+ config.apiKey,
28
+ process.env.OPENROUTER_API_KEY,
29
+ ].filter((k) => typeof k === "string" && k.length > 0);
30
+ // Prioritize keys that look like OpenRouter keys
31
+ const orKey = keys.find((k) => k.startsWith("sk-or-"));
32
+ if (orKey)
33
+ return orKey;
34
+ // Fallback to any key found
35
+ return keys[0];
36
+ }
37
+ export function getAiProvider() {
38
+ return "openrouter";
39
+ }
40
+ export function getFailoverPriority() {
41
+ return ["openrouter"];
42
+ }
43
+ export function getModel() {
44
+ const config = getCliConfig();
45
+ return config.model || "anthropic/claude-3.5-sonnet";
46
+ }
47
+ export function getLlmFast() {
48
+ const config = getCliConfig();
49
+ return config.modelFast || getModel();
50
+ }
51
+ export function getLlmPremium() {
52
+ const config = getCliConfig();
53
+ return config.modelPremium || getModel();
54
+ }
55
+ export function getAutonomyMode() {
56
+ const config = getCliConfig();
57
+ const configured = config.autonomyMode;
58
+ if (configured)
59
+ return configured;
60
+ return "high";
61
+ }
62
+ export function getMaxContextTokens() {
63
+ return 100000;
64
+ }
65
+ export function getExcludedFiles() {
66
+ if (_excludedFilesCache) {
67
+ return _excludedFilesCache;
68
+ }
69
+ // CLI default exclusions
70
+ const defaultExclusions = [
71
+ "node_modules",
72
+ "dist",
73
+ "build",
74
+ "out",
75
+ "coverage",
76
+ ".git",
77
+ ".vscode",
78
+ ".idea",
79
+ ".DS_Store",
80
+ ];
81
+ _excludedFilesCache = defaultExclusions;
82
+ return _excludedFilesCache;
83
+ }
84
+ export function getKeepRecentMessages() {
85
+ return 30;
86
+ }
87
+ export function getTokensPerChar() {
88
+ return 0.35;
89
+ }
90
+ export function isAscensionEnabled() {
91
+ return true;
92
+ }
93
+ export function getAscensionProfile() {
94
+ return "balanced";
95
+ }
96
+ export function getAscensionIntensity() {
97
+ return 1.2;
98
+ }
99
+ export function getAscensionMaxRequiredActions() {
100
+ return 2;
101
+ }
102
+ export function isAgentStreamsEnabled() {
103
+ const config = getCliConfig();
104
+ const fromConfig = config.agentStreamsEnabled;
105
+ if (typeof fromConfig === "boolean")
106
+ return fromConfig;
107
+ return process.env.MARIE_AGENT_STREAMS_ENABLED === "1";
108
+ }
109
+ export function getAgentStreamMaxConcurrent() {
110
+ let value = 2;
111
+ const config = getCliConfig();
112
+ if (typeof config.agentStreamMaxConcurrent === "number") {
113
+ value = config.agentStreamMaxConcurrent;
473
114
  }
474
- // PHASE 17: Capability & Lifecycle Config
475
- static getCapabilities() {
476
- const vscode = getVscode();
477
- if (vscode) {
478
- return vscode.workspace
479
- .getConfiguration("marie")
480
- .get("capabilities", ["READ", "WRITE", "SHELL", "NETWORK"]);
481
- }
482
- return ["READ", "WRITE", "SHELL", "NETWORK"];
115
+ return Math.max(1, Math.min(8, value));
116
+ }
117
+ export function getAgentStreamSpawnThreshold() {
118
+ let value = 1.25;
119
+ const config = getCliConfig();
120
+ if (typeof config.agentStreamSpawnThreshold === "number") {
121
+ value = config.agentStreamSpawnThreshold;
483
122
  }
484
- static getMaxRecursiveDepth() {
485
- const vscode = getVscode();
486
- if (vscode) {
487
- return vscode.workspace
488
- .getConfiguration("marie")
489
- .get("maxRecursiveDepth", 5);
490
- }
491
- return 5;
123
+ return Math.max(0.25, Math.min(5, value));
124
+ }
125
+ export function getAgentStreamTimeoutMs() {
126
+ let value = 20000;
127
+ const config = getCliConfig();
128
+ if (typeof config.agentStreamTimeoutMs === "number") {
129
+ value = config.agentStreamTimeoutMs;
492
130
  }
493
- static isSkillMutationEnabled() {
494
- const vscode = getVscode();
495
- if (vscode) {
496
- return vscode.workspace
497
- .getConfiguration("marie")
498
- .get("enableSkillMutation", true);
499
- }
500
- return true;
131
+ return Math.max(3000, Math.min(120000, value));
132
+ }
133
+ export function getAgentStreamPilotAgents() {
134
+ const normalize = (value) => {
135
+ if (Array.isArray(value)) {
136
+ return value
137
+ .filter((v) => typeof v === "string")
138
+ .map((v) => v.trim())
139
+ .filter(Boolean);
140
+ }
141
+ if (typeof value === "string") {
142
+ return value
143
+ .split(",")
144
+ .map((v) => v.trim())
145
+ .filter(Boolean);
146
+ }
147
+ return [];
148
+ };
149
+ const config = getCliConfig();
150
+ const fromConfig = normalize(config.agentStreamPilotAgents);
151
+ if (fromConfig.length > 0)
152
+ return fromConfig;
153
+ const fromEnv = normalize(process.env.MARIE_AGENT_STREAM_PILOT_AGENTS);
154
+ if (fromEnv.length > 0)
155
+ return fromEnv;
156
+ return ["QASRE"];
157
+ }
158
+ export function getAgentStreamMaxSpawnsPerTurn() {
159
+ let value = 3;
160
+ const config = getCliConfig();
161
+ if (typeof config.agentStreamMaxSpawnsPerTurn === "number") {
162
+ value = config.agentStreamMaxSpawnsPerTurn;
501
163
  }
502
- // PHASE 23: Security & C-MFA Config
503
- static getAdversarialSensitivity() {
504
- const vscode = getVscode();
505
- if (vscode) {
506
- return vscode.workspace
507
- .getConfiguration("marie")
508
- .get("adversarialSensitivity", 0.5);
509
- }
510
- return 0.5;
164
+ return Math.max(1, Math.min(16, value));
165
+ }
166
+ export function isAgentStreamPressureSheddingEnabled() {
167
+ const config = getCliConfig();
168
+ if (typeof config.agentStreamPressureSheddingEnabled === "boolean") {
169
+ return config.agentStreamPressureSheddingEnabled;
511
170
  }
512
- static isMfaRequired() {
513
- const vscode = getVscode();
514
- if (vscode) {
515
- return vscode.workspace
516
- .getConfiguration("marie")
517
- .get("enableCognitiveMFA", true);
518
- }
519
- return true;
171
+ if (process.env.MARIE_AGENT_STREAM_PRESSURE_SHEDDING_ENABLED === "0") {
172
+ return false;
520
173
  }
174
+ return true;
175
+ }
176
+ export function getAutoRepair() {
177
+ const config = getCliConfig();
178
+ return config.autoRepair || false;
179
+ }
180
+ // PHASE 14: Cognitive & Hygiene Config
181
+ export function getMaxReflections() {
182
+ return 3;
183
+ }
184
+ export function getSanitizationMaxDepth() {
185
+ return 10;
186
+ }
187
+ export function getSanitizationStringLimit() {
188
+ return 5000;
189
+ }
190
+ export function getSanitizationBreadthLimit() {
191
+ return 100;
192
+ }
193
+ export function getSanitizationMaxEnumKeys() {
194
+ return 1000;
195
+ }
196
+ export function getMaxReasoningEventsPerTurn() {
197
+ return 10;
198
+ }
199
+ export function getMaxReasoningCharsPerTurn() {
200
+ return 5000;
201
+ }
202
+ export function getSanitizationGlobalMaxSize() {
203
+ return 512 * 1024; // 512KB
204
+ }
205
+ export function getWatchdogTimeoutMs() {
206
+ return 300000; // 300s
207
+ }
208
+ export function getHeartbeatTimeoutMs() {
209
+ return 120000; // 120s
210
+ }
211
+ // PHASE 16: Concurrency & Sync Config
212
+ export function getLockTimeoutMs() {
213
+ return 30000; // 30s
214
+ }
215
+ export function getSemaphoreTimeoutMs() {
216
+ return 60000; // 60s
217
+ }
218
+ // PHASE 17: Capability & Lifecycle Config
219
+ export function getCapabilities() {
220
+ return ["READ", "WRITE", "SHELL", "NETWORK"];
221
+ }
222
+ export function getMaxRecursiveDepth() {
223
+ return 5;
224
+ }
225
+ export function isSkillMutationEnabled() {
226
+ return true;
227
+ }
228
+ // PHASE 23: Security & C-MFA Config
229
+ export function getAdversarialSensitivity() {
230
+ return 0.5;
231
+ }
232
+ export function isMfaRequired() {
233
+ return true;
521
234
  }
522
235
  //# sourceMappingURL=ConfigService.js.map