@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.
- package/README.md +7 -15
- package/SENTINEL.md +4 -7
- package/dist/cli-new/components/AgenticSpinner.js +28 -0
- package/dist/cli-new/components/AgenticSpinner.js.map +1 -0
- package/dist/cli-new/components/App.js +16 -63
- package/dist/cli-new/components/App.js.map +1 -1
- package/dist/cli-new/components/ApprovalDialog.js +3 -2
- package/dist/cli-new/components/ApprovalDialog.js.map +1 -1
- package/dist/cli-new/components/Banner.js +16 -5
- package/dist/cli-new/components/Banner.js.map +1 -1
- package/dist/cli-new/components/ChatArea.js +6 -7
- package/dist/cli-new/components/ChatArea.js.map +1 -1
- package/dist/cli-new/components/Header.js +14 -8
- package/dist/cli-new/components/Header.js.map +1 -1
- package/dist/cli-new/components/InputArea.js +98 -31
- package/dist/cli-new/components/InputArea.js.map +1 -1
- package/dist/cli-new/components/MessageBubble.js +28 -19
- package/dist/cli-new/components/MessageBubble.js.map +1 -1
- package/dist/cli-new/components/SessionSwitcher.js +6 -9
- package/dist/cli-new/components/SessionSwitcher.js.map +1 -1
- package/dist/cli-new/components/SetupWizard.js +80 -257
- package/dist/cli-new/components/SetupWizard.js.map +1 -1
- package/dist/cli-new/components/ToolCallDisplay.js +20 -5
- package/dist/cli-new/components/ToolCallDisplay.js.map +1 -1
- package/dist/cli-new/components/WizardSteps.js +22 -0
- package/dist/cli-new/components/WizardSteps.js.map +1 -0
- package/dist/cli-new/constants/SetupConstants.js +42 -0
- package/dist/cli-new/constants/SetupConstants.js.map +1 -0
- package/dist/cli-new/hooks/useGit.js +19 -62
- package/dist/cli-new/hooks/useGit.js.map +1 -1
- package/dist/cli-new/hooks/useMarie.js +26 -18
- package/dist/cli-new/hooks/useMarie.js.map +1 -1
- package/dist/cli-new/hooks/useSessions.js +1 -1
- package/dist/cli-new/hooks/useSessions.js.map +1 -1
- package/dist/cli-new/hooks/useSetupWizard.js +88 -0
- package/dist/cli-new/hooks/useSetupWizard.js.map +1 -0
- package/dist/cli-new/hooks/useUpdateCheck.js +4 -3
- package/dist/cli-new/hooks/useUpdateCheck.js.map +1 -1
- package/dist/cli-new/index.js +2 -4
- package/dist/cli-new/index.js.map +1 -1
- package/dist/cli-new/services/CommandService.js +104 -0
- package/dist/cli-new/services/CommandService.js.map +1 -0
- package/dist/cli-new/services/GitService.js +91 -0
- package/dist/cli-new/services/GitService.js.map +1 -0
- package/dist/cli-new/services/MarieService.js +77 -0
- package/dist/cli-new/services/MarieService.js.map +1 -0
- package/dist/cli-new/services/auth-server.js +128 -0
- package/dist/cli-new/services/auth-server.js.map +1 -0
- package/dist/cli-new/styles/theme.js +17 -17
- package/dist/cli-new/styles/theme.js.map +1 -1
- package/dist/cli-new/utils/version.js +24 -0
- package/dist/cli-new/utils/version.js.map +1 -0
- package/dist/monolith/adapters/CliMarieAdapter.js +19 -18
- package/dist/monolith/adapters/CliMarieAdapter.js.map +1 -1
- package/dist/monolith/cli/CliFileSystemPort.js +17 -3
- package/dist/monolith/cli/CliFileSystemPort.js.map +1 -1
- package/dist/monolith/cli/MarieToolDefinitionsCLI.js +44 -33
- package/dist/monolith/cli/MarieToolDefinitionsCLI.js.map +1 -1
- package/dist/monolith/cli/index.js +11 -20
- package/dist/monolith/cli/index.js.map +1 -1
- package/dist/monolith/cli/services/JoyAutomationServiceCLI.js +15 -62
- package/dist/monolith/cli/services/JoyAutomationServiceCLI.js.map +1 -1
- package/dist/monolith/cli/storage.js +154 -65
- package/dist/monolith/cli/storage.js.map +1 -1
- package/dist/monolith/domain/joy/RitualService.js +44 -46
- package/dist/monolith/domain/joy/RitualService.js.map +1 -1
- package/dist/monolith/domain/marie/MarieCortex.js +148 -0
- package/dist/monolith/domain/marie/MarieCortex.js.map +1 -0
- package/dist/monolith/domain/marie/PersonalityRenderer.js +97 -0
- package/dist/monolith/domain/marie/PersonalityRenderer.js.map +1 -0
- package/dist/monolith/infrastructure/Configuration.js +68 -0
- package/dist/monolith/infrastructure/Configuration.js.map +1 -0
- package/dist/monolith/infrastructure/CoreInfrastructure.js +204 -0
- package/dist/monolith/infrastructure/CoreInfrastructure.js.map +1 -0
- package/dist/monolith/infrastructure/ai/agents/MarieAscendant.js +3 -3
- package/dist/monolith/infrastructure/ai/agents/MarieAscendant.js.map +1 -1
- package/dist/monolith/infrastructure/ai/context/ContextArchiveService.js +51 -57
- package/dist/monolith/infrastructure/ai/context/ContextArchiveService.js.map +1 -1
- package/dist/monolith/infrastructure/ai/context/ContextManager.js +142 -98
- package/dist/monolith/infrastructure/ai/context/ContextManager.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MarieEngine.js +104 -556
- package/dist/monolith/infrastructure/ai/core/MarieEngine.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MarieEventDispatcher.js +1 -37
- package/dist/monolith/infrastructure/ai/core/MarieEventDispatcher.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MarieLockManager.js +30 -5
- package/dist/monolith/infrastructure/ai/core/MarieLockManager.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MarieProgressTracker.js +176 -196
- package/dist/monolith/infrastructure/ai/core/MarieProgressTracker.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MariePulseService.js +41 -7
- package/dist/monolith/infrastructure/ai/core/MariePulseService.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MarieSanitizer.js +303 -63
- package/dist/monolith/infrastructure/ai/core/MarieSanitizer.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MarieSemaphore.js +47 -4
- package/dist/monolith/infrastructure/ai/core/MarieSemaphore.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MarieSession.js +95 -15
- package/dist/monolith/infrastructure/ai/core/MarieSession.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MarieStabilityMonitor.js +21 -0
- package/dist/monolith/infrastructure/ai/core/MarieStabilityMonitor.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MarieToolMender.js +12 -0
- package/dist/monolith/infrastructure/ai/core/MarieToolMender.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MarieToolProcessor.js +339 -481
- package/dist/monolith/infrastructure/ai/core/MarieToolProcessor.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MarieVitality.js +238 -0
- package/dist/monolith/infrastructure/ai/core/MarieVitality.js.map +1 -0
- package/dist/monolith/infrastructure/ai/core/ReasoningBudget.js +23 -12
- package/dist/monolith/infrastructure/ai/core/ReasoningBudget.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/SessionLogService.js +9 -2
- package/dist/monolith/infrastructure/ai/core/SessionLogService.js.map +1 -1
- package/dist/monolith/infrastructure/ai/providers/AIProvider.js +402 -1
- package/dist/monolith/infrastructure/ai/providers/AIProvider.js.map +1 -1
- package/dist/monolith/infrastructure/ai/providers/DreamBeesProvider.js +114 -0
- package/dist/monolith/infrastructure/ai/providers/DreamBeesProvider.js.map +1 -0
- package/dist/monolith/infrastructure/ai/providers/OpenRouterProvider.js +426 -370
- package/dist/monolith/infrastructure/ai/providers/OpenRouterProvider.js.map +1 -1
- package/dist/monolith/infrastructure/ai/providers/OpenRouterStreamParser.js +235 -241
- package/dist/monolith/infrastructure/ai/providers/OpenRouterStreamParser.js.map +1 -1
- package/dist/monolith/infrastructure/ai/workerAi.js +185 -0
- package/dist/monolith/infrastructure/ai/workerAi.js.map +1 -0
- package/dist/monolith/infrastructure/config/ConfigService.js +216 -359
- package/dist/monolith/infrastructure/config/ConfigService.js.map +1 -1
- package/dist/monolith/infrastructure/joy/CognitiveRituals.js +8 -0
- package/dist/monolith/infrastructure/joy/CognitiveRituals.js.map +1 -0
- package/dist/monolith/infrastructure/joy/JoyTools.js +23 -43
- package/dist/monolith/infrastructure/joy/JoyTools.js.map +1 -1
- package/dist/monolith/infrastructure/persistence/MarieMindAutonomics.js +4 -0
- package/dist/monolith/infrastructure/persistence/MarieMindAutonomics.js.map +1 -0
- package/dist/monolith/infrastructure/persistence/MarieMindEngine.js +11 -0
- package/dist/monolith/infrastructure/persistence/MarieMindEngine.js.map +1 -0
- package/dist/monolith/infrastructure/persistence/NoormmeAutonomics.js +135 -0
- package/dist/monolith/infrastructure/persistence/NoormmeAutonomics.js.map +1 -0
- package/dist/monolith/infrastructure/persistence/NoormmeEngine.js +523 -0
- package/dist/monolith/infrastructure/persistence/NoormmeEngine.js.map +1 -0
- package/dist/monolith/infrastructure/persistence/NoormmeSchema.js +179 -0
- package/dist/monolith/infrastructure/persistence/NoormmeSchema.js.map +1 -0
- package/dist/monolith/infrastructure/persistence/NoormmeSeeder.js +94 -0
- package/dist/monolith/infrastructure/persistence/NoormmeSeeder.js.map +1 -0
- package/dist/monolith/infrastructure/persistence/NoormmeTools.js +371 -0
- package/dist/monolith/infrastructure/persistence/NoormmeTools.js.map +1 -0
- package/dist/monolith/infrastructure/services/MarieMemoryStore.js +133 -134
- package/dist/monolith/infrastructure/services/MarieMemoryStore.js.map +1 -1
- package/dist/monolith/infrastructure/tools/MarieToolDefinitions.js +6 -1578
- package/dist/monolith/infrastructure/tools/MarieToolDefinitions.js.map +1 -1
- package/dist/monolith/infrastructure/tools/PureStreamParser.js +68 -80
- package/dist/monolith/infrastructure/tools/PureStreamParser.js.map +1 -1
- package/dist/monolith/infrastructure/tools/SharedToolDefinitions.js +12 -11
- package/dist/monolith/infrastructure/tools/SharedToolDefinitions.js.map +1 -1
- package/dist/monolith/infrastructure/tools/SovereignTools.js +326 -0
- package/dist/monolith/infrastructure/tools/SovereignTools.js.map +1 -0
- package/dist/monolith/infrastructure/tools/ToolRegistry.js +45 -26
- package/dist/monolith/infrastructure/tools/ToolRegistry.js.map +1 -1
- package/dist/monolith/infrastructure/tools/definitions/AnalysisTools.js +232 -0
- package/dist/monolith/infrastructure/tools/definitions/AnalysisTools.js.map +1 -0
- package/dist/monolith/infrastructure/tools/definitions/AutomationTools.js +274 -0
- package/dist/monolith/infrastructure/tools/definitions/AutomationTools.js.map +1 -0
- package/dist/monolith/infrastructure/tools/definitions/ContextTools.js +71 -0
- package/dist/monolith/infrastructure/tools/definitions/ContextTools.js.map +1 -0
- package/dist/monolith/infrastructure/tools/definitions/CoreTools.js +37 -0
- package/dist/monolith/infrastructure/tools/definitions/CoreTools.js.map +1 -0
- package/dist/monolith/infrastructure/tools/definitions/DiagnosticTools.js +154 -0
- package/dist/monolith/infrastructure/tools/definitions/DiagnosticTools.js.map +1 -0
- package/dist/monolith/infrastructure/tools/definitions/NavigationTools.js +197 -0
- package/dist/monolith/infrastructure/tools/definitions/NavigationTools.js.map +1 -0
- package/dist/monolith/infrastructure/tools/definitions/PlanningTools.js +300 -0
- package/dist/monolith/infrastructure/tools/definitions/PlanningTools.js.map +1 -0
- package/dist/monolith/plumbing/Plumbing.js +238 -0
- package/dist/monolith/plumbing/Plumbing.js.map +1 -0
- package/dist/monolith/plumbing/PlumbingAnalysis.js +109 -0
- package/dist/monolith/plumbing/PlumbingAnalysis.js.map +1 -0
- package/dist/monolith/plumbing/PlumbingSystem.js +169 -0
- package/dist/monolith/plumbing/PlumbingSystem.js.map +1 -0
- package/dist/monolith/plumbing/analysis/ComplexityService.js +30 -34
- package/dist/monolith/plumbing/analysis/ComplexityService.js.map +1 -1
- package/dist/monolith/plumbing/analysis/DependencyService.js +55 -44
- package/dist/monolith/plumbing/analysis/DependencyService.js.map +1 -1
- package/dist/monolith/plumbing/analysis/DiscoveryService.js +40 -42
- package/dist/monolith/plumbing/analysis/DiscoveryService.js.map +1 -1
- package/dist/monolith/plumbing/analysis/JoyMapService.js +52 -56
- package/dist/monolith/plumbing/analysis/JoyMapService.js.map +1 -1
- package/dist/monolith/plumbing/analysis/LintService.js +118 -118
- package/dist/monolith/plumbing/analysis/LintService.js.map +1 -1
- package/dist/monolith/plumbing/analysis/MarieSentinelService.js +278 -269
- package/dist/monolith/plumbing/analysis/MarieSentinelService.js.map +1 -1
- package/dist/monolith/plumbing/analysis/QualityGuardrailService.js +116 -114
- package/dist/monolith/plumbing/analysis/QualityGuardrailService.js.map +1 -1
- package/dist/monolith/plumbing/analysis/SurgicalMender.js +57 -59
- package/dist/monolith/plumbing/analysis/SurgicalMender.js.map +1 -1
- package/dist/monolith/plumbing/analysis/TestService.js +89 -89
- package/dist/monolith/plumbing/analysis/TestService.js.map +1 -1
- package/dist/monolith/plumbing/filesystem/FileService.js +123 -195
- package/dist/monolith/plumbing/filesystem/FileService.js.map +1 -1
- package/dist/monolith/plumbing/filesystem/PathResolver.js +7 -8
- package/dist/monolith/plumbing/filesystem/PathResolver.js.map +1 -1
- package/dist/monolith/plumbing/git/GitService.js +4 -4
- package/dist/monolith/plumbing/git/GitService.js.map +1 -1
- package/dist/monolith/plumbing/lsp/SymbolService.js +5 -34
- package/dist/monolith/plumbing/lsp/SymbolService.js.map +1 -1
- package/dist/monolith/plumbing/terminal/ProcessRegistry.js +20 -22
- package/dist/monolith/plumbing/terminal/ProcessRegistry.js.map +1 -1
- package/dist/monolith/plumbing/terminal/TerminalService.js +127 -136
- package/dist/monolith/plumbing/terminal/TerminalService.js.map +1 -1
- package/dist/monolith/plumbing/utils/EnvironmentUtils.js +3 -23
- package/dist/monolith/plumbing/utils/EnvironmentUtils.js.map +1 -1
- package/dist/monolith/plumbing/utils/JsonUtils.js +252 -311
- package/dist/monolith/plumbing/utils/JsonUtils.js.map +1 -1
- package/dist/monolith/plumbing/utils/MutexUtils.js.map +1 -1
- package/dist/monolith/plumbing/utils/PlumbingCore.js +549 -0
- package/dist/monolith/plumbing/utils/PlumbingCore.js.map +1 -0
- package/dist/monolith/plumbing/utils/PrefixTree.js +61 -114
- package/dist/monolith/plumbing/utils/PrefixTree.js.map +1 -1
- package/dist/monolith/plumbing/utils/StreamTagDetector.js +89 -127
- package/dist/monolith/plumbing/utils/StreamTagDetector.js.map +1 -1
- package/dist/monolith/plumbing/utils/StringUtils.js +87 -89
- package/dist/monolith/plumbing/utils/StringUtils.js.map +1 -1
- package/dist/monolith/runtime/MarieRuntime.js +76 -417
- package/dist/monolith/runtime/MarieRuntime.js.map +1 -1
- package/dist/monolith/runtime/RuntimeAdapterBase.js +1 -1
- package/dist/monolith/runtime/RuntimeAdapterBase.js.map +1 -1
- package/dist/monolith/runtime/providerFactory.js +1 -7
- package/dist/monolith/runtime/providerFactory.js.map +1 -1
- package/dist/monolith/services/HealthService.js +29 -32
- package/dist/monolith/services/HealthService.js.map +1 -1
- package/dist/monolith/services/JoyAutomationService.js +58 -95
- package/dist/monolith/services/JoyAutomationService.js.map +1 -1
- package/dist/monolith/services/MarieAutomationService.js +59 -0
- package/dist/monolith/services/MarieAutomationService.js.map +1 -0
- package/dist/monolith/services/MarieGhostService.js +46 -161
- package/dist/monolith/services/MarieGhostService.js.map +1 -1
- package/dist/monolith/services/MarieServices.js +102 -0
- package/dist/monolith/services/MarieServices.js.map +1 -0
- package/dist/monolith/services/MarieTypes.js +2 -0
- package/dist/monolith/services/MarieTypes.js.map +1 -0
- package/dist/monolith/services/UpdateService.js +47 -49
- package/dist/monolith/services/UpdateService.js.map +1 -1
- package/dist/prompts.js +11 -5
- package/dist/prompts.js.map +1 -1
- package/dist/test_prefix_tree.js +9 -9
- package/dist/test_prefix_tree.js.map +1 -1
- package/package.json +18 -88
- package/run_test.js +5 -0
- package/.marie_visual_verify_1771225696548/progress_bar_check.txt +0 -1
- package/dist/extension.cjs +0 -635
- package/dist/extension.js +0 -473
- package/dist/extension.js.map +0 -1
- package/dist/monolith/adapters/VscodeMarieAdapter.js +0 -81
- package/dist/monolith/adapters/VscodeMarieAdapter.js.map +0 -1
- package/dist/monolith/domain/joy/JoyTools.js +0 -535
- package/dist/monolith/domain/joy/JoyTools.js.map +0 -1
- package/dist/monolith/infrastructure/ai/agents/MarieYOLO.js +0 -207
- package/dist/monolith/infrastructure/ai/agents/MarieYOLO.js.map +0 -1
- package/dist/monolith/infrastructure/ai/core/GhostPort.js +0 -2
- package/dist/monolith/infrastructure/ai/core/GhostPort.js.map +0 -1
- package/dist/monolith/infrastructure/ai/core/MarieYOLOTypes.js +0 -2
- package/dist/monolith/infrastructure/ai/core/MarieYOLOTypes.js.map +0 -1
- package/dist/monolith/infrastructure/ai/core/VscodeFileSystemPort.js +0 -33
- package/dist/monolith/infrastructure/ai/core/VscodeFileSystemPort.js.map +0 -1
- package/dist/monolith/infrastructure/ai/providers/AnthropicProvider.js +0 -148
- package/dist/monolith/infrastructure/ai/providers/AnthropicProvider.js.map +0 -1
- package/dist/monolith/infrastructure/ai/providers/CerebrasProvider.js +0 -208
- package/dist/monolith/infrastructure/ai/providers/CerebrasProvider.js.map +0 -1
- package/dist/monolith/plumbing/ui/DecorationService.js +0 -54
- package/dist/monolith/plumbing/ui/DecorationService.js.map +0 -1
- package/dist/monolith/services/JoyLogService.js +0 -48
- package/dist/monolith/services/JoyLogService.js.map +0 -1
- package/dist/monolith/services/JoyService.js +0 -209
- package/dist/monolith/services/JoyService.js.map +0 -1
- package/dist/monolith/services/MarieSCMProvider.js +0 -41
- package/dist/monolith/services/MarieSCMProvider.js.map +0 -1
- package/dist/test_agent_stream_control_plane.js +0 -170
- package/dist/test_agent_stream_control_plane.js.map +0 -1
- package/dist/test_strategy_integration.js +0 -114
- package/dist/test_strategy_integration.js.map +0 -1
- package/dist/test_streaming_fragility.js +0 -191
- package/dist/test_streaming_fragility.js.map +0 -1
- package/dist/webview-ui/App.js +0 -16
- package/dist/webview-ui/App.js.map +0 -1
- package/dist/webview-ui/Providers.js +0 -6
- package/dist/webview-ui/Providers.js.map +0 -1
- package/dist/webview-ui/components/ApprovalPanel.js +0 -8
- package/dist/webview-ui/components/ApprovalPanel.js.map +0 -1
- package/dist/webview-ui/components/ChatPanel.js +0 -19
- package/dist/webview-ui/components/ChatPanel.js.map +0 -1
- package/dist/webview-ui/components/Composer.js +0 -19
- package/dist/webview-ui/components/Composer.js.map +0 -1
- package/dist/webview-ui/components/HeaderBar.js +0 -5
- package/dist/webview-ui/components/HeaderBar.js.map +0 -1
- package/dist/webview-ui/components/SessionList.js +0 -14
- package/dist/webview-ui/components/SessionList.js.map +0 -1
- package/dist/webview-ui/context/WebviewStateContext.js +0 -146
- package/dist/webview-ui/context/WebviewStateContext.js.map +0 -1
- package/dist/webview-ui/main.css +0 -1
- package/dist/webview-ui/main.js +0 -108
- package/dist/webview-ui/main.js.map +0 -1
- package/dist/webview-ui/types.js +0 -2
- package/dist/webview-ui/types.js.map +0 -1
- package/dist/webview-ui/vscode.js +0 -4
- package/dist/webview-ui/vscode.js.map +0 -1
- package/lint_output.txt +0 -705
- package/lint_output_v2.txt +0 -711
- package/marie-coder-0.1.16.vsix +0 -0
|
@@ -1,38 +1,35 @@
|
|
|
1
|
-
import * as vscode from "vscode";
|
|
2
1
|
import { exec } from "child_process";
|
|
3
2
|
import { promisify } from "util";
|
|
4
3
|
const execAsync = promisify(exec);
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
console.log("[MarieHealth] All planetary dependencies verified. 🌍");
|
|
35
|
-
}
|
|
4
|
+
export async function checkDependencies() {
|
|
5
|
+
const diagnostics = [];
|
|
6
|
+
// 1. Check ripgrep (rg)
|
|
7
|
+
try {
|
|
8
|
+
// Stability check: Set shell timeout to prevent hanging activation
|
|
9
|
+
await execAsync("rg --version", { timeout: 5000 });
|
|
10
|
+
}
|
|
11
|
+
catch (e) {
|
|
12
|
+
diagnostics.push("ripgrep (rg) is missing. Global search will be slow or disabled.");
|
|
13
|
+
}
|
|
14
|
+
// 2. Check fd
|
|
15
|
+
try {
|
|
16
|
+
await execAsync("fd --version", { timeout: 5000 });
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
diagnostics.push("fd is missing. File discovery will be slow.");
|
|
20
|
+
}
|
|
21
|
+
// 3. Check npm
|
|
22
|
+
try {
|
|
23
|
+
await execAsync("npm --version", { timeout: 5000 });
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
diagnostics.push("npm is missing. Building projects might fail.");
|
|
27
|
+
}
|
|
28
|
+
if (diagnostics.length > 0) {
|
|
29
|
+
console.warn(`Marie Stability Warning: ${diagnostics.join(" ")}`);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
console.log("[MarieHealth] All planetary dependencies verified. 🌍");
|
|
36
33
|
}
|
|
37
34
|
}
|
|
38
35
|
//# sourceMappingURL=HealthService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HealthService.js","sourceRoot":"","sources":["../../../src/monolith/services/HealthService.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"HealthService.js","sourceRoot":"","sources":["../../../src/monolith/services/HealthService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,wBAAwB;IACxB,IAAI,CAAC;QACH,mEAAmE;QACnE,MAAM,SAAS,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACrD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,WAAW,CAAC,IAAI,CACd,kEAAkE,CACnE,CAAC;IACJ,CAAC;IAED,cAAc;IACd,IAAI,CAAC;QACH,MAAM,SAAS,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACrD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,WAAW,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;IAClE,CAAC;IAED,eAAe;IACf,IAAI,CAAC;QACH,MAAM,SAAS,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,WAAW,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;IACpE,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,4BAA4B,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACpE,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;IACvE,CAAC;AACH,CAAC"}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ensureJoyZoningFolders, executeGenesisRitual, scaffoldZoneAbstractions, sowFeature, synthesizeZoneManuals, isProjectJoyful, proposeReorganization, proposeClustering, generateJoyDashboard, generateTidyChecklist, executeRestoration, } from "../infrastructure/joy/JoyTools.js";
|
|
2
|
+
/**
|
|
3
|
+
* JoyAutomationService - Real implementation for automation rituals.
|
|
4
|
+
* Ported from CLI variant to be the unified automation service.
|
|
5
|
+
*/
|
|
4
6
|
export class JoyAutomationService {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
workingDir;
|
|
8
|
+
fs;
|
|
9
|
+
achievementCallback;
|
|
7
10
|
currentRun;
|
|
8
|
-
constructor(
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
11
|
+
constructor(workingDir, fs, achievementCallback) {
|
|
12
|
+
this.workingDir = workingDir;
|
|
13
|
+
this.fs = fs;
|
|
14
|
+
this.achievementCallback = achievementCallback;
|
|
15
|
+
}
|
|
16
|
+
async ensureWorkingDir() {
|
|
17
|
+
const fs = await import("fs/promises");
|
|
18
|
+
await fs.mkdir(this.workingDir, { recursive: true });
|
|
11
19
|
}
|
|
12
20
|
setCurrentRun(run) {
|
|
13
21
|
this.currentRun = run;
|
|
@@ -15,117 +23,72 @@ export class JoyAutomationService {
|
|
|
15
23
|
getCurrentRun() {
|
|
16
24
|
return this.currentRun;
|
|
17
25
|
}
|
|
26
|
+
async addAchievement(msg, points) {
|
|
27
|
+
if (this.achievementCallback) {
|
|
28
|
+
await this.achievementCallback(msg, points);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
console.log(`[Achievement] ${msg} (+${points} XP)`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
18
34
|
async triggerGenesis() {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const result = await executeGenesisRitual(root);
|
|
23
|
-
await this.joyService.addAchievement(`Performed the Genesis Ritual. Project reborn in JOY. ✨`, 100);
|
|
35
|
+
await this.ensureWorkingDir();
|
|
36
|
+
const result = await executeGenesisRitual(this.workingDir);
|
|
37
|
+
await this.addAchievement("Performed Genesis Ritual. Project reborn in JOY. ✨", 50);
|
|
24
38
|
return result;
|
|
25
39
|
}
|
|
26
40
|
async sowJoyFeature(name, intent) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const result = await sowFeature(root, name, intent);
|
|
31
|
-
await this.joyService.addAchievement(`Sowed the seeds of '${name}' across the garden. 🌱`, 25);
|
|
41
|
+
await this.ensureWorkingDir();
|
|
42
|
+
const result = await sowFeature(this.workingDir, name, intent);
|
|
43
|
+
await this.addAchievement(`Sowed feature '${name}' into the garden. 🌱`, 10);
|
|
32
44
|
return result;
|
|
33
45
|
}
|
|
34
|
-
heartbeatTimer;
|
|
35
46
|
async performGardenPulse() {
|
|
36
|
-
|
|
37
|
-
if (!root)
|
|
38
|
-
return "No workspace folder detected.";
|
|
47
|
+
await this.ensureWorkingDir();
|
|
39
48
|
let finalReport = "";
|
|
40
49
|
try {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
finalReport += `- ✅ No cross-zone contamination detected. Domain remains pure.\n`;
|
|
49
|
-
}
|
|
50
|
-
const joyful = await isProjectJoyful(root);
|
|
51
|
-
await ensureJoyZoningFolders(root);
|
|
52
|
-
const scaffolded = await scaffoldZoneAbstractions(root);
|
|
53
|
-
const proposals = await proposeReorganization(root);
|
|
54
|
-
const clustering = await proposeClustering(root);
|
|
50
|
+
const joyful = await isProjectJoyful(this.workingDir);
|
|
51
|
+
await ensureJoyZoningFolders(this.workingDir);
|
|
52
|
+
const scaffolded = await scaffoldZoneAbstractions(this.workingDir);
|
|
53
|
+
finalReport += scaffolded;
|
|
54
|
+
const proposals = await proposeReorganization(this.workingDir);
|
|
55
|
+
const clustering = await proposeClustering(this.workingDir);
|
|
56
|
+
const manuals = await synthesizeZoneManuals(this.workingDir);
|
|
55
57
|
if (!joyful) {
|
|
56
|
-
finalReport += `\n- ⚠️ **Architectural Void**:
|
|
58
|
+
finalReport += `\n- ⚠️ **Architectural Void**: This project has not yet embraced the JOY structure. Use the Genesis Ritual to begin your journey.`;
|
|
57
59
|
}
|
|
58
|
-
if (proposals.length > 0)
|
|
60
|
+
if (proposals.length > 0)
|
|
59
61
|
finalReport += `\n- ${proposals.length} structural drifts detected.`;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
await this.joyService.addAchievement("Sentinel Auto-Repair initiated. 🛠️", 10);
|
|
65
|
-
const repairResult = await this.executeAutonomousRestoration();
|
|
66
|
-
finalReport += `\n- 🛠️ **Auto-Repair Executed**: ${repairResult}`;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
await this.scoutAchievements();
|
|
62
|
+
if (clustering.length > 0)
|
|
63
|
+
finalReport += `\n- ${clustering.length} zones ripe for clustering.`;
|
|
64
|
+
await this.addAchievement("Performed garden pulse. 🌸", 5);
|
|
65
|
+
return `${finalReport}\n${manuals}\n\nThe garden continues to evolve in harmony. ✨`;
|
|
71
66
|
}
|
|
72
67
|
catch (e) {
|
|
73
|
-
|
|
68
|
+
return `\n- ❌ **Pulse Interrupted**: A structural error occurred during synthesis: ${e.message}`;
|
|
74
69
|
}
|
|
75
|
-
return `${finalReport}\n\nThe system remains under Sentinel protection. 🛡️`;
|
|
76
70
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
await this.performGardenPulse();
|
|
82
|
-
}, intervalMs);
|
|
71
|
+
async triggerReview() {
|
|
72
|
+
const dashboard = await generateJoyDashboard(this.workingDir);
|
|
73
|
+
const checklist = await generateTidyChecklist(this.workingDir);
|
|
74
|
+
return `# 🌸 Joy Review\n\n${dashboard}\n\n## 📋 Tidy Checklist\n${checklist}`;
|
|
83
75
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
this.heartbeatTimer = undefined;
|
|
88
|
-
}
|
|
76
|
+
async autoScaffold() {
|
|
77
|
+
await this.ensureWorkingDir();
|
|
78
|
+
await scaffoldZoneAbstractions(this.workingDir);
|
|
89
79
|
}
|
|
90
80
|
async executeAutonomousRestoration() {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const result = await executeRestoration(root);
|
|
95
|
-
await this.joyService.addAchievement("The Garden was autonomously restored to harmony. ✨", 50);
|
|
81
|
+
await this.ensureWorkingDir();
|
|
82
|
+
const result = await executeRestoration(this.workingDir);
|
|
83
|
+
await this.addAchievement("The Garden was autonomously restored to harmony. ✨", 50);
|
|
96
84
|
return result;
|
|
97
85
|
}
|
|
98
86
|
async executeSelfHealing(failedPath, errorReason) {
|
|
99
|
-
await this.
|
|
100
|
-
|
|
101
|
-
errorReason.includes("could not find")) {
|
|
102
|
-
return `Self-healing: Analyzing \`${failedPath}\` to resolve: ${errorReason}. \nPlease retry the operation with \`find_files\` or \`grep_search\` to refresh context. ✨`;
|
|
103
|
-
}
|
|
104
|
-
return `Self-healing could not determine a recovery path for: ${errorReason}`;
|
|
105
|
-
}
|
|
106
|
-
async autoScaffold() {
|
|
107
|
-
const root = vscode.workspace.workspaceFolders?.[0].uri.fsPath;
|
|
108
|
-
if (root) {
|
|
109
|
-
await scaffoldZoneAbstractions(root);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
async scoutAchievements() {
|
|
113
|
-
const root = vscode.workspace.workspaceFolders?.[0].uri.fsPath;
|
|
114
|
-
if (!root)
|
|
115
|
-
return;
|
|
116
|
-
try {
|
|
117
|
-
await this.joyService.addAchievement("Sentinel Resonance achieved. 🌌", 5);
|
|
118
|
-
const joyful = await isProjectJoyful(root);
|
|
119
|
-
if (joyful) {
|
|
120
|
-
await this.joyService.addAchievement("Structural Harmony attained. 🏛️", 20);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
catch (e) {
|
|
124
|
-
console.error("[Singularity] Scouting failed", e);
|
|
125
|
-
}
|
|
87
|
+
await this.addAchievement("Self-healing initiated. 🧬", 15);
|
|
88
|
+
return `Self-healing: Analyzing \`${failedPath}\` to resolve: ${errorReason}. \nPlease retry the operation to refresh context. ✨`;
|
|
126
89
|
}
|
|
127
90
|
dispose() {
|
|
128
|
-
this.
|
|
91
|
+
void this.workingDir;
|
|
129
92
|
}
|
|
130
93
|
}
|
|
131
94
|
//# sourceMappingURL=JoyAutomationService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JoyAutomationService.js","sourceRoot":"","sources":["../../../src/monolith/services/JoyAutomationService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"JoyAutomationService.js","sourceRoot":"","sources":["../../../src/monolith/services/JoyAutomationService.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,oBAAoB,E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|
+
import { executeGenesisRitual, sowFeature, isProjectJoyful, generateJoyDashboard } from "../infrastructure/joy/JoyTools.js";
|
|
4
|
+
import { Storage } from "../cli/storage.js";
|
|
5
|
+
export class MarieAutomationService {
|
|
6
|
+
workingDir;
|
|
7
|
+
currentRun;
|
|
8
|
+
provider;
|
|
9
|
+
constructor(workingDir) {
|
|
10
|
+
this.workingDir = workingDir;
|
|
11
|
+
}
|
|
12
|
+
setProvider(provider) {
|
|
13
|
+
this.provider = provider;
|
|
14
|
+
}
|
|
15
|
+
setCurrentRun(run) { this.currentRun = run; }
|
|
16
|
+
getCurrentRun() { return this.currentRun; }
|
|
17
|
+
dispose() { }
|
|
18
|
+
async triggerGenesis() { return this.workingDir ? executeGenesisRitual(this.workingDir) : "No workspace."; }
|
|
19
|
+
async sowJoyFeature(name, intent) { return this.workingDir ? sowFeature(this.workingDir, name, intent) : "No workspace."; }
|
|
20
|
+
async performGardenPulse() {
|
|
21
|
+
if (!this.workingDir)
|
|
22
|
+
return { joyful: false, dashboard: "No workspace." };
|
|
23
|
+
const joyful = await isProjectJoyful(this.workingDir);
|
|
24
|
+
const dashboard = await generateJoyDashboard(this.workingDir);
|
|
25
|
+
return { joyful, dashboard };
|
|
26
|
+
}
|
|
27
|
+
async executeRun(sessionId, messages, callbacks, signal) {
|
|
28
|
+
if (!this.provider) {
|
|
29
|
+
throw new Error("AI Provider not set in MarieAutomationService");
|
|
30
|
+
}
|
|
31
|
+
const runId = `run_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
|
|
32
|
+
const run = { runId, startedAt: Date.now() };
|
|
33
|
+
const engine = new MarieEngine(this.provider);
|
|
34
|
+
try {
|
|
35
|
+
callbacks.onEvent?.({ type: "status", runId, status: "active", phase: "Research" });
|
|
36
|
+
const response = await engine.chatLoop(messages, run, callbacks, async () => {
|
|
37
|
+
await Storage.saveSessions({ [sessionId]: messages });
|
|
38
|
+
}, signal);
|
|
39
|
+
run.success = true;
|
|
40
|
+
run.completedAt = Date.now();
|
|
41
|
+
callbacks.onEvent?.({ type: "telemetry", runId, telemetry: run });
|
|
42
|
+
messages.push({ role: "assistant", content: response });
|
|
43
|
+
await Storage.saveSessions({ [sessionId]: messages });
|
|
44
|
+
return run;
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
run.success = false;
|
|
48
|
+
run.error = getErrorMessage(error);
|
|
49
|
+
run.completedAt = Date.now();
|
|
50
|
+
callbacks.onEvent?.({ type: "error", runId, error: run.error });
|
|
51
|
+
callbacks.onEvent?.({ type: "telemetry", runId, telemetry: run });
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
engine.dispose();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=MarieAutomationService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarieAutomationService.js","sourceRoot":"","sources":["../../../src/monolith/services/MarieAutomationService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC5H,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,MAAM,OAAO,sBAAsB;IAIA;IAHrB,UAAU,CAAkB;IAC5B,QAAQ,CAAyB;IAE3C,YAA+B,UAAmB;QAAnB,eAAU,GAAV,UAAU,CAAS;IAAI,CAAC;IAEhD,WAAW,CAAC,QAAoB;QACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAEM,aAAa,CAAC,GAAoB,IAAU,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC,CAAC;IACpE,aAAa,KAAsB,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,C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AI,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAS,CAAC,CAAC;YACzE,MAAM,KAAK,CAAC;QAChB,CAAC;gBAAS,CAAC;YACP,MAAM,CAAC,OAAO,EAAE,CAAC;QACrB,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1,168 +1,53 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PureStreamParser, } from "../infrastructure/tools/PureStreamParser.js";
|
|
3
|
-
import { MarieSCMProvider } from "./MarieSCMProvider.js";
|
|
4
|
-
import { StringUtils } from "../plumbing/utils/StringUtils.js";
|
|
1
|
+
import { createPureStreamParser } from "../infrastructure/tools/PureStreamParser.js";
|
|
5
2
|
/**
|
|
6
|
-
*
|
|
3
|
+
* MarieGhostService (CLI Edition)
|
|
4
|
+
* Provides state management for tool stream deltas without VS Code UI dependencies.
|
|
5
|
+
* Coordinates with PureStreamParser to track proposed changes during execution.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
static thoughtDecoration = vscode.window.createTextEditorDecorationType({
|
|
30
|
-
after: {
|
|
31
|
-
color: new vscode.ThemeColor("editorCodeLens.foreground"),
|
|
32
|
-
fontStyle: "italic",
|
|
33
|
-
margin: "0 0 0 2em",
|
|
34
|
-
},
|
|
35
|
-
isWholeLine: true,
|
|
36
|
-
});
|
|
37
|
-
/**
|
|
38
|
-
* projects a "Thought" from the swarm into the editor as a ghost comment.
|
|
39
|
-
* These are ephemeral and clear on next run.
|
|
40
|
-
*/
|
|
41
|
-
static showThought(agent, text) {
|
|
42
|
-
const activeEditor = vscode.window.activeTextEditor;
|
|
43
|
-
if (!activeEditor)
|
|
44
|
-
return;
|
|
45
|
-
const line = activeEditor.selection.active.line;
|
|
46
|
-
const decoration = {
|
|
47
|
-
range: new vscode.Range(line, 0, line, 0),
|
|
48
|
-
renderOptions: {
|
|
49
|
-
after: { contentText: ` // 🧠 ${agent}: ${text}` },
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
activeEditor.setDecorations(this.thoughtDecoration, [decoration]);
|
|
53
|
-
const timeoutKey = `${activeEditor.document.uri.toString()}:${line}`;
|
|
54
|
-
if (this.thoughtTimeouts.has(timeoutKey))
|
|
55
|
-
clearTimeout(this.thoughtTimeouts.get(timeoutKey));
|
|
56
|
-
const timeout = setTimeout(() => {
|
|
57
|
-
activeEditor.setDecorations(this.thoughtDecoration, []);
|
|
58
|
-
this.thoughtTimeouts.delete(timeoutKey);
|
|
59
|
-
}, 2000);
|
|
60
|
-
this.thoughtTimeouts.set(timeoutKey, timeout);
|
|
61
|
-
}
|
|
62
|
-
static pendingDeltas = new Map();
|
|
63
|
-
static updateTimer = null;
|
|
64
|
-
static handleDelta(toolCallId, name, delta) {
|
|
65
|
-
if (![
|
|
66
|
-
"write_file",
|
|
67
|
-
"replace_in_file",
|
|
68
|
-
"write_to_file",
|
|
69
|
-
"replace_file_content",
|
|
70
|
-
"multi_replace_file_content",
|
|
71
|
-
].includes(name))
|
|
72
|
-
return;
|
|
73
|
-
// Buffer the delta
|
|
74
|
-
const current = this.pendingDeltas.get(toolCallId) || "";
|
|
75
|
-
this.pendingDeltas.set(toolCallId, current + delta);
|
|
76
|
-
// Schedule flush if not already pending
|
|
77
|
-
if (!this.updateTimer) {
|
|
78
|
-
this.updateTimer = setTimeout(() => this.flushUpdates(), 20);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
static flushUpdates() {
|
|
82
|
-
this.updateTimer = null;
|
|
83
|
-
for (const [toolCallId, delta] of Array.from(this.pendingDeltas.entries())) {
|
|
84
|
-
const input = this.parser.append(toolCallId, delta);
|
|
85
|
-
const hasContent = input.content !== undefined || input.replace !== undefined;
|
|
86
|
-
if (input.path && hasContent) {
|
|
87
|
-
const uri = vscode.Uri.file(input.path);
|
|
88
|
-
this.updateGhost(toolCallId, uri, input);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
this.pendingDeltas.clear();
|
|
92
|
-
}
|
|
93
|
-
static updateGhost(toolCallId, uri, input) {
|
|
94
|
-
const editors = vscode.window.visibleTextEditors.filter((e) => e.document.uri.toString() === uri.toString());
|
|
95
|
-
if (editors.length === 0)
|
|
96
|
-
return;
|
|
97
|
-
const editor = editors[0];
|
|
98
|
-
let targetLine = 0;
|
|
99
|
-
if (input.line_start !== undefined) {
|
|
100
|
-
targetLine = Math.max(0, input.line_start - 1);
|
|
101
|
-
}
|
|
102
|
-
else if (input.old_content || input.search) {
|
|
103
|
-
const searchString = input.search || input.old_content || "";
|
|
104
|
-
const snapshot = searchString.substring(0, 30);
|
|
105
|
-
if (snapshot) {
|
|
106
|
-
for (let i = 0; i < editor.document.lineCount; i++) {
|
|
107
|
-
if (editor.document.lineAt(i).text.includes(snapshot)) {
|
|
108
|
-
targetLine = i;
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
const range = new vscode.Range(targetLine, 0, targetLine, 0);
|
|
115
|
-
const previewText = input.replace || StringUtils.extractText(input.content) || "";
|
|
116
|
-
const textPreview = ` $(sync~spin) Proposed: ${previewText.substring(0, 80).replace(/\n/g, " ")}...`;
|
|
117
|
-
this.activeGhosts.set(toolCallId, {
|
|
118
|
-
uri: uri.toString(),
|
|
119
|
-
range,
|
|
120
|
-
text: textPreview,
|
|
121
|
-
});
|
|
122
|
-
this.refreshDecorations(uri);
|
|
123
|
-
MarieSCMProvider.getInstance()?.registerDiff(uri, uri);
|
|
124
|
-
}
|
|
125
|
-
static refreshDecorations(uri) {
|
|
126
|
-
const uriStr = uri.toString();
|
|
127
|
-
const relevantGhosts = Array.from(this.activeGhosts.values()).filter((g) => g.uri === uriStr);
|
|
128
|
-
const decorations = relevantGhosts.map((g) => ({
|
|
129
|
-
range: g.range,
|
|
130
|
-
renderOptions: {
|
|
131
|
-
before: { contentText: g.text },
|
|
132
|
-
},
|
|
133
|
-
}));
|
|
134
|
-
vscode.window.visibleTextEditors
|
|
135
|
-
.filter((e) => e.document.uri.toString() === uriStr)
|
|
136
|
-
.forEach((e) => e.setDecorations(this.ghostDecoration, decorations));
|
|
137
|
-
}
|
|
138
|
-
static clear(toolCallId) {
|
|
139
|
-
const ghost = this.activeGhosts.get(toolCallId);
|
|
140
|
-
if (ghost) {
|
|
141
|
-
this.activeGhosts.delete(toolCallId);
|
|
142
|
-
this.refreshDecorations(vscode.Uri.parse(ghost.uri));
|
|
143
|
-
// Only clear SCM if no more ghosts for this URI
|
|
144
|
-
const remaining = Array.from(this.activeGhosts.values()).some((g) => g.uri === ghost.uri);
|
|
145
|
-
if (!remaining) {
|
|
146
|
-
MarieSCMProvider.getInstance()?.clear(vscode.Uri.parse(ghost.uri));
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
this.parser.clear(toolCallId);
|
|
7
|
+
const parser = createPureStreamParser();
|
|
8
|
+
const pendingDeltas = new Map();
|
|
9
|
+
let updateTimer = null;
|
|
10
|
+
/**
|
|
11
|
+
* Handles incoming deltas for file-writing tools.
|
|
12
|
+
* In CLI mode, we use this to track proposed changes for telemetry or post-mortem.
|
|
13
|
+
*/
|
|
14
|
+
export function handleGhostDelta(toolCallId, name, delta) {
|
|
15
|
+
if (![
|
|
16
|
+
"write_file",
|
|
17
|
+
"replace_in_file",
|
|
18
|
+
"write_to_file",
|
|
19
|
+
"replace_file_content",
|
|
20
|
+
"multi_replace_file_content",
|
|
21
|
+
].includes(name))
|
|
22
|
+
return;
|
|
23
|
+
const current = pendingDeltas.get(toolCallId) || "";
|
|
24
|
+
pendingDeltas.set(toolCallId, current + delta);
|
|
25
|
+
if (!updateTimer) {
|
|
26
|
+
updateTimer = setTimeout(() => flushGhostUpdates(), 20);
|
|
150
27
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
28
|
+
}
|
|
29
|
+
export function flushGhostUpdates() {
|
|
30
|
+
updateTimer = null;
|
|
31
|
+
for (const [toolCallId, delta] of Array.from(pendingDeltas.entries())) {
|
|
32
|
+
// Feeding the parser ensures internal state consistency
|
|
33
|
+
parser.append(toolCallId, delta);
|
|
157
34
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
35
|
+
pendingDeltas.clear();
|
|
36
|
+
}
|
|
37
|
+
export function clearGhost(toolCallId) {
|
|
38
|
+
pendingDeltas.delete(toolCallId);
|
|
39
|
+
parser.clear(toolCallId);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Absolute Resource Sanctity.
|
|
43
|
+
* Clears all active parsers and pending deltas.
|
|
44
|
+
*/
|
|
45
|
+
export function clearAllGhosts() {
|
|
46
|
+
pendingDeltas.clear();
|
|
47
|
+
parser.clearAll();
|
|
48
|
+
if (updateTimer) {
|
|
49
|
+
clearTimeout(updateTimer);
|
|
50
|
+
updateTimer = null;
|
|
166
51
|
}
|
|
167
52
|
}
|
|
168
53
|
//# sourceMappingURL=MarieGhostService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarieGhostService.js","sourceRoot":"","sources":["../../../src/monolith/services/MarieGhostService.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"MarieGhostService.js","sourceRoot":"","sources":["../../../src/monolith/services/MarieGhostService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAErF;;;;GAIG;AACH,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;AACxC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