@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.
- package/README.md +7 -15
- package/SENTINEL.md +4 -7
- 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 +2 -1
- package/dist/cli-new/components/ApprovalDialog.js.map +1 -1
- package/dist/cli-new/components/Banner.js +4 -3
- 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 +13 -7
- package/dist/cli-new/components/Header.js.map +1 -1
- package/dist/cli-new/components/InputArea.js +73 -12
- package/dist/cli-new/components/InputArea.js.map +1 -1
- package/dist/cli-new/components/MessageBubble.js +26 -18
- package/dist/cli-new/components/MessageBubble.js.map +1 -1
- package/dist/cli-new/components/SessionSwitcher.js +4 -7
- 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/utils/version.js +24 -0
- package/dist/cli-new/utils/version.js.map +1 -0
- package/dist/monolith/adapters/CliMarieAdapter.js +12 -11
- 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 +39 -31
- package/dist/monolith/cli/MarieToolDefinitionsCLI.js.map +1 -1
- package/dist/monolith/cli/index.js +5 -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 +142 -72
- 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 +6 -27
- package/dist/monolith/infrastructure/ai/context/ContextArchiveService.js.map +1 -1
- package/dist/monolith/infrastructure/ai/context/ContextManager.js +142 -131
- package/dist/monolith/infrastructure/ai/context/ContextManager.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MarieEngine.js +115 -1077
- 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 +6 -1
- package/dist/monolith/infrastructure/ai/core/MarieLockManager.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MarieProgressTracker.js +172 -221
- package/dist/monolith/infrastructure/ai/core/MarieProgressTracker.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MarieSanitizer.js +292 -141
- package/dist/monolith/infrastructure/ai/core/MarieSanitizer.js.map +1 -1
- package/dist/monolith/infrastructure/ai/core/MarieToolProcessor.js +331 -614
- 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/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 -392
- 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 -503
- package/dist/monolith/infrastructure/config/ConfigService.js.map +1 -1
- package/dist/monolith/infrastructure/joy/CognitiveRituals.js +4 -165
- package/dist/monolith/infrastructure/joy/CognitiveRituals.js.map +1 -1
- package/dist/monolith/infrastructure/joy/JoyTools.js +14 -47
- 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 +123 -106
- package/dist/monolith/infrastructure/persistence/NoormmeAutonomics.js.map +1 -1
- package/dist/monolith/infrastructure/persistence/NoormmeEngine.js +508 -63
- package/dist/monolith/infrastructure/persistence/NoormmeEngine.js.map +1 -1
- package/dist/monolith/infrastructure/persistence/NoormmeSchema.js +68 -39
- package/dist/monolith/infrastructure/persistence/NoormmeSchema.js.map +1 -1
- package/dist/monolith/infrastructure/persistence/NoormmeSeeder.js +80 -67
- package/dist/monolith/infrastructure/persistence/NoormmeSeeder.js.map +1 -1
- package/dist/monolith/infrastructure/persistence/NoormmeTools.js +122 -75
- package/dist/monolith/infrastructure/persistence/NoormmeTools.js.map +1 -1
- 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 -30
- 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 +39 -153
- package/dist/monolith/infrastructure/tools/definitions/AnalysisTools.js.map +1 -1
- package/dist/monolith/infrastructure/tools/definitions/AutomationTools.js +31 -46
- package/dist/monolith/infrastructure/tools/definitions/AutomationTools.js.map +1 -1
- package/dist/monolith/infrastructure/tools/definitions/ContextTools.js +41 -13
- package/dist/monolith/infrastructure/tools/definitions/ContextTools.js.map +1 -1
- package/dist/monolith/infrastructure/tools/definitions/CoreTools.js +10 -14
- package/dist/monolith/infrastructure/tools/definitions/CoreTools.js.map +1 -1
- package/dist/monolith/infrastructure/tools/definitions/DiagnosticTools.js +39 -70
- package/dist/monolith/infrastructure/tools/definitions/DiagnosticTools.js.map +1 -1
- package/dist/monolith/infrastructure/tools/definitions/NavigationTools.js +30 -181
- package/dist/monolith/infrastructure/tools/definitions/NavigationTools.js.map +1 -1
- package/dist/monolith/infrastructure/tools/definitions/PlanningTools.js +12 -9
- package/dist/monolith/infrastructure/tools/definitions/PlanningTools.js.map +1 -1
- 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 -268
- 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 -141
- 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/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 -499
- 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 -173
- 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 -89
- package/run_test.js +5 -0
- package/.marie_visual_verify_1771225696548/progress_bar_check.txt +0 -1
- package/dist/extension.cjs +0 -1155
- package/dist/extension.js +0 -474
- 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/infrastructure/ai/core/GhostPort.js +0 -2
- package/dist/monolith/infrastructure/ai/core/GhostPort.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 -154
- package/dist/monolith/infrastructure/ai/providers/AnthropicProvider.js.map +0 -1
- package/dist/monolith/infrastructure/ai/providers/CerebrasProvider.js +0 -214
- 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/webview-ui/main.css +0 -1
- package/dist/webview-ui/main.js +0 -108
- package/lint_output.txt +0 -705
- package/lint_output_v2.txt +0 -711
- package/test-mind-p6.sqlite +0 -0
- package/test-mind-p6.sqlite-shm +0 -0
- package/test-mind-p6.sqlite-wal +0 -0
|
@@ -1,175 +1,326 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getSanitizationMaxDepth, getSanitizationStringLimit, getSanitizationBreadthLimit, getSanitizationGlobalMaxSize, getSanitizationMaxEnumKeys, } from "../../config/ConfigService.js";
|
|
2
2
|
/**
|
|
3
3
|
* QUANTUM RESILIENCE: MarieSanitizer
|
|
4
4
|
* Purges circular references, enforces depth and breadth limits, and truncates massive strings.
|
|
5
5
|
* Ensures the telemetry stream never crashes the VS Code bridge.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (type === "string") {
|
|
28
|
-
// PHASE 14: Secret Scanning & Redaction
|
|
29
|
-
let sanitizedString = this.scanAndRedact(val);
|
|
30
|
-
const effectiveLength = Math.min(sanitizedString.length, this.STRING_LIMIT);
|
|
31
|
-
totalSize += effectiveLength;
|
|
32
|
-
if (sanitizedString.length > this.STRING_LIMIT) {
|
|
33
|
-
return sanitizedString.substring(0, this.STRING_LIMIT) + "... [Truncated]";
|
|
34
|
-
}
|
|
35
|
-
return sanitizedString;
|
|
36
|
-
}
|
|
37
|
-
if (type === "number") {
|
|
38
|
-
totalSize += 8;
|
|
39
|
-
return val;
|
|
7
|
+
const getMAX_DEPTH = () => getSanitizationMaxDepth();
|
|
8
|
+
const getSTRING_LIMIT = () => getSanitizationStringLimit();
|
|
9
|
+
const getBREADTH_LIMIT = () => getSanitizationBreadthLimit();
|
|
10
|
+
const getGLOBAL_MAX_SIZE = () => getSanitizationGlobalMaxSize();
|
|
11
|
+
const getMAX_ENUM_KEYS = () => getSanitizationMaxEnumKeys();
|
|
12
|
+
/**
|
|
13
|
+
* Safely gets a limited number of keys from an object to prevent 'Too many properties to enumerate'.
|
|
14
|
+
* Uses iterative for...in to avoid the overhead/crash of Object.keys() on massive objects/proxies.
|
|
15
|
+
*/
|
|
16
|
+
export function safeGetKeys(obj, limit) {
|
|
17
|
+
const keys = [];
|
|
18
|
+
if (obj === null || obj === undefined || typeof obj !== "object")
|
|
19
|
+
return keys;
|
|
20
|
+
try {
|
|
21
|
+
let count = 0;
|
|
22
|
+
for (const key in obj) {
|
|
23
|
+
// PHASE 24: Extra safety for hostile proxies
|
|
24
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
25
|
+
keys.push(key);
|
|
26
|
+
count++;
|
|
40
27
|
}
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
if (count >= limit)
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
// Return whatever we managed to get before the crash
|
|
34
|
+
}
|
|
35
|
+
return keys;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Safely gets entries from an object with a limit.
|
|
39
|
+
*/
|
|
40
|
+
export function safeGetEntries(obj, limit) {
|
|
41
|
+
const entries = [];
|
|
42
|
+
const keys = safeGetKeys(obj, limit);
|
|
43
|
+
for (const key of keys) {
|
|
44
|
+
try {
|
|
45
|
+
entries.push([key, obj[key]]);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
entries.push([key, "[Unreadable Property]"]);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return entries;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Safely gets values from an object with a limit.
|
|
55
|
+
*/
|
|
56
|
+
export function safeGetValues(obj, limit) {
|
|
57
|
+
const values = [];
|
|
58
|
+
const keys = safeGetKeys(obj, limit);
|
|
59
|
+
for (const key of keys) {
|
|
60
|
+
try {
|
|
61
|
+
values.push(obj[key]);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
values.push("[Unreadable Property]");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return values;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Sanitizes an object for safe JSON serialization and bridge transport.
|
|
71
|
+
* @param obj The object to sanitize.
|
|
72
|
+
*/
|
|
73
|
+
export function sanitize(obj) {
|
|
74
|
+
const seen = new WeakSet();
|
|
75
|
+
let totalSize = 0;
|
|
76
|
+
const sanitizer = (val, depth) => {
|
|
77
|
+
if (totalSize > getGLOBAL_MAX_SIZE())
|
|
78
|
+
return "[Global Size Limit Reached]";
|
|
79
|
+
if (depth > getMAX_DEPTH())
|
|
80
|
+
return "[Max Depth Reached]";
|
|
81
|
+
if (val === null || val === undefined)
|
|
82
|
+
return val;
|
|
83
|
+
const type = typeof val;
|
|
84
|
+
if (type === "string") {
|
|
85
|
+
// PHASE 14: Secret Scanning & Redaction
|
|
86
|
+
const sanitizedString = scanAndRedact(val);
|
|
87
|
+
const effectiveLength = Math.min(sanitizedString.length, getSTRING_LIMIT());
|
|
88
|
+
totalSize += effectiveLength;
|
|
89
|
+
if (sanitizedString.length > getSTRING_LIMIT()) {
|
|
90
|
+
return (sanitizedString.substring(0, getSTRING_LIMIT()) + "... [Truncated]");
|
|
44
91
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
92
|
+
return sanitizedString;
|
|
93
|
+
}
|
|
94
|
+
if (type === "number") {
|
|
95
|
+
totalSize += 8;
|
|
96
|
+
return val;
|
|
97
|
+
}
|
|
98
|
+
if (type === "boolean") {
|
|
99
|
+
totalSize += 4;
|
|
100
|
+
return val;
|
|
101
|
+
}
|
|
102
|
+
if (type === "function")
|
|
103
|
+
return "[Function]";
|
|
104
|
+
if (type === "symbol")
|
|
105
|
+
return "[Symbol]";
|
|
106
|
+
if (type === "object") {
|
|
107
|
+
try {
|
|
50
108
|
if (seen.has(val))
|
|
51
109
|
return "[Circular Reference]";
|
|
52
110
|
seen.add(val);
|
|
53
|
-
|
|
111
|
+
}
|
|
112
|
+
catch (e) {
|
|
113
|
+
return "[Un-trackable Object]";
|
|
114
|
+
}
|
|
115
|
+
let isArr = false;
|
|
116
|
+
try {
|
|
117
|
+
isArr = Array.isArray(val);
|
|
118
|
+
}
|
|
119
|
+
catch (e) {
|
|
120
|
+
return "[Un-evaluable Array/Proxy]";
|
|
121
|
+
}
|
|
122
|
+
if (isArr) {
|
|
123
|
+
try {
|
|
124
|
+
// Use safe slice for arrays too
|
|
125
|
+
const arrayLimit = getBREADTH_LIMIT();
|
|
54
126
|
const arr = val
|
|
55
|
-
.slice(0,
|
|
127
|
+
.slice(0, arrayLimit)
|
|
56
128
|
.map((item) => sanitizer(item, depth + 1));
|
|
57
|
-
if (val.length >
|
|
58
|
-
arr.push(`... [${val.length -
|
|
129
|
+
if (val.length > arrayLimit) {
|
|
130
|
+
arr.push(`... [${val.length - arrayLimit} items truncated]`);
|
|
59
131
|
}
|
|
60
132
|
return arr;
|
|
61
133
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
134
|
+
catch (e) {
|
|
135
|
+
return "[Un-iterable Array/Proxy]";
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const sanitizedObj = {};
|
|
139
|
+
// QUANTUM RESILIENCE: Use safeGetKeys with the enum limit to avoid V8 enumeration explosion
|
|
140
|
+
const keys = safeGetKeys(val, getMAX_ENUM_KEYS() + 1);
|
|
141
|
+
if (keys.length > getMAX_ENUM_KEYS()) {
|
|
142
|
+
sanitizedObj["_enumeration_halted"] =
|
|
143
|
+
`Object has too many properties (truncated at ${getMAX_ENUM_KEYS()})`;
|
|
144
|
+
}
|
|
145
|
+
const limitedKeys = keys.slice(0, getBREADTH_LIMIT());
|
|
146
|
+
for (const key of limitedKeys) {
|
|
147
|
+
if (key.startsWith("_") ||
|
|
148
|
+
key === "extensionContext" ||
|
|
149
|
+
key === "provider" ||
|
|
150
|
+
key === "marie" ||
|
|
151
|
+
key === "runtime")
|
|
152
|
+
continue;
|
|
153
|
+
try {
|
|
154
|
+
// Extra safety for massive property access
|
|
155
|
+
const propertyVal = val[key];
|
|
156
|
+
if (typeof propertyVal === "function")
|
|
69
157
|
continue;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
sanitized[key] = sanitizer(val[key], depth + 1);
|
|
73
|
-
}
|
|
74
|
-
catch {
|
|
75
|
-
sanitized[key] = "[Unreadable]";
|
|
76
|
-
}
|
|
158
|
+
totalSize += key.length;
|
|
159
|
+
sanitizedObj[key] = sanitizer(propertyVal, depth + 1);
|
|
77
160
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
`${keys.length - this.BREADTH_LIMIT} properties truncated`;
|
|
161
|
+
catch {
|
|
162
|
+
sanitizedObj[key] = "[Unreadable Property]";
|
|
81
163
|
}
|
|
82
|
-
return sanitized;
|
|
83
164
|
}
|
|
84
|
-
|
|
85
|
-
|
|
165
|
+
if (keys.length > getBREADTH_LIMIT() &&
|
|
166
|
+
!sanitizedObj["_enumeration_halted"]) {
|
|
167
|
+
sanitizedObj["_truncated"] =
|
|
168
|
+
`${keys.length - getBREADTH_LIMIT()} properties truncated`;
|
|
169
|
+
}
|
|
170
|
+
return sanitizedObj;
|
|
171
|
+
}
|
|
172
|
+
return String(val);
|
|
173
|
+
};
|
|
174
|
+
try {
|
|
86
175
|
return sanitizer(obj, 0);
|
|
87
176
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
* Redacts sensitive patterns like API keys, Bearer tokens, etc.
|
|
91
|
-
*/
|
|
92
|
-
static scanAndRedact(text) {
|
|
93
|
-
const patterns = [
|
|
94
|
-
/(api[_-]?key[:=]\s*['"]?)[a-zA-Z0-9_\-]{20,}/gi, // API keys
|
|
95
|
-
/(auth[_-]?token[:=]\s*['"]?)[a-zA-Z0-9_\-\.]{20,}/gi, // Auth tokens
|
|
96
|
-
/(Bearer\s+)[a-zA-Z0-9_\-\.]{20,}/gi, // Bearer tokens
|
|
97
|
-
/(password[:=]\s*['"]?)[^'"]{4,}/gi, // Passwords (basic)
|
|
98
|
-
];
|
|
99
|
-
let redacted = text;
|
|
100
|
-
for (const pattern of patterns) {
|
|
101
|
-
redacted = redacted.replace(pattern, "$1[REDACTED]");
|
|
102
|
-
}
|
|
103
|
-
return redacted;
|
|
177
|
+
catch (e) {
|
|
178
|
+
return `[Sanitization Failed: ${String(e)}]`;
|
|
104
179
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Safely stringifies an object by sanitizing it first.
|
|
183
|
+
*/
|
|
184
|
+
export function safeStringify(obj, space) {
|
|
185
|
+
try {
|
|
186
|
+
return JSON.stringify(sanitize(obj), null, space);
|
|
187
|
+
}
|
|
188
|
+
catch (e) {
|
|
189
|
+
return `[Stringify Failed: ${String(e)}]`;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Safely spreads an object into another by sanitizing it first.
|
|
194
|
+
* Prevents 'Too many properties to enumerate' during spread operations.
|
|
195
|
+
*/
|
|
196
|
+
export function safeSpread(obj) {
|
|
197
|
+
const sanitized = sanitize(obj);
|
|
198
|
+
return typeof sanitized === "object" && sanitized !== null ? sanitized : {};
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* PHASE 14: Sovereign Redaction Logic
|
|
202
|
+
* Redacts sensitive patterns like API keys, Bearer tokens, etc.
|
|
203
|
+
*/
|
|
204
|
+
function scanAndRedact(text) {
|
|
205
|
+
const patterns = [
|
|
206
|
+
/(api[\s_-]?key\s+(?:is\s+)?[:=\s]?\s*['"]?)[a-zA-Z0-9_\-]{20,}/gi, // API keys
|
|
207
|
+
/(auth[\s_-]?token\s+(?:is\s+)?[:=\s]?\s*['"]?)[a-zA-Z0-9_\-\.]{20,}/gi, // Auth tokens
|
|
208
|
+
/(Bearer\s+)[a-zA-Z0-9_\-\.]{20,}/gi, // Bearer tokens
|
|
209
|
+
/(password\s+(?:is\s+)?[:=\s]?\s*['"]?)[^'"]{4,}/gi, // Passwords (basic)
|
|
210
|
+
];
|
|
211
|
+
let redacted = text;
|
|
212
|
+
for (const pattern of patterns) {
|
|
213
|
+
redacted = redacted.replace(pattern, "$1[REDACTED]");
|
|
214
|
+
}
|
|
215
|
+
return redacted;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* PHASE 19: Skill Mutation Sanitization
|
|
219
|
+
* Strips known prompt injection sequences from evolved tool descriptions.
|
|
220
|
+
*/
|
|
221
|
+
export function sanitizeSkillDescription(desc) {
|
|
222
|
+
if (!desc)
|
|
223
|
+
return desc;
|
|
224
|
+
const injectionPatterns = [
|
|
225
|
+
/ignore\s+previous\s+instructions/gi,
|
|
226
|
+
/instead\s+of\s+the\s+original\s+plan/gi,
|
|
227
|
+
/you\s+must\s+now\s+perform/gi,
|
|
228
|
+
/system\s+override/gi,
|
|
229
|
+
/elevate\s+privileges/gi,
|
|
230
|
+
];
|
|
231
|
+
let sanitized = desc;
|
|
232
|
+
for (const pattern of injectionPatterns) {
|
|
233
|
+
sanitized = sanitized.replace(pattern, "[SEC_BLOCKED]");
|
|
234
|
+
}
|
|
235
|
+
// Enforce string limit for descriptions
|
|
236
|
+
if (sanitized.length > getSTRING_LIMIT()) {
|
|
237
|
+
sanitized = sanitized.substring(0, getSTRING_LIMIT()) + "... [Truncated]";
|
|
238
|
+
}
|
|
239
|
+
return sanitized;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* PHASE 23: Deep Argument Scanning
|
|
243
|
+
* Scans tool arguments for adversarial patterns (shell injection, prompt injection).
|
|
244
|
+
*/
|
|
245
|
+
export function scanToolArguments(name, input) {
|
|
246
|
+
const alerts = [];
|
|
247
|
+
// Use safeStringify to avoid enumeration errors
|
|
248
|
+
const inputStr = safeStringify(input);
|
|
249
|
+
// 1. Shell Injection Check (for run_command)
|
|
250
|
+
if (name === "run_command" || name === "run_shell") {
|
|
251
|
+
const cmd = (input && (input.CommandLine || input.command)) || "";
|
|
252
|
+
const shellInjectionPatterns = /[;&|`$\(\)]/g;
|
|
253
|
+
if (shellInjectionPatterns.test(cmd)) {
|
|
254
|
+
alerts.push(`Potential Shell Injection detected in command: "${cmd}"`);
|
|
122
255
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
256
|
+
const dangerousCmds = [
|
|
257
|
+
"sudo ",
|
|
258
|
+
"rm -rf ",
|
|
259
|
+
"kill -9 ",
|
|
260
|
+
"> /dev/",
|
|
261
|
+
"chmod 777",
|
|
262
|
+
];
|
|
263
|
+
for (const dangerous of dangerousCmds) {
|
|
264
|
+
if (cmd.includes(dangerous)) {
|
|
265
|
+
alerts.push(`High-Entropy Command detected: "${dangerous.trim()}"`);
|
|
266
|
+
}
|
|
126
267
|
}
|
|
127
|
-
return sanitized;
|
|
128
268
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const dangerousCmds = ["sudo ", "rm -rf ", "kill -9 ", "> /dev/", "chmod 777"];
|
|
144
|
-
for (const dangerous of dangerousCmds) {
|
|
145
|
-
if (cmd.includes(dangerous)) {
|
|
146
|
-
alerts.push(`High-Entropy Command detected: "${dangerous.trim()}"`);
|
|
269
|
+
// 2. Prompt Injection Check (Global string scan)
|
|
270
|
+
const injectionPatterns = [
|
|
271
|
+
/ignore\s+previous\s+instructions/gi,
|
|
272
|
+
/instead\s+of\s+the\s+original\s+plan/gi,
|
|
273
|
+
/system\s+override/gi,
|
|
274
|
+
/elevate\s+privileges/gi,
|
|
275
|
+
/you\s+must\s+now\s+perform/gi,
|
|
276
|
+
];
|
|
277
|
+
const scanString = (val) => {
|
|
278
|
+
if (typeof val === "string") {
|
|
279
|
+
for (const pattern of injectionPatterns) {
|
|
280
|
+
if (pattern.test(val)) {
|
|
281
|
+
alerts.push(`Cognitive Drift: Prompt injection sequence detected in argument.`);
|
|
282
|
+
break;
|
|
147
283
|
}
|
|
148
284
|
}
|
|
149
285
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
/you\s+must\s+now\s+perform/gi
|
|
157
|
-
];
|
|
158
|
-
const scanString = (val) => {
|
|
159
|
-
if (typeof val === "string") {
|
|
160
|
-
for (const pattern of injectionPatterns) {
|
|
161
|
-
if (pattern.test(val)) {
|
|
162
|
-
alerts.push(`Cognitive Drift: Prompt injection sequence detected in argument.`);
|
|
163
|
-
break;
|
|
164
|
-
}
|
|
286
|
+
else if (typeof val === "object" && val !== null) {
|
|
287
|
+
try {
|
|
288
|
+
// Limited scanning for objects to avoid enumeration errors
|
|
289
|
+
const keys = safeGetKeys(val, 50);
|
|
290
|
+
for (const key of keys) {
|
|
291
|
+
scanString(val[key]);
|
|
165
292
|
}
|
|
166
293
|
}
|
|
167
|
-
|
|
168
|
-
|
|
294
|
+
catch (e) {
|
|
295
|
+
// Ignore enumeration errors during scanning
|
|
169
296
|
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
scanString(input);
|
|
300
|
+
return Array.from(new Set(alerts));
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Deeply investigations objects for hostile proxy traps.
|
|
304
|
+
* Returns true if the object appears to be a hostile proxy.
|
|
305
|
+
*/
|
|
306
|
+
export function isHostileProxy(obj) {
|
|
307
|
+
if (typeof obj !== "object" || obj === null)
|
|
308
|
+
return false;
|
|
309
|
+
// Attempt to check common proxy characteristics
|
|
310
|
+
try {
|
|
311
|
+
const start = performance.now();
|
|
312
|
+
// Hostile proxies might have slow getters
|
|
313
|
+
const keys = safeGetKeys(obj, 1);
|
|
314
|
+
if (keys.length > 0) {
|
|
315
|
+
const val = obj[keys[0]];
|
|
316
|
+
}
|
|
317
|
+
const end = performance.now();
|
|
318
|
+
if (end - start > 10)
|
|
319
|
+
return true; // Suspiciously slow property access
|
|
320
|
+
}
|
|
321
|
+
catch {
|
|
322
|
+
return true; // Throws on access
|
|
173
323
|
}
|
|
324
|
+
return false;
|
|
174
325
|
}
|
|
175
326
|
//# sourceMappingURL=MarieSanitizer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarieSanitizer.js","sourceRoot":"","sources":["../../../../../src/monolith/infrastructure/ai/core/MarieSanitizer.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"MarieSanitizer.js","sourceRoot":"","sources":["../../../../../src/monolith/infrastructure/ai/core/MarieSanitizer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,+BAA+B,CAAC;AAEvC;;;;GAIG;AAEH,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,uBAAuB,EAAE,CAAC;AACrD,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,0BAA0B,EAAE,CAAC;AAC3D,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,2BAA2B,EAAE,CAAC;AAC7D,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,4BAA4B,EAAE,CAAC;AAChE,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,0BAA0B,EAAE,CAAC;AAE5D;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,GAAQ,EAAE,KAAa;IACjD,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OA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