refactor: fix security hardcode, dead code, resource leaks, operator bugs

This commit is contained in:
2026-05-06 12:31:58 +09:00
parent 0c9def0241
commit 17e6503ccd
8 changed files with 134 additions and 59 deletions
+9 -6
View File
@@ -85,7 +85,9 @@ export async function activate(context: vscode.ExtensionContext) {
}
}
export function deactivate() {}
export function deactivate() {
HealthCheckMonitor.dispose();
}
async function runInitialSetup(context: vscode.ExtensionContext) {
try {
@@ -138,7 +140,9 @@ async function _ensureBrainDir(context: vscode.ExtensionContext): Promise<string
if (!fs.existsSync(dir)) {
try {
fs.mkdirSync(dir, { recursive: true });
} catch (e) {}
} catch (e) {
logError('Failed to create brain directory.', e);
}
}
return dir;
}
@@ -149,11 +153,10 @@ async function _ensureBrainDir(context: vscode.ExtensionContext): Promise<string
fs.mkdirSync(defaultDir, { recursive: true });
// Create a welcome file
fs.writeFileSync(path.join(defaultDir, 'Welcome.md'), "# Welcome to your Second Brain\n\nAstra will store and retrieve knowledge from here.");
} catch (e) {}
} catch (e) {
logError('Failed to initialize default brain directory.', e);
}
}
return defaultDir;
}
/**
* Astra Extension Entry Point
*/