@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,9 +1,9 @@
|
|
|
1
|
-
import * as vscode from "vscode";
|
|
2
1
|
import * as fs from "fs/promises";
|
|
3
2
|
import * as path from "path";
|
|
4
3
|
import { exec } from "child_process";
|
|
5
4
|
import { promisify } from "util";
|
|
6
5
|
import { getErrorMessage } from "../utils/ErrorUtils.js";
|
|
6
|
+
import { getWorkspaceRoot } from "../utils/EnvironmentUtils.js";
|
|
7
7
|
const execAsync = promisify(exec);
|
|
8
8
|
export async function gitStatus(cwd) {
|
|
9
9
|
try {
|
|
@@ -52,10 +52,10 @@ export async function getFileHistory(cwd, filePath) {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
export async function logReflection(message) {
|
|
55
|
-
const
|
|
56
|
-
if (!
|
|
55
|
+
const root = getWorkspaceRoot();
|
|
56
|
+
if (!root)
|
|
57
57
|
return;
|
|
58
|
-
const journalPath = path.join(
|
|
58
|
+
const journalPath = path.join(root, "JOURNAL.md");
|
|
59
59
|
const date = new Date().toISOString().split("T")[0];
|
|
60
60
|
const time = new Date().toLocaleTimeString();
|
|
61
61
|
const entry = `\n### ${date} ${time}\n${message}\n`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitService.js","sourceRoot":"","sources":["../../../../src/monolith/plumbing/git/GitService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"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I,KAAK,OAAO,IAAI,CAAC;IAEpD,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,+CAA+C;QAC/C,MAAM,MAAM,GACV,wEAAwE,CAAC;QAC3E,MAAM,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,KAAK,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
|
|
@@ -1,36 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
static async getDefinitions(uri, position) {
|
|
7
|
-
const definitions = await vscode.commands.executeCommand("vscode.executeDefinitionProvider", uri, position);
|
|
8
|
-
if (!definitions || definitions.length === 0) {
|
|
9
|
-
return "No definitions found.";
|
|
10
|
-
}
|
|
11
|
-
let result = `Found ${definitions.length} definition(s):\n`;
|
|
12
|
-
for (const def of definitions) {
|
|
13
|
-
const range = "range" in def ? def.range : def.targetRange;
|
|
14
|
-
const targetUri = "uri" in def ? def.uri : def.targetUri;
|
|
15
|
-
result += `- ${targetUri.fsPath} [L${range.start.line + 1}:C${range.start.character + 1}]\n`;
|
|
16
|
-
}
|
|
17
|
-
return result;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Finds the type definition of a symbol at the specified position.
|
|
21
|
-
*/
|
|
22
|
-
static async getTypeDefinitions(uri, position) {
|
|
23
|
-
const typeDefs = await vscode.commands.executeCommand("vscode.executeTypeDefinitionProvider", uri, position);
|
|
24
|
-
if (!typeDefs || typeDefs.length === 0) {
|
|
25
|
-
return "No type definitions found.";
|
|
26
|
-
}
|
|
27
|
-
let result = `Found ${typeDefs.length} type definition(s):\n`;
|
|
28
|
-
for (const def of typeDefs) {
|
|
29
|
-
const range = "range" in def ? def.range : def.targetRange;
|
|
30
|
-
const targetUri = "uri" in def ? def.uri : def.targetUri;
|
|
31
|
-
result += `- ${targetUri.fsPath} [L${range.start.line + 1}:C${range.start.character + 1}]\n`;
|
|
32
|
-
}
|
|
33
|
-
return result;
|
|
34
|
-
}
|
|
1
|
+
export async function getDefinitions(filePath, line, character) {
|
|
2
|
+
return "Definition lookup is currently restricted to VS Code environment. Use 'grep_search' for manual symbol discovery. ✨";
|
|
3
|
+
}
|
|
4
|
+
export async function getTypeDefinitions(filePath, line, character) {
|
|
5
|
+
return "Type definition lookup is currently restricted to VS Code environment. ✨";
|
|
35
6
|
}
|
|
36
7
|
//# sourceMappingURL=SymbolService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SymbolService.js","sourceRoot":"","sources":["../../../../src/monolith/plumbing/lsp/SymbolService.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"SymbolService.js","sourceRoot":"","sources":["../../../../src/monolith/plumbing/lsp/SymbolService.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,QAAgB,EAChB,IAAY,EACZ,SAAiB;IAEjB,OAAO,oHAAoH,CAAC;AAC9H,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,QAAgB,EAChB,IAAY,EACZ,SAAiB;IAEjB,OAAO,0EAA0E,CAAC;AACpF,CAAC"}
|
|
@@ -2,30 +2,28 @@
|
|
|
2
2
|
* ZOMBIE LIFECYCLE GUARD: ProcessRegistry
|
|
3
3
|
* Tracks all active child processes and ensures they are killed when Marie is deactivated.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
process.kill("SIGKILL");
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
catch (e) {
|
|
25
|
-
console.error("[MarieRegistry] Failed to kill process:", e);
|
|
5
|
+
const activeProcesses = new Set();
|
|
6
|
+
export function register(process) {
|
|
7
|
+
activeProcesses.add(process);
|
|
8
|
+
process.on("exit", () => {
|
|
9
|
+
activeProcesses.delete(process);
|
|
10
|
+
});
|
|
11
|
+
process.on("error", () => {
|
|
12
|
+
activeProcesses.delete(process);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export function killAll() {
|
|
16
|
+
console.log(`[MarieRegistry] Killing ${activeProcesses.size} active child processes...`);
|
|
17
|
+
for (const process of activeProcesses) {
|
|
18
|
+
try {
|
|
19
|
+
if (!process.killed) {
|
|
20
|
+
process.kill("SIGKILL");
|
|
26
21
|
}
|
|
27
22
|
}
|
|
28
|
-
|
|
23
|
+
catch (e) {
|
|
24
|
+
console.error("[MarieRegistry] Failed to kill process:", e);
|
|
25
|
+
}
|
|
29
26
|
}
|
|
27
|
+
activeProcesses.clear();
|
|
30
28
|
}
|
|
31
29
|
//# sourceMappingURL=ProcessRegistry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProcessRegistry.js","sourceRoot":"","sources":["../../../../src/monolith/plumbing/terminal/ProcessRegistry.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,
|
|
1
|
+
{"version":3,"file":"ProcessRegistry.js","sourceRoot":"","sources":["../../../../src/monolith/plumbing/terminal/ProcessRegistry.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,eAAe,GAAG,IAAI,GAAG,EAAgB,CAAC;AAEhD,MAAM,UAAU,QAAQ,CAAC,OAAqB;IAC5C,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;QACtB,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;QACvB,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,OAAO;IACrB,OAAO,CAAC,GAAG,CACT,2BAA2B,eAAe,CAAC,IAAI,4BAA4B,CAC5E,CAAC;IACF,KAAK,MAAM,OAAO,IAAI,eAAe,EAAE,CAAC;QACtC,IAAI,CAAC;YACH,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;gBACpB,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,CAAC,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IACD,eAAe,CAAC,KAAK,EAAE,CAAC;AAC1B,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import * as vscode from "vscode";
|
|
2
1
|
import { exec, spawn } from "child_process";
|
|
3
2
|
import { promisify } from "util";
|
|
4
|
-
import {
|
|
3
|
+
import { register } from "./ProcessRegistry.js";
|
|
4
|
+
import { getCapabilities } from "../../infrastructure/config/ConfigService.js";
|
|
5
|
+
import { getWorkspaceRoot } from "../utils/EnvironmentUtils.js";
|
|
5
6
|
const execAsync = promisify(exec);
|
|
6
7
|
// Patterns that usually indicate an interactive or blocking command
|
|
7
8
|
const INTERACTIVE_PATTERNS = [
|
|
@@ -20,161 +21,151 @@ const MAX_OUTPUT_LENGTH = 10000; // ~10KB limit for context safety
|
|
|
20
21
|
const ANSI_REGEX = new RegExp("[\x1b\x9b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]", "g");
|
|
21
22
|
const stripAnsi = (t) => t.replace(ANSI_REGEX, "");
|
|
22
23
|
/* eslint-enable no-control-regex */
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return this.terminal;
|
|
24
|
+
const activeProcesses = new Set();
|
|
25
|
+
export async function runCommand(command, signal) {
|
|
26
|
+
// PHASE 17: Capability Check
|
|
27
|
+
if (!getCapabilities().includes("SHELL")) {
|
|
28
|
+
return `Sovereign Capability Breach: Direct shell execution is disabled in the current engine configuration. 🛑`;
|
|
29
|
+
}
|
|
30
|
+
if (INTERACTIVE_PATTERNS.some((p) => p.test(command))) {
|
|
31
|
+
return `Error: Command '${command}' appears to be interactive or potentially blocking. Please use non-interactive flags (e.g., -y, -m) or run it manually.`;
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
// 2. Shell Injection Guard (Sub-Atomic Integrity)
|
|
34
|
+
const suspiciousChars = /[;&|`$(){}]/;
|
|
35
|
+
if (suspiciousChars.test(command)) {
|
|
36
|
+
// Check if it's a "known safe" complex command (e.g. npm run build -- --noEmit || npx tsc --noEmit)
|
|
37
|
+
const isSafeHeuristic = command.includes("--noEmit") || command.includes("npm run bloom");
|
|
38
|
+
if (!isSafeHeuristic) {
|
|
39
|
+
return `Security Error: Command '${command}' contains suspicious shell metacharacters. High-order tools reject unvetted complex logic for systemic safety. 🛑`;
|
|
36
40
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
}
|
|
42
|
+
if (signal?.aborted) {
|
|
43
|
+
return "Command aborted before execution.";
|
|
44
|
+
}
|
|
45
|
+
const rootPath = getWorkspaceRoot();
|
|
46
|
+
const shell = process.env.SHELL || "/bin/sh";
|
|
47
|
+
let childProcess;
|
|
48
|
+
const spawnPromise = new Promise((resolve, reject) => {
|
|
49
|
+
try {
|
|
50
|
+
// Use shell: true to support command strings with pipes/redirects
|
|
51
|
+
childProcess = spawn(command, {
|
|
52
|
+
cwd: rootPath,
|
|
53
|
+
shell: shell,
|
|
54
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
55
|
+
detached: true, // Spectral Integrity: Detach to allow PGID killing
|
|
56
|
+
});
|
|
57
|
+
register(childProcess);
|
|
58
|
+
let stdout = "";
|
|
59
|
+
let stderr = "";
|
|
60
|
+
childProcess.stdout?.on("data", (data) => {
|
|
61
|
+
stdout += data.toString();
|
|
62
|
+
if (stdout.length > MAX_OUTPUT_LENGTH * 2) {
|
|
63
|
+
stdout = stdout.substring(stdout.length - MAX_OUTPUT_LENGTH * 2);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
childProcess.stderr?.on("data", (data) => {
|
|
67
|
+
stderr += data.toString();
|
|
68
|
+
if (stderr.length > MAX_OUTPUT_LENGTH * 2) {
|
|
69
|
+
stderr = stderr.substring(stderr.length - MAX_OUTPUT_LENGTH * 2);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
childProcess.on("close", (code) => {
|
|
73
|
+
resolve({ stdout, stderr, code });
|
|
74
|
+
});
|
|
75
|
+
childProcess.on("error", (err) => {
|
|
76
|
+
reject(err);
|
|
77
|
+
});
|
|
45
78
|
}
|
|
46
|
-
|
|
47
|
-
|
|
79
|
+
catch (err) {
|
|
80
|
+
reject(err);
|
|
48
81
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const rootPath = vscode.workspace.workspaceFolders?.[0].uri.fsPath;
|
|
54
|
-
const shell = process.env.SHELL || "/bin/sh";
|
|
55
|
-
let childProcess;
|
|
56
|
-
const spawnPromise = new Promise((resolve, reject) => {
|
|
82
|
+
});
|
|
83
|
+
const onAbort = () => {
|
|
84
|
+
if (childProcess && childProcess.pid) {
|
|
85
|
+
console.log(`[Terminal] Killing process GROUP for command: ${command}`);
|
|
57
86
|
try {
|
|
58
|
-
//
|
|
59
|
-
childProcess
|
|
60
|
-
cwd: rootPath,
|
|
61
|
-
shell: shell,
|
|
62
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
63
|
-
detached: true, // Spectral Integrity: Detach to allow PGID killing
|
|
64
|
-
});
|
|
65
|
-
ProcessRegistry.register(childProcess);
|
|
66
|
-
let stdout = "";
|
|
67
|
-
let stderr = "";
|
|
68
|
-
childProcess.stdout?.on("data", (data) => {
|
|
69
|
-
stdout += data.toString();
|
|
70
|
-
if (stdout.length > MAX_OUTPUT_LENGTH * 2) {
|
|
71
|
-
stdout = stdout.substring(stdout.length - MAX_OUTPUT_LENGTH * 2);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
childProcess.stderr?.on("data", (data) => {
|
|
75
|
-
stderr += data.toString();
|
|
76
|
-
if (stderr.length > MAX_OUTPUT_LENGTH * 2) {
|
|
77
|
-
stderr = stderr.substring(stderr.length - MAX_OUTPUT_LENGTH * 2);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
childProcess.on("close", (code) => {
|
|
81
|
-
resolve({ stdout, stderr, code });
|
|
82
|
-
});
|
|
83
|
-
childProcess.on("error", (err) => {
|
|
84
|
-
reject(err);
|
|
85
|
-
});
|
|
87
|
+
// Kill the entire process group (PGID)
|
|
88
|
+
process.kill(-childProcess.pid, "SIGTERM");
|
|
86
89
|
}
|
|
87
|
-
catch (
|
|
88
|
-
|
|
90
|
+
catch (e) {
|
|
91
|
+
childProcess.kill("SIGTERM");
|
|
89
92
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (childProcess && childProcess.pid) {
|
|
93
|
-
console.log(`[Terminal] Killing process GROUP for command: ${command}`);
|
|
93
|
+
// Definitive Reap: Force kill PG if it doesn't shut down quickly
|
|
94
|
+
setTimeout(() => {
|
|
94
95
|
try {
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
if (childProcess.pid) {
|
|
97
|
+
process.kill(-childProcess.pid, "SIGKILL");
|
|
98
|
+
}
|
|
97
99
|
}
|
|
98
100
|
catch (e) {
|
|
99
|
-
childProcess.kill("SIGTERM");
|
|
100
|
-
}
|
|
101
|
-
// Definitive Reap: Force kill PG if it doesn't shut down quickly
|
|
102
|
-
setTimeout(() => {
|
|
103
101
|
try {
|
|
104
|
-
|
|
105
|
-
process.kill(-childProcess.pid, "SIGKILL");
|
|
106
|
-
}
|
|
102
|
+
childProcess.kill("SIGKILL");
|
|
107
103
|
}
|
|
108
|
-
catch (
|
|
109
|
-
|
|
110
|
-
childProcess.kill("SIGKILL");
|
|
111
|
-
}
|
|
112
|
-
catch (e2) {
|
|
113
|
-
// Ignore further kill errors
|
|
114
|
-
}
|
|
104
|
+
catch (e2) {
|
|
105
|
+
// Ignore further kill errors
|
|
115
106
|
}
|
|
116
|
-
}, 1000);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
if (signal) {
|
|
120
|
-
signal.addEventListener("abort", onAbort);
|
|
121
|
-
}
|
|
122
|
-
try {
|
|
123
|
-
this.activeProcesses.add(childProcess);
|
|
124
|
-
const { stdout, stderr, code } = await spawnPromise;
|
|
125
|
-
this.activeProcesses.delete(childProcess);
|
|
126
|
-
if (signal?.aborted) {
|
|
127
|
-
return `Command aborted by user. Process cleanup initiated. 🛑`;
|
|
128
|
-
}
|
|
129
|
-
if (code !== 0 && code !== null) {
|
|
130
|
-
let cleanedStderr = stripAnsi(stderr);
|
|
131
|
-
if (cleanedStderr.length > MAX_OUTPUT_LENGTH) {
|
|
132
|
-
cleanedStderr =
|
|
133
|
-
`... [Truncated] ...\n` +
|
|
134
|
-
cleanedStderr.substring(cleanedStderr.length - MAX_OUTPUT_LENGTH);
|
|
135
107
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return `**${label}:**\n\`\`\`\n${content}\n\`\`\`\n`;
|
|
149
|
-
};
|
|
150
|
-
result += formatOutput(stdout, "Output");
|
|
151
|
-
result += formatOutput(stderr, "Errors/Warnings");
|
|
152
|
-
return result || "Command completed with no output.";
|
|
108
|
+
}, 1000);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
if (signal) {
|
|
112
|
+
signal.addEventListener("abort", onAbort);
|
|
113
|
+
}
|
|
114
|
+
try {
|
|
115
|
+
activeProcesses.add(childProcess);
|
|
116
|
+
const { stdout, stderr, code } = await spawnPromise;
|
|
117
|
+
activeProcesses.delete(childProcess);
|
|
118
|
+
if (signal?.aborted) {
|
|
119
|
+
return `Command aborted by user. Process cleanup initiated. 🛑`;
|
|
153
120
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
121
|
+
if (code !== 0 && code !== null) {
|
|
122
|
+
let cleanedStderr = stripAnsi(stderr);
|
|
123
|
+
if (cleanedStderr.length > MAX_OUTPUT_LENGTH) {
|
|
124
|
+
cleanedStderr =
|
|
125
|
+
`... [Truncated] ...\n` +
|
|
126
|
+
cleanedStderr.substring(cleanedStderr.length - MAX_OUTPUT_LENGTH);
|
|
157
127
|
}
|
|
158
|
-
return `Command
|
|
128
|
+
return `Command failed (Exit Code: ${code}):\n${cleanedStderr ? `**Error Output:**\n\`\`\`\n${cleanedStderr}\n\`\`\`` : "No error output captured."}`;
|
|
159
129
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (
|
|
163
|
-
|
|
130
|
+
let result = `Command executed successfully (Exit Code: 0). ✨\n\n`;
|
|
131
|
+
const formatOutput = (text, label) => {
|
|
132
|
+
if (!text)
|
|
133
|
+
return "";
|
|
134
|
+
let content = stripAnsi(text);
|
|
135
|
+
if (content.length > MAX_OUTPUT_LENGTH) {
|
|
136
|
+
content =
|
|
137
|
+
`... [Truncated for brevity] ...\n` +
|
|
138
|
+
content.substring(content.length - MAX_OUTPUT_LENGTH);
|
|
164
139
|
}
|
|
140
|
+
return `**${label}:**\n\`\`\`\n${content}\n\`\`\`\n`;
|
|
141
|
+
};
|
|
142
|
+
result += formatOutput(stdout, "Output");
|
|
143
|
+
result += formatOutput(stderr, "Errors/Warnings");
|
|
144
|
+
return result || "Command completed with no output.";
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
if (signal?.aborted) {
|
|
148
|
+
return `Command aborted by user. Process cleanup initiated. 🛑`;
|
|
165
149
|
}
|
|
150
|
+
return `Command execution failed: ${error.message}`;
|
|
166
151
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
152
|
+
finally {
|
|
153
|
+
activeProcesses.delete(childProcess);
|
|
154
|
+
if (signal) {
|
|
155
|
+
signal.removeEventListener("abort", onAbort);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
export function cleanupProcesses() {
|
|
160
|
+
console.log(`[Terminal] Cleaning up ${activeProcesses.size} active processes...`);
|
|
161
|
+
for (const cp of activeProcesses) {
|
|
162
|
+
try {
|
|
163
|
+
cp.kill("SIGKILL");
|
|
164
|
+
}
|
|
165
|
+
catch (e) {
|
|
166
|
+
// Ignore errors during cleanup
|
|
176
167
|
}
|
|
177
|
-
this.activeProcesses.clear();
|
|
178
168
|
}
|
|
169
|
+
activeProcesses.clear();
|
|
179
170
|
}
|
|
180
171
|
//# sourceMappingURL=TerminalService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerminalService.js","sourceRoot":"","sources":["../../../../src/monolith/plumbing/terminal/TerminalService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"TerminalService.js","sourceRoot":"","sources":["../../../../src/monolith/plumbing/terminal/TerminalService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM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ie.
|
|
4
|
-
* Distinguishes between
|
|
4
|
+
* Distinguishes between CLI/Standalone modes.
|
|
5
5
|
*/
|
|
6
6
|
export function isVsCodeExtension() {
|
|
7
|
-
return
|
|
8
|
-
process.env.VSCODE_PID ||
|
|
9
|
-
process.env.VSCODE_CWD ||
|
|
10
|
-
process.env.VSCODE_NLS_CONFIG) &&
|
|
11
|
-
!process.env.MARIE_FORCE_CLI);
|
|
7
|
+
return false;
|
|
12
8
|
}
|
|
13
9
|
/**
|
|
14
10
|
* Isomorphic require implementation that works in both ESM and CJS.
|
|
15
|
-
* Prevents build-time and runtime crashes in bundled environments like VS Code.
|
|
16
11
|
*/
|
|
17
12
|
export const nodeRequire = (() => {
|
|
18
13
|
// Use globalThis to avoid shadowing/hoisting issues with 'require'
|
|
@@ -21,8 +16,6 @@ export const nodeRequire = (() => {
|
|
|
21
16
|
return g.require;
|
|
22
17
|
}
|
|
23
18
|
// In ESM environments, we must create a require function using import.meta.url
|
|
24
|
-
// We use an indirect eval to prevent bundlers (like esbuild) from
|
|
25
|
-
// attempting to polyfill or complain about import.meta in non-ESM output.
|
|
26
19
|
try {
|
|
27
20
|
const metaUrl = (0, eval)("import.meta.url");
|
|
28
21
|
if (metaUrl) {
|
|
@@ -32,28 +25,15 @@ export const nodeRequire = (() => {
|
|
|
32
25
|
catch {
|
|
33
26
|
// Fallback or ignore
|
|
34
27
|
}
|
|
35
|
-
// Final fallback
|
|
28
|
+
// Final fallback
|
|
36
29
|
return (id) => {
|
|
37
30
|
throw new Error(`Execution Environment Error: Cannot require "${id}". Environment is incompatible with module resolution.`);
|
|
38
31
|
};
|
|
39
32
|
})();
|
|
40
33
|
/**
|
|
41
34
|
* Safely resolves the workspace root directory.
|
|
42
|
-
* In VS Code, it uses the first workspace folder.
|
|
43
|
-
* In CLI or tests, it defaults to the current working directory.
|
|
44
35
|
*/
|
|
45
36
|
export function getWorkspaceRoot() {
|
|
46
|
-
if (isVsCodeExtension()) {
|
|
47
|
-
try {
|
|
48
|
-
const vscode = nodeRequire("vscode");
|
|
49
|
-
const root = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath;
|
|
50
|
-
if (root)
|
|
51
|
-
return root;
|
|
52
|
-
}
|
|
53
|
-
catch {
|
|
54
|
-
// Fallback
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
37
|
return process.cwd();
|
|
58
38
|
}
|
|
59
39
|
//# sourceMappingURL=EnvironmentUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentUtils.js","sourceRoot":"","sources":["../../../../src/monolith/plumbing/utils/EnvironmentUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC;;;GAGG;AACH,MAAM,UAAU,iBAAiB;
|
|
1
|
+
{"version":3,"file":"EnvironmentUtils.js","sourceRoot":"","sources":["../../../../src/monolith/plumbing/utils/EnvironmentUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE;IAC/B,mEAAmE;IACnE,MAAM,CAAC,GAAG,UAAiB,CAAC;IAC5B,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;QACrC,OAAO,CAAC,CAAC,OAAO,CAAC;IACnB,CAAC;IAED,+EAA+E;IAC/E,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,iBAAiB,CAAC,CAAC;QAC7C,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,qBAAqB;IACvB,CAAC;IAED,iBAAiB;IACjB,OAAO,CAAC,EAAU,EAAE,EAAE;QACpB,MAAM,IAAI,KAAK,CACb,gDAAgD,EAAE,wDAAwD,CAC3G,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC;AAEL;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC;AACvB,CAAC"}
|