fix(FN-000): simplify qmd memory settings
This commit is contained in:
@@ -22,6 +22,8 @@ vi.mock("@fusion/core", () => ({
|
||||
registerProject: mockRegisterProject,
|
||||
updateProject: mockUpdateProject,
|
||||
})),
|
||||
isQmdAvailable: vi.fn(() => Promise.resolve(true)),
|
||||
QMD_INSTALL_COMMAND: "bun add -g qmd",
|
||||
resolveGlobalDir: vi.fn(),
|
||||
}));
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import { homedir } from "node:os";
|
||||
import { exec } from "node:child_process";
|
||||
import { promisify } from "node:util";
|
||||
const execAsync = promisify(exec);
|
||||
import { CentralCore } from "@fusion/core";
|
||||
import { CentralCore, QMD_INSTALL_COMMAND, isQmdAvailable } from "@fusion/core";
|
||||
import { resolveGlobalDir } from "@fusion/core";
|
||||
|
||||
/** Options for the init command */
|
||||
@@ -77,6 +77,7 @@ export async function runInit(options: InitOptions = {}): Promise<void> {
|
||||
|
||||
// Add local Fusion/Pi storage directories to .gitignore
|
||||
await addLocalStorageToGitignore(cwd);
|
||||
await warnIfQmdMissing();
|
||||
|
||||
// Create fusion.db (empty SQLite file)
|
||||
if (!existsSync(dbPath)) {
|
||||
@@ -197,3 +198,13 @@ async function addLocalStorageToGitignore(cwd: string): Promise<void> {
|
||||
console.log(` ⚠ Could not update .gitignore (best-effort)`);
|
||||
}
|
||||
}
|
||||
|
||||
async function warnIfQmdMissing(): Promise<void> {
|
||||
if (await isQmdAvailable()) {
|
||||
console.log(` ✓ qmd available for memory search`);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(` ⚠ qmd not found; memory search will use local file fallback`);
|
||||
console.log(` Install qmd for indexed retrieval: ${QMD_INSTALL_COMMAND}`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user