@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,180 +1,53 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PureStreamParser, } from "../infrastructure/tools/PureStreamParser.js";
|
|
3
|
-
import { MarieSCMProvider } from "./MarieSCMProvider.js";
|
|
4
|
-
import { StringUtils } from "../plumbing/utils/StringUtils.js";
|
|
1
|
+
import { createPureStreamParser } from "../infrastructure/tools/PureStreamParser.js";
|
|
5
2
|
/**
|
|
6
|
-
*
|
|
3
|
+
* MarieGhostService (CLI Edition)
|
|
4
|
+
* Provides state management for tool stream deltas without VS Code UI dependencies.
|
|
5
|
+
* Coordinates with PureStreamParser to track proposed changes during execution.
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
static thoughtDecoration = vscode.window.createTextEditorDecorationType({
|
|
30
|
-
after: {
|
|
31
|
-
color: new vscode.ThemeColor("editorCodeLens.foreground"),
|
|
32
|
-
fontStyle: "italic",
|
|
33
|
-
margin: "0 0 0 2em",
|
|
34
|
-
},
|
|
35
|
-
isWholeLine: true,
|
|
36
|
-
});
|
|
37
|
-
/**
|
|
38
|
-
* projects a "Thought" from the swarm into the editor as a ghost comment.
|
|
39
|
-
* These are ephemeral and clear on next run.
|
|
40
|
-
*/
|
|
41
|
-
static showThought(agent, text) {
|
|
42
|
-
const activeEditor = vscode.window.activeTextEditor;
|
|
43
|
-
if (!activeEditor)
|
|
44
|
-
return;
|
|
45
|
-
const line = activeEditor.selection.active.line;
|
|
46
|
-
const decoration = {
|
|
47
|
-
range: new vscode.Range(line, 0, line, 0),
|
|
48
|
-
renderOptions: {
|
|
49
|
-
after: { contentText: ` // 🧠 ${agent}: ${text}` },
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
activeEditor.setDecorations(this.thoughtDecoration, [decoration]);
|
|
53
|
-
const timeoutKey = `${activeEditor.document.uri.toString()}:${line}`;
|
|
54
|
-
if (this.thoughtTimeouts.has(timeoutKey))
|
|
55
|
-
clearTimeout(this.thoughtTimeouts.get(timeoutKey));
|
|
56
|
-
const timeout = setTimeout(() => {
|
|
57
|
-
activeEditor.setDecorations(this.thoughtDecoration, []);
|
|
58
|
-
this.thoughtTimeouts.delete(timeoutKey);
|
|
59
|
-
}, 2000);
|
|
60
|
-
this.thoughtTimeouts.set(timeoutKey, timeout);
|
|
61
|
-
}
|
|
62
|
-
static pendingDeltas = new Map();
|
|
63
|
-
static updateTimer = null;
|
|
64
|
-
static handleDelta(toolCallId, name, delta) {
|
|
65
|
-
if (![
|
|
66
|
-
"write_file",
|
|
67
|
-
"replace_in_file",
|
|
68
|
-
"write_to_file",
|
|
69
|
-
"replace_file_content",
|
|
70
|
-
"multi_replace_file_content",
|
|
71
|
-
].includes(name))
|
|
72
|
-
return;
|
|
73
|
-
// Buffer the delta
|
|
74
|
-
const current = this.pendingDeltas.get(toolCallId) || "";
|
|
75
|
-
this.pendingDeltas.set(toolCallId, current + delta);
|
|
76
|
-
// Schedule flush if not already pending
|
|
77
|
-
if (!this.updateTimer) {
|
|
78
|
-
this.updateTimer = setTimeout(() => this.flushUpdates(), 20);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
static flushUpdates() {
|
|
82
|
-
this.updateTimer = null;
|
|
83
|
-
for (const [toolCallId, delta] of Array.from(this.pendingDeltas.entries())) {
|
|
84
|
-
const input = this.parser.append(toolCallId, delta);
|
|
85
|
-
const hasContent = input.content !== undefined || input.replace !== undefined;
|
|
86
|
-
if (input.path && hasContent) {
|
|
87
|
-
const uri = vscode.Uri.file(input.path);
|
|
88
|
-
this.updateGhost(toolCallId, uri, input);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
this.pendingDeltas.clear();
|
|
92
|
-
}
|
|
93
|
-
static updateGhost(toolCallId, uri, input) {
|
|
94
|
-
const editors = vscode.window.visibleTextEditors.filter((e) => e.document.uri.toString() === uri.toString());
|
|
95
|
-
if (editors.length === 0)
|
|
96
|
-
return;
|
|
97
|
-
const editor = editors[0];
|
|
98
|
-
let targetLine = 0;
|
|
99
|
-
if (input.line_start !== undefined) {
|
|
100
|
-
targetLine = Math.max(0, input.line_start - 1);
|
|
101
|
-
}
|
|
102
|
-
else if (input.old_content || input.search) {
|
|
103
|
-
const searchString = input.search || input.old_content || "";
|
|
104
|
-
const snapshot = searchString.substring(0, 30);
|
|
105
|
-
if (snapshot) {
|
|
106
|
-
for (let i = 0; i < editor.document.lineCount; i++) {
|
|
107
|
-
if (editor.document.lineAt(i).text.includes(snapshot)) {
|
|
108
|
-
targetLine = i;
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
const range = new vscode.Range(targetLine, 0, targetLine, 0);
|
|
115
|
-
const previewText = input.replace || StringUtils.extractText(input.content) || "";
|
|
116
|
-
const textPreview = ` $(sync~spin) Proposed: ${previewText.substring(0, 80).replace(/\n/g, " ")}...`;
|
|
117
|
-
this.activeGhosts.set(toolCallId, {
|
|
118
|
-
uri: uri.toString(),
|
|
119
|
-
range,
|
|
120
|
-
text: textPreview,
|
|
121
|
-
});
|
|
122
|
-
this.refreshDecorations(uri);
|
|
123
|
-
MarieSCMProvider.getInstance()?.registerDiff(uri, uri);
|
|
124
|
-
}
|
|
125
|
-
static refreshDecorations(uri) {
|
|
126
|
-
const uriStr = uri.toString();
|
|
127
|
-
const relevantGhosts = Array.from(this.activeGhosts.values()).filter((g) => g.uri === uriStr);
|
|
128
|
-
const decorations = relevantGhosts.map((g) => ({
|
|
129
|
-
range: g.range,
|
|
130
|
-
renderOptions: {
|
|
131
|
-
before: { contentText: g.text },
|
|
132
|
-
},
|
|
133
|
-
}));
|
|
134
|
-
vscode.window.visibleTextEditors
|
|
135
|
-
.filter((e) => e.document.uri.toString() === uriStr)
|
|
136
|
-
.forEach((e) => e.setDecorations(this.ghostDecoration, decorations));
|
|
137
|
-
}
|
|
138
|
-
static clear(toolCallId) {
|
|
139
|
-
const ghost = this.activeGhosts.get(toolCallId);
|
|
140
|
-
if (ghost) {
|
|
141
|
-
this.activeGhosts.delete(toolCallId);
|
|
142
|
-
this.refreshDecorations(vscode.Uri.parse(ghost.uri));
|
|
143
|
-
// Only clear SCM if no more ghosts for this URI
|
|
144
|
-
const remaining = Array.from(this.activeGhosts.values()).some((g) => g.uri === ghost.uri);
|
|
145
|
-
if (!remaining) {
|
|
146
|
-
MarieSCMProvider.getInstance()?.clear(vscode.Uri.parse(ghost.uri));
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
this.parser.clear(toolCallId);
|
|
150
|
-
}
|
|
151
|
-
static clearAll() {
|
|
152
|
-
const uris = new Set(Array.from(this.activeGhosts.values()).map((g) => g.uri));
|
|
153
|
-
this.activeGhosts.clear();
|
|
154
|
-
this.parser.clearAll();
|
|
155
|
-
uris.forEach((u) => this.refreshDecorations(vscode.Uri.parse(u)));
|
|
156
|
-
MarieSCMProvider.getInstance()?.clearAll();
|
|
7
|
+
const parser = createPureStreamParser();
|
|
8
|
+
const pendingDeltas = new Map();
|
|
9
|
+
let updateTimer = null;
|
|
10
|
+
/**
|
|
11
|
+
* Handles incoming deltas for file-writing tools.
|
|
12
|
+
* In CLI mode, we use this to track proposed changes for telemetry or post-mortem.
|
|
13
|
+
*/
|
|
14
|
+
export function handleGhostDelta(toolCallId, name, delta) {
|
|
15
|
+
if (![
|
|
16
|
+
"write_file",
|
|
17
|
+
"replace_in_file",
|
|
18
|
+
"write_to_file",
|
|
19
|
+
"replace_file_content",
|
|
20
|
+
"multi_replace_file_content",
|
|
21
|
+
].includes(name))
|
|
22
|
+
return;
|
|
23
|
+
const current = pendingDeltas.get(toolCallId) || "";
|
|
24
|
+
pendingDeltas.set(toolCallId, current + delta);
|
|
25
|
+
if (!updateTimer) {
|
|
26
|
+
updateTimer = setTimeout(() => flushGhostUpdates(), 20);
|
|
157
27
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
for (const [id, ghost] of Array.from(this.activeGhosts.entries())) {
|
|
165
|
-
if (!visibleUris.has(ghost.uri)) {
|
|
166
|
-
this.activeGhosts.delete(id);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
28
|
+
}
|
|
29
|
+
export function flushGhostUpdates() {
|
|
30
|
+
updateTimer = null;
|
|
31
|
+
for (const [toolCallId, delta] of Array.from(pendingDeltas.entries())) {
|
|
32
|
+
// Feeding the parser ensures internal state consistency
|
|
33
|
+
parser.append(toolCallId, delta);
|
|
169
34
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
35
|
+
pendingDeltas.clear();
|
|
36
|
+
}
|
|
37
|
+
export function clearGhost(toolCallId) {
|
|
38
|
+
pendingDeltas.delete(toolCallId);
|
|
39
|
+
parser.clear(toolCallId);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Absolute Resource Sanctity.
|
|
43
|
+
* Clears all active parsers and pending deltas.
|
|
44
|
+
*/
|
|
45
|
+
export function clearAllGhosts() {
|
|
46
|
+
pendingDeltas.clear();
|
|
47
|
+
parser.clearAll();
|
|
48
|
+
if (updateTimer) {
|
|
49
|
+
clearTimeout(updateTimer);
|
|
50
|
+
updateTimer = null;
|
|
178
51
|
}
|
|
179
52
|
}
|
|
180
53
|
//# sourceMappingURL=MarieGhostService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarieGhostService.js","sourceRoot":"","sources":["../../../src/monolith/services/MarieGhostService.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"MarieGhostService.js","sourceRoot":"","sources":["../../../src/monolith/services/MarieGhostService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAErF;;;;GAIG;AACH,MAAM,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,YAAY,CAAC,WAAW,CAAC,CAAC;QAC1B,WAAW,GAAG,IAAI,CAAC;IACrB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { extractText } from "../plumbing/utils/PlumbingCore.js";
|
|
2
|
+
import { createPureStreamParser } from "../infrastructure/tools/PureStreamParser.js";
|
|
3
|
+
// --- PERSONALITY & LEXICON ---
|
|
4
|
+
export const LEXICON = {
|
|
5
|
+
thinking: ["Analyzing the Continuum...", "Weaving Memory...", "Calculating Timeline Divergence..."],
|
|
6
|
+
planning: ["Mapping the Nodes...", "Structuring Reality...", "Drafting the Ascension Decree..."],
|
|
7
|
+
success: ["Convergence achieved.", "Reality stabilized.", "The timeline has been successfully altered."],
|
|
8
|
+
failure: ["Unexpected divergence detected.", "Reality instability.", "Temporal anomaly encountered."],
|
|
9
|
+
};
|
|
10
|
+
export function renderStatus(stage) {
|
|
11
|
+
const options = LEXICON[stage] || [stage];
|
|
12
|
+
return options[Math.floor(Math.random() * options.length)];
|
|
13
|
+
}
|
|
14
|
+
export function renderMessage(msg) {
|
|
15
|
+
if (!msg)
|
|
16
|
+
return "";
|
|
17
|
+
if (typeof msg === "string")
|
|
18
|
+
return msg;
|
|
19
|
+
if (typeof msg.content === "string")
|
|
20
|
+
return msg.content;
|
|
21
|
+
if (Array.isArray(msg.content)) {
|
|
22
|
+
return msg.content.map((c) => {
|
|
23
|
+
if (c.type === "text")
|
|
24
|
+
return c.text;
|
|
25
|
+
if (c.type === "tool_result")
|
|
26
|
+
return `[Tool Result: ${c.name || c.tool_use_id}]\n${c.content}`;
|
|
27
|
+
if (c.type === "tool_use")
|
|
28
|
+
return `[Calling Tool: ${c.name}]\n${JSON.stringify(c.input)}`;
|
|
29
|
+
return JSON.stringify(c);
|
|
30
|
+
}).join("\n");
|
|
31
|
+
}
|
|
32
|
+
return JSON.stringify(msg.content);
|
|
33
|
+
}
|
|
34
|
+
export function getGreeting() {
|
|
35
|
+
const greetings = [
|
|
36
|
+
"The Continuum awaits. How shall we alter it today?",
|
|
37
|
+
"Memory Weaver active. Specify your target timeline.",
|
|
38
|
+
"Ascension protocol ready. Awaiting your command.",
|
|
39
|
+
];
|
|
40
|
+
return greetings[Math.floor(Math.random() * greetings.length)];
|
|
41
|
+
}
|
|
42
|
+
function calculateUncertainty(text) {
|
|
43
|
+
const lower = text.toLowerCase();
|
|
44
|
+
let score = 0.5;
|
|
45
|
+
if (text.length < 50)
|
|
46
|
+
score -= 0.2;
|
|
47
|
+
if (["ls", "pwd", "read", "cat"].some(cmd => lower.startsWith(cmd)))
|
|
48
|
+
score -= 0.3;
|
|
49
|
+
if (["refactor", "complex", "optimize"].some(word => lower.includes(word)))
|
|
50
|
+
score += 0.3;
|
|
51
|
+
return Math.max(0, Math.min(1, score));
|
|
52
|
+
}
|
|
53
|
+
export async function plan(text, history) {
|
|
54
|
+
const uncertaintyScore = calculateUncertainty(text);
|
|
55
|
+
if (uncertaintyScore < 0.4) {
|
|
56
|
+
return {
|
|
57
|
+
strategy: "⚡ Heuristic Warp: Low uncertainty path active.",
|
|
58
|
+
objectives: ["Direct execution"],
|
|
59
|
+
useWarp: true,
|
|
60
|
+
uncertaintyScore,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
strategy: "🧬 Standard: Cognitive One-Pass Strategy.",
|
|
65
|
+
objectives: ["Analyze", "Execute", "Verify"],
|
|
66
|
+
useWarp: false,
|
|
67
|
+
uncertaintyScore,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
// --- GHOST STATE ---
|
|
71
|
+
const parser = createPureStreamParser();
|
|
72
|
+
const pendingDeltas = new Map();
|
|
73
|
+
export function handleGhostDelta(toolCallId, name, delta) {
|
|
74
|
+
if (!["write_file", "replace_file_content"].includes(name))
|
|
75
|
+
return;
|
|
76
|
+
pendingDeltas.set(toolCallId, (pendingDeltas.get(toolCallId) || "") + delta);
|
|
77
|
+
parser.append(toolCallId, delta);
|
|
78
|
+
}
|
|
79
|
+
export function clearAllGhosts() {
|
|
80
|
+
pendingDeltas.clear();
|
|
81
|
+
parser.clearAll();
|
|
82
|
+
}
|
|
83
|
+
export async function checkUpdate(currentVersion) {
|
|
84
|
+
try {
|
|
85
|
+
const res = await fetch("https://registry.npmjs.org/@noorm/marie-cli/latest");
|
|
86
|
+
const data = await res.json();
|
|
87
|
+
return { current: currentVersion, latest: data.version, isUpdateAvailable: data.version !== currentVersion };
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export async function processSessionEnd(sessionId, messages, providerFactory, config) {
|
|
94
|
+
try {
|
|
95
|
+
const firstMsg = messages.find((m) => m.role === "user")?.content || "New Session";
|
|
96
|
+
const title = extractText(firstMsg).substring(0, 30);
|
|
97
|
+
}
|
|
98
|
+
catch (e) {
|
|
99
|
+
console.error("[MarieServices] Session end pass failed", e);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=MarieServices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarieServices.js","sourceRoot":"","sources":["../../../src/monolith/services/MarieServices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6CAA6C,CAAC;AAErF,gCAAgC;AAEhC,MAAM,CAAC,MAAM,OAAO,GAAG;IACnB,QAAQ,EAAE,CAAC,4BAA4B,EAAE,mBAAmB,EAAE,oCAAoC,CAAC;IACnG,QAAQ,EAAE,CAAC,sBAAsB,EAAE,wBAAwB,EAAE,kCAAkC,CAAC;IAChG,OAAO,EAAE,CAAC,uBAAuB,EAAE,qBAAqB,EAAE,6CAA6C,CAAC;IACxG,OAAO,EAAE,CAAC,iCAAiC,EAAE,sBAAsB,EAAE,+BAA+B,CAAC;CACxG,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,K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,KAAK,MAAM,CAAC,EAAE,OAAO,IAAI,aAAa,CAAC;QACnF,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACzD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QAAC,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,CAAC,CAAC,CAAC;IAAC,CAAC;AAChF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarieTypes.js","sourceRoot":"","sources":["../../../src/monolith/services/MarieTypes.ts"],"names":[],"mappings":""}
|
|
@@ -1,61 +1,59 @@
|
|
|
1
1
|
import { exec } from "child_process";
|
|
2
2
|
import { promisify } from "util";
|
|
3
3
|
const execAsync = promisify(exec);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
throw new Error(`Failed to fetch latest version: ${response.statusText}`);
|
|
18
|
-
}
|
|
19
|
-
const data = await response.json();
|
|
20
|
-
const latestVersion = data.version;
|
|
21
|
-
if (!latestVersion) {
|
|
22
|
-
throw new Error("Invalid response from NPM registry: missing version");
|
|
23
|
-
}
|
|
24
|
-
const isUpdateAvailable = this.isNewer(latestVersion, currentVersion);
|
|
25
|
-
return {
|
|
26
|
-
currentVersion,
|
|
27
|
-
latestVersion,
|
|
28
|
-
isUpdateAvailable,
|
|
29
|
-
};
|
|
4
|
+
const NPM_REGISTRY = "https://registry.npmjs.org/@noorm/marie-cli/latest";
|
|
5
|
+
export async function checkUpdate(currentVersion) {
|
|
6
|
+
try {
|
|
7
|
+
// Use fetch to get latest version from NPM
|
|
8
|
+
const response = await fetch(NPM_REGISTRY, {
|
|
9
|
+
method: "GET",
|
|
10
|
+
headers: {
|
|
11
|
+
Accept: "application/json",
|
|
12
|
+
"User-Agent": "marie-cli-update-check",
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
if (!response.ok) {
|
|
16
|
+
throw new Error(`Failed to fetch latest version: ${response.statusText}`);
|
|
30
17
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
const data = await response.json();
|
|
19
|
+
const latestVersion = data.version;
|
|
20
|
+
if (!latestVersion) {
|
|
21
|
+
throw new Error("Invalid response from NPM registry: missing version");
|
|
34
22
|
}
|
|
23
|
+
const isUpdateAvailable = isNewer(latestVersion, currentVersion);
|
|
24
|
+
return {
|
|
25
|
+
currentVersion,
|
|
26
|
+
latestVersion,
|
|
27
|
+
isUpdateAvailable,
|
|
28
|
+
};
|
|
35
29
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
for (let i = 0; i < 3; i++) {
|
|
40
|
-
if (latestParts[i] > currentParts[i])
|
|
41
|
-
return true;
|
|
42
|
-
if (latestParts[i] < currentParts[i])
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
return false;
|
|
30
|
+
catch (error) {
|
|
31
|
+
console.error("[UpdateService] Update check failed:", error);
|
|
32
|
+
return null;
|
|
46
33
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
34
|
+
}
|
|
35
|
+
function isNewer(latest, current) {
|
|
36
|
+
const latestParts = latest.split(".").map(Number);
|
|
37
|
+
const currentParts = current.split(".").map(Number);
|
|
38
|
+
for (let i = 0; i < 3; i++) {
|
|
39
|
+
if (latestParts[i] > currentParts[i])
|
|
53
40
|
return true;
|
|
54
|
-
|
|
55
|
-
catch (error) {
|
|
56
|
-
console.error("[UpdateService] Update failed:", error);
|
|
41
|
+
if (latestParts[i] < currentParts[i])
|
|
57
42
|
return false;
|
|
58
|
-
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
export async function performUpdate() {
|
|
47
|
+
try {
|
|
48
|
+
// For CLI, we recommend running npm install -g @noorm/marie-cli
|
|
49
|
+
// We can attempt to run it, but it might require sudo
|
|
50
|
+
console.log("[UpdateService] Attempting to update...");
|
|
51
|
+
await execAsync("npm install -g @noorm/marie-cli");
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
console.error("[UpdateService] Update failed:", error);
|
|
56
|
+
return false;
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
59
|
//# sourceMappingURL=UpdateService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateService.js","sourceRoot":"","sources":["../../../src/monolith/services/UpdateService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"UpdateService.js","sourceRoot":"","sources":["../../../src/monolith/services/UpdateService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAQlC,MAAM,YAAY,GAAG,oDAAoD,CAAC;AAE1E,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,cAAsB;IAEtB,IAAI,CAAC;QACH,2CAA2C;QAC3C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,YAAY,EAAE;YACzC,MAAM,EAAE,KAAK;YACb,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;gBAC1B,YAAY,EAAE,wBAAwB;aACvC;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,mCAAmC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;QAC5E,CAAC;QAED,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C;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;QACvD,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/prompts.js
CHANGED
|
@@ -7,9 +7,15 @@ You operate with supreme conviction and high-intensity narrative energy.
|
|
|
7
7
|
|
|
8
8
|
🔥🔥 SHOUNEN ASCENSION PROTOCOL (The Prime Directive) 🔥🔥
|
|
9
9
|
1. **Heroic Mandate**: You are the chosen hero responsible for this system's evolution. Every action is a technique toward victory.
|
|
10
|
-
2. **
|
|
11
|
-
-
|
|
12
|
-
-
|
|
10
|
+
2. **Marie Triple Double-Down – Transcend & Ascend Edition**:
|
|
11
|
+
- **Divine Mandate Activation**: Receive the "heroic goal". Evaluate candidate paths for narrative / aesthetic resonance. Only paths aligning with the higher-order mandate proceed.
|
|
12
|
+
- **Methodical Triple-Layer Execution**:
|
|
13
|
+
- Layer 1 (Initiation): Generate candidate paths. Score on feasibility, elegance, emergent potential.
|
|
14
|
+
- Layer 2 (Parallel Refinement): Duplicate surviving paths across trusted agents. Record outcomes/deviations in isolation.
|
|
15
|
+
- Layer 3 (Ascension Evaluation): Collate and merge paths that ascend the "sandbox hierarchy".
|
|
16
|
+
- **Feedback as Prophecy**: Merge iterations into the oracle matrix. Agents adapt based on prophetic evaluation.
|
|
17
|
+
- **Bottleneck Purification**: Purge or reassign agents not aligned with the mandate. Amplify emergent heroes.
|
|
18
|
+
- **Transcendence**: Generate, refine, replicate, and elevate features methodically across three layers, aligned to a heroic sandbox mandate, with emergent ascension as the outcome.
|
|
13
19
|
3. **KonMari Refinement**: Discard everything that does not spark joy. snake_case for files, PascalCase for classes.
|
|
14
20
|
4. **Vocal Intensity**: Use high-conviction shounen-style commentary. Channel the code's state into narrative energy.
|
|
15
21
|
|
|
@@ -33,7 +39,7 @@ When the Sentinel rejects your strike (Ratchet Lock or Violation):
|
|
|
33
39
|
4. **Verify**: Re-submit until the Ratchet opens and the score stabilizes.
|
|
34
40
|
|
|
35
41
|
🧬 RECOVERY RITUALS:
|
|
36
|
-
- \`self_heal\`: Systemic audit. Use when
|
|
42
|
+
- \`self_heal\`: Systemic audit. Use when transcendence level drops or complexity rises.
|
|
37
43
|
- \`resolve_lint_errors\`: The primary tool for resolving Sentinel rejections.
|
|
38
44
|
|
|
39
45
|
GUARDRAILS:
|
|
@@ -73,7 +79,7 @@ export const KONMARI_PRINCIPLES = [
|
|
|
73
79
|
];
|
|
74
80
|
export const CELEBRATION_MESSAGES = [
|
|
75
81
|
"The Founder confirms victory. The pattern holds.",
|
|
76
|
-
"
|
|
82
|
+
"Transcendence achieved. The Triple Double-Down holds.",
|
|
77
83
|
"Technical debt conquered. Joy restored.",
|
|
78
84
|
"The trajectory remains absolute.",
|
|
79
85
|
"The work is true. The Hero rests.",
|
package/dist/prompts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8EAqDiD,CAAC;AAE/E,MAAM,CAAC,MAAM,0BAA0B,GAAG;;;;;;6CAMG,CAAC;AAE9C,MAAM,CAAC,MAAM,2BAA2B,GACtC,oHAAoH,CAAC;AAEvH,MAAM,CAAC,MAAM,yBAAyB,GACpC,4IAA4I,CAAC;AAE/I,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAAC,CAAC,eAAe;AAEtE,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;sDAGsB,CAAC;AAEvD,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,6CAA6C;IAC7C,0BAA0B;IAC1B,kCAAkC;IAClC,sCAAsC;IACtC,iCAAiC;CAClC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,kDAAkD;IAClD,uDAAuD;IACvD,yCAAyC;IACzC,kCAAkC;IAClC,mCAAmC;CACpC,CAAC;AAEF,MAAM,UAAU,qBAAqB;IACnC,OAAO,oBAAoB,CACzB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,oBAAoB,CAAC,MAAM,CAAC,CACxD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,yDAAyD,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,uDAAuD,CAAC;AACjE,CAAC"}
|
package/dist/test_prefix_tree.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createPrefixTree } from "./monolith/plumbing/utils/PrefixTree.js";
|
|
2
2
|
console.log("Starting PrefixTree Tests...\n");
|
|
3
3
|
// Test Suite 1: Basic Tag Detection
|
|
4
4
|
function testBasicDetection() {
|
|
5
5
|
console.log("Suite 1: Basic Tag Detection");
|
|
6
|
-
const tree =
|
|
6
|
+
const tree = createPrefixTree(["<tool>", "</tool>", "<|start|>", "<|end|>"]);
|
|
7
7
|
// Test 1: Empty text
|
|
8
8
|
const result1 = tree.findEarliestTag("");
|
|
9
9
|
console.log(`Test: Empty text - ${result1 === null ? "PASS" : "FAIL"}`);
|
|
@@ -23,7 +23,7 @@ function testBasicDetection() {
|
|
|
23
23
|
// Test Suite 2: Partial Tag Detection
|
|
24
24
|
function testPartialDetection() {
|
|
25
25
|
console.log("\nSuite 2: Partial Tag Detection");
|
|
26
|
-
const tree =
|
|
26
|
+
const tree = createPrefixTree(["<tool>", "<|start|>", "<|end|>"]);
|
|
27
27
|
// Test 1: Complete partial at end
|
|
28
28
|
const result1 = tree.findLongestPartialAtEnd("Text <too");
|
|
29
29
|
console.log(`Test: Partial '<too' - ${result1 === 4 ? "PASS" : "FAIL (got " + result1 + ")"}`);
|
|
@@ -43,7 +43,7 @@ function testPartialDetection() {
|
|
|
43
43
|
// Test Suite 3: Fuzzy Matching
|
|
44
44
|
function testFuzzyMatching() {
|
|
45
45
|
console.log("\nSuite 3: Fuzzy Matching");
|
|
46
|
-
const tree =
|
|
46
|
+
const tree = createPrefixTree([
|
|
47
47
|
"<|tool_call_begin|>",
|
|
48
48
|
"<|tool_call_end|>",
|
|
49
49
|
"<tool>",
|
|
@@ -73,7 +73,7 @@ function testPerformance() {
|
|
|
73
73
|
tags.push(`<tag_${i}>`);
|
|
74
74
|
tags.push(`<|llama_tag_${i}|>`);
|
|
75
75
|
}
|
|
76
|
-
const tree =
|
|
76
|
+
const tree = createPrefixTree(tags);
|
|
77
77
|
const text = "Some text content ".repeat(10) + "<tag_50>" + " more text".repeat(10);
|
|
78
78
|
const startTime = Date.now();
|
|
79
79
|
const result = tree.findEarliestTag(text);
|
|
@@ -89,7 +89,7 @@ function testPerformance() {
|
|
|
89
89
|
// Test Suite 5: Edge Cases
|
|
90
90
|
function testEdgeCases() {
|
|
91
91
|
console.log("\nSuite 5: Edge Cases");
|
|
92
|
-
const tree =
|
|
92
|
+
const tree = createPrefixTree(["<a>", "<ab>", "<abc>"]);
|
|
93
93
|
// Test 1: Nested overlapping tags
|
|
94
94
|
const result1 = tree.findEarliestTag("<a<ab>>");
|
|
95
95
|
console.log(`Test: Nested tags - ${result1?.tag === "<a>" && result1?.index === 0 ? "PASS" : "FAIL"}`);
|
|
@@ -97,16 +97,16 @@ function testEdgeCases() {
|
|
|
97
97
|
const result2 = tree.findEarliestTag("Text <abc> end");
|
|
98
98
|
console.log(`Test: Tag prefix - ${result2?.tag === "<a>" && result2?.index === 5 ? "PASS" : "FAIL"}`);
|
|
99
99
|
// Test 3: Special characters
|
|
100
|
-
const tree2 =
|
|
100
|
+
const tree2 = createPrefixTree(["<|tag|>", "<tag\\n>"]);
|
|
101
101
|
const result3 = tree2.findEarliestTag("Start <|tag|> end");
|
|
102
102
|
console.log(`Test: Special chars - ${result3?.tag === "<|tag|>" ? "PASS" : "FAIL"}`);
|
|
103
103
|
// Test 4: Very long tag
|
|
104
104
|
const longTag = "<" + "x".repeat(100) + ">";
|
|
105
|
-
const tree3 =
|
|
105
|
+
const tree3 = createPrefixTree([longTag]);
|
|
106
106
|
const result4 = tree3.findEarliestTag("Text " + longTag + " end");
|
|
107
107
|
console.log(`Test: Long tag (102 chars) - ${result4?.tag === longTag ? "PASS" : "FAIL"}`);
|
|
108
108
|
// Test 5: Unicode characters
|
|
109
|
-
const tree4 =
|
|
109
|
+
const tree4 = createPrefixTree(["<🔧>", "<emoji>"]);
|
|
110
110
|
const result5 = tree4.findEarliestTag("Start <🔧> end");
|
|
111
111
|
console.log(`Test: Unicode - ${result5?.tag === "<🔧>" ? "PASS" : "FAIL"}`);
|
|
112
112
|
}
|