@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,151 +1,162 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ConfigService } from "../../config/ConfigService.js";
|
|
1
|
+
import { getModel, getMaxContextTokens, getKeepRecentMessages, getTokensPerChar, } from "../../config/ConfigService.js";
|
|
3
2
|
import { SUMMARIZATION_SYSTEM_PROMPT, SUMMARIZATION_USER_PROMPT, } from "../../../../prompts.js";
|
|
4
3
|
import { getErrorMessage } from "../../../plumbing/utils/ErrorUtils.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
4
|
+
import { extractText } from "../../../plumbing/utils/StringUtils.js";
|
|
5
|
+
import { safeSpread, safeGetKeys, safeGetEntries, } from "../core/MarieSanitizer.js";
|
|
6
|
+
function estimateTokens(text, tokensPerChar) {
|
|
7
|
+
return Math.ceil(text.length * tokensPerChar);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Recursively estimates tokens in an object without JSON.stringify serialization.
|
|
11
|
+
* Prevents massive GC spikes for large objects (e.g. file content).
|
|
12
|
+
*/
|
|
13
|
+
function estimateObjectTokens(obj, tokensPerChar, depth = 0) {
|
|
14
|
+
if (!obj || depth > 10)
|
|
15
|
+
return 0;
|
|
16
|
+
if (typeof obj === "string")
|
|
17
|
+
return estimateTokens(obj, tokensPerChar);
|
|
18
|
+
if (typeof obj === "number" || typeof obj === "boolean")
|
|
19
|
+
return 1;
|
|
20
|
+
let total = 0;
|
|
21
|
+
try {
|
|
22
22
|
if (Array.isArray(obj)) {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
// Limit array breadth for estimation
|
|
24
|
+
const limitedArr = obj.slice(0, 100);
|
|
25
|
+
for (const item of limitedArr) {
|
|
26
|
+
total += estimateObjectTokens(item, tokensPerChar, depth + 1);
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
else if (typeof obj === "object") {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
const safeObj = safeSpread(obj);
|
|
31
|
+
// Use safeGetKeys to avoid engine-level enumeration explosion
|
|
32
|
+
const keys = safeGetKeys(safeObj, 100);
|
|
33
|
+
for (const key of keys) {
|
|
34
|
+
total += estimateTokens(key, tokensPerChar); // Key tokens
|
|
35
|
+
total += estimateObjectTokens(safeObj[key], tokensPerChar, depth + 1); // Value tokens
|
|
31
36
|
}
|
|
32
37
|
}
|
|
33
|
-
return total;
|
|
34
38
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return this.estimateTokens(message.content, tokensPerChar);
|
|
38
|
-
}
|
|
39
|
-
else if (Array.isArray(message.content)) {
|
|
40
|
-
return message.content.reduce((acc, block) => {
|
|
41
|
-
if (block.type === "text") {
|
|
42
|
-
return acc + this.estimateTokens(block.text, tokensPerChar);
|
|
43
|
-
}
|
|
44
|
-
if (block.type === "tool_use") {
|
|
45
|
-
return acc + this.estimateObjectTokens(block.input, tokensPerChar, 0);
|
|
46
|
-
}
|
|
47
|
-
if (block.type === "tool_result") {
|
|
48
|
-
// optimized: avoid JSON.stringify if content is string
|
|
49
|
-
if (typeof block.content === "string") {
|
|
50
|
-
return acc + this.estimateTokens(block.content, tokensPerChar);
|
|
51
|
-
}
|
|
52
|
-
return (acc + this.estimateObjectTokens(block.content, tokensPerChar, 0));
|
|
53
|
-
}
|
|
54
|
-
return acc;
|
|
55
|
-
}, 0);
|
|
56
|
-
}
|
|
57
|
-
return 0;
|
|
39
|
+
catch (e) {
|
|
40
|
+
// Ignore enumeration errors during estimation
|
|
58
41
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const tokensPerChar = ConfigService.getTokensPerChar(); // Hoisted config access
|
|
65
|
-
const currentTokens = this.getTotalTokens(messages, tokensPerChar);
|
|
66
|
-
// PROACTIVE PRUNING: Summarize at 90% capacity to ensure zero 400 errors
|
|
67
|
-
if (currentTokens >= maxTokens * 0.9) {
|
|
68
|
-
messages = await this.summarizeHistory(messages, provider, state, tokensPerChar, currentTokens);
|
|
69
|
-
}
|
|
70
|
-
// SPECTRAL MEMORY INJECTION: Retrieve relevant long-term memories
|
|
71
|
-
return await this.injectSpectralMemories(messages, provider);
|
|
42
|
+
return total;
|
|
43
|
+
}
|
|
44
|
+
function getMessageTokens(message, tokensPerChar) {
|
|
45
|
+
if (typeof message.content === "string") {
|
|
46
|
+
return estimateTokens(message.content, tokensPerChar);
|
|
72
47
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return messages;
|
|
78
|
-
const { NoormmeEngine } = await import("../../persistence/NoormmeEngine.js");
|
|
79
|
-
const db = await NoormmeEngine.getInstance();
|
|
80
|
-
if (!db.agent.cortex.vectors)
|
|
81
|
-
return messages;
|
|
82
|
-
const embedding = await provider.createEmbedding(lastUserMsg.content);
|
|
83
|
-
const memories = await db.agent.cortex.vectors.search(embedding, { limit: 3 });
|
|
84
|
-
if (memories.length > 0) {
|
|
85
|
-
const memoryContext = memories
|
|
86
|
-
.map((m) => `- ${m.content} (Similarity: ${(m.similarity * 100).toFixed(1)}%)`)
|
|
87
|
-
.join("\n");
|
|
88
|
-
const injectedMessages = [...messages];
|
|
89
|
-
injectedMessages.splice(messages.length - 1, 0, {
|
|
90
|
-
role: "user",
|
|
91
|
-
content: `[SPECTRAL MEMORIES - STRATEGIC CONTEXT]\n${memoryContext}\n\n(Use these memories to inform your response if relevant. Do not mention "Spectral Memories" to the user unless they ask.)`,
|
|
92
|
-
virtual: true
|
|
93
|
-
});
|
|
94
|
-
return injectedMessages;
|
|
48
|
+
else if (Array.isArray(message.content)) {
|
|
49
|
+
return message.content.reduce((acc, block) => {
|
|
50
|
+
if (block.type === "text") {
|
|
51
|
+
return acc + estimateTokens(block.text, tokensPerChar);
|
|
95
52
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
53
|
+
if (block.type === "tool_use") {
|
|
54
|
+
return acc + estimateObjectTokens(block.input, tokensPerChar, 0);
|
|
55
|
+
}
|
|
56
|
+
if (block.type === "tool_result") {
|
|
57
|
+
// optimized: avoid JSON.stringify if content is string
|
|
58
|
+
if (typeof block.content === "string") {
|
|
59
|
+
return acc + estimateTokens(block.content, tokensPerChar);
|
|
60
|
+
}
|
|
61
|
+
return acc + estimateObjectTokens(block.content, tokensPerChar, 0);
|
|
62
|
+
}
|
|
63
|
+
return acc;
|
|
64
|
+
}, 0);
|
|
65
|
+
}
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
function getTotalTokens(messages, tokensPerChar) {
|
|
69
|
+
return messages.reduce((acc, msg) => acc + getMessageTokens(msg, tokensPerChar), 0);
|
|
70
|
+
}
|
|
71
|
+
export async function manageContext(messages, provider, state) {
|
|
72
|
+
const maxTokens = getMaxContextTokens();
|
|
73
|
+
const tokensPerChar = getTokensPerChar(); // Hoisted config access
|
|
74
|
+
const currentTokens = getTotalTokens(messages, tokensPerChar);
|
|
75
|
+
// PROACTIVE PRUNING: Summarize at 90% capacity to ensure zero 400 errors
|
|
76
|
+
if (currentTokens >= maxTokens * 0.9) {
|
|
77
|
+
messages = await summarizeHistory(messages, provider, state, tokensPerChar, currentTokens);
|
|
101
78
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
79
|
+
// SPECTRAL MEMORY INJECTION: Retrieve relevant long-term memories
|
|
80
|
+
return await injectSpectralMemories(messages, provider);
|
|
81
|
+
}
|
|
82
|
+
async function injectSpectralMemories(messages, provider) {
|
|
83
|
+
try {
|
|
84
|
+
const lastUserMsg = messages
|
|
85
|
+
.slice()
|
|
86
|
+
.reverse()
|
|
87
|
+
.find((m) => m.role === "user" && typeof m.content === "string");
|
|
88
|
+
if (!lastUserMsg)
|
|
106
89
|
return messages;
|
|
107
|
-
}
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
})
|
|
118
|
-
|
|
90
|
+
const { getInstance } = await import("../../persistence/NoormmeEngine.js");
|
|
91
|
+
const db = await getInstance();
|
|
92
|
+
if (!db.agent.cortex.vectors)
|
|
93
|
+
return messages;
|
|
94
|
+
const embedding = await provider.createEmbedding(lastUserMsg.content);
|
|
95
|
+
const memories = await db.agent.cortex.vectors.search(embedding, {
|
|
96
|
+
limit: 3,
|
|
97
|
+
});
|
|
98
|
+
if (memories.length > 0) {
|
|
99
|
+
const memoryContext = memories
|
|
100
|
+
.map((m) => `- ${m.content} (Similarity: ${(m.similarity * 100).toFixed(1)}%)`)
|
|
101
|
+
.join("\n");
|
|
102
|
+
const injectedMessages = [...messages];
|
|
103
|
+
injectedMessages.splice(messages.length - 1, 0, {
|
|
104
|
+
role: "user",
|
|
105
|
+
content: `[SPECTRAL MEMORIES - STRATEGIC CONTEXT]\n${memoryContext}\n\n(Use these memories to inform your response if relevant. Do not mention "Spectral Memories" to the user unless they ask.)`,
|
|
106
|
+
virtual: true,
|
|
119
107
|
});
|
|
120
|
-
|
|
121
|
-
"Summary unavailable.";
|
|
122
|
-
// Ascension Preservation: Prepend state snapshot to the summary so it survives compression
|
|
123
|
-
let ascensionNote = "";
|
|
124
|
-
if (state) {
|
|
125
|
-
const hotspots = Object.entries(state.errorHotspots)
|
|
126
|
-
.filter(([_, c]) => c >= 2)
|
|
127
|
-
.map(([f, c]) => `${f}(${c}x)`)
|
|
128
|
-
.join(", ");
|
|
129
|
-
const strategy = state.lastDecree?.strategy || "EXECUTE";
|
|
130
|
-
const strategyReason = state.lastDecree?.reason || "None";
|
|
131
|
-
ascensionNote = `[ASCENSION STATE] Strategy: ${strategy}, Mood: ${state.mood}, Spirit Pressure (Flow): ${state.spiritPressure}/100, Victory Streak: ${state.victoryStreak}${hotspots ? `, Hotspots: ${hotspots}` : ""}, Last Intent: ${strategyReason}\n\n`;
|
|
132
|
-
}
|
|
133
|
-
const newHistory = [
|
|
134
|
-
{
|
|
135
|
-
role: "user",
|
|
136
|
-
content: `[System Note: Previous conversation summary]\n${ascensionNote}${summaryText}`,
|
|
137
|
-
},
|
|
138
|
-
...recentMessages,
|
|
139
|
-
];
|
|
140
|
-
vscode.window.showInformationMessage(`Marie finished tidying. Tokens reduced from ${currentTokens} to ${this.getTotalTokens(newHistory, tokensPerChar)}.`);
|
|
141
|
-
return newHistory;
|
|
108
|
+
return injectedMessages;
|
|
142
109
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
110
|
+
}
|
|
111
|
+
catch (e) {
|
|
112
|
+
console.warn("[ContextManager] Failed to inject spectral memories", e);
|
|
113
|
+
}
|
|
114
|
+
return messages;
|
|
115
|
+
}
|
|
116
|
+
async function summarizeHistory(messages, provider, state, tokensPerChar, currentTokens) {
|
|
117
|
+
console.log(`[Marie] Tidying up conversation history (${currentTokens} tokens)...`);
|
|
118
|
+
const keepRecent = getKeepRecentMessages();
|
|
119
|
+
if (messages.length <= keepRecent) {
|
|
120
|
+
return messages;
|
|
121
|
+
}
|
|
122
|
+
const olderMessages = messages.slice(0, messages.length - keepRecent);
|
|
123
|
+
const recentMessages = messages.slice(messages.length - keepRecent);
|
|
124
|
+
try {
|
|
125
|
+
const summaryResponse = await provider.createMessage({
|
|
126
|
+
model: getModel(),
|
|
127
|
+
max_tokens: 1024,
|
|
128
|
+
messages: olderMessages.concat({
|
|
129
|
+
role: "user",
|
|
130
|
+
content: SUMMARIZATION_USER_PROMPT,
|
|
131
|
+
}),
|
|
132
|
+
system: SUMMARIZATION_SYSTEM_PROMPT,
|
|
133
|
+
});
|
|
134
|
+
const summaryText = extractText(summaryResponse.content) || "Summary unavailable.";
|
|
135
|
+
// Ascension Preservation: Prepend state snapshot to the summary so it survives compression
|
|
136
|
+
let ascensionNote = "";
|
|
137
|
+
if (state) {
|
|
138
|
+
const hotspots = safeGetEntries(safeSpread(state.errorHotspots), 20)
|
|
139
|
+
.filter(([_, c]) => c >= 2)
|
|
140
|
+
.map(([f, c]) => `${f}(${c}x)`)
|
|
141
|
+
.join(", ");
|
|
142
|
+
const strategy = state.lastDecree?.strategy || "EXECUTE";
|
|
143
|
+
const strategyReason = state.lastDecree?.reason || "None";
|
|
144
|
+
ascensionNote = `[ASCENSION STATE] Strategy: ${strategy}, Mood: ${state.mood}, Transcendence Level: ${state.spiritPressure}/100, Victory Streak: ${state.victoryStreak}${hotspots ? `, Hotspots: ${hotspots}` : ""}, Last Intent: ${strategyReason}\n\n`;
|
|
148
145
|
}
|
|
146
|
+
const newHistory = [
|
|
147
|
+
{
|
|
148
|
+
role: "user",
|
|
149
|
+
content: `[System Note: Previous conversation summary]\n${ascensionNote}${summaryText}`,
|
|
150
|
+
},
|
|
151
|
+
...recentMessages,
|
|
152
|
+
];
|
|
153
|
+
console.log(`[Marie] Finished tidying. Tokens reduced from ${currentTokens} to ${getTotalTokens(newHistory, tokensPerChar)}.`);
|
|
154
|
+
return newHistory;
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
const message = getErrorMessage(error);
|
|
158
|
+
console.error("[Marie] Context summarization failed:", message);
|
|
159
|
+
return messages;
|
|
149
160
|
}
|
|
150
161
|
}
|
|
151
162
|
//# sourceMappingURL=ContextManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextManager.js","sourceRoot":"","sources":["../../../../../src/monolith/infrastructure/ai/context/ContextManager.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ContextManager.js","sourceRoot":"","sources":["../../../../../src/monolith/infrastructure/ai/context/ContextManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAA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