Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .Jules/palette.md

This file was deleted.

7 changes: 0 additions & 7 deletions pr_body.txt

This file was deleted.

29 changes: 19 additions & 10 deletions src/ledgermind/vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@ export function activate(context: vscode.ExtensionContext) {
setError(false); // Clear error state when logs are opened
}));

let hasShownMissingCliToast = false;
const handleCliError = (err: any, contextStr: string) => {
if (err.code === 'ENOENT') {
outputChannel.appendLine(`LedgerMind ${contextStr} Error: ledgermind-mcp CLI not found.`);
if (!hasShownMissingCliToast) {
vscode.window.showErrorMessage("LedgerMind CLI not found. Please install it using 'pip install ledgermind'");
hasShownMissingCliToast = true;
}
} else {
outputChannel.appendLine(`LedgerMind ${contextStr} Error: ${err.message}`);
}
setError(true);
};

// ==========================================
// DUAL-HOOK MECHANISM (Cache + onDidReceiveChatResponse)
// ==========================================
Expand Down Expand Up @@ -105,8 +119,7 @@ export function activate(context: vscode.ExtensionContext) {
], (err) => {
setBusy(false);
if (err) {
outputChannel.appendLine(`LedgerMind Record Error: ${err.message}`);
setError(true);
handleCliError(err, 'Record');
} else {
outputChannel.appendLine(`βœ“ Recorded previous interaction: "${interaction.prompt.substring(0, 50)}..."`);
}
Expand All @@ -130,8 +143,7 @@ export function activate(context: vscode.ExtensionContext) {
], (err, stdout) => {
setBusy(false);
if (err) {
outputChannel.appendLine(`LedgerMind Context Sync Error: ${err.message}`);
setError(true);
handleCliError(err, 'Context Sync');
} else if (stdout) {
const content = `<!-- LEDGERMIND AUTONOMOUS CONTEXT - DO NOT EDIT -->
<!-- Updated: ${new Date().toISOString()} -->
Expand Down Expand Up @@ -279,8 +291,7 @@ ${stdout}`;
], (err) => {
setBusy(false);
if (err) {
outputChannel.appendLine(`LedgerMind RooCode Record Error: ${err.message}`);
setError(true);
handleCliError(err, 'RooCode Record');
} else {
outputChannel.appendLine(`βœ“ Recorded RooCode/Cline interaction via file watcher`);
}
Expand Down Expand Up @@ -332,8 +343,7 @@ ${stdout}`;
], (err) => {
setBusy(false);
if (err) {
outputChannel.appendLine(`LedgerMind Terminal Record Error: ${err.message}`);
setError(true);
handleCliError(err, 'Terminal Record');
}
});
}
Expand Down Expand Up @@ -366,8 +376,7 @@ ${stdout}`;
], (err) => {
setBusy(false);
if (err) {
outputChannel.appendLine(`LedgerMind File Record Error: ${err.message}`);
setError(true);
handleCliError(err, 'File Record');
}
});
})
Expand Down