refactor(memory): drop unused host helpers

This commit is contained in:
Vincent Koc
2026-06-19 15:04:14 +08:00
parent 86a28636fa
commit 33fa225f65
2 changed files with 0 additions and 39 deletions

View File

@@ -799,34 +799,3 @@ export function expandQueryForFts(
return { original, keywords, expanded };
}
/**
* Type for an optional LLM-based query expander.
* Can be provided to enhance keyword extraction with semantic understanding.
*/
export type LlmQueryExpander = (query: string) => Promise<string[]>;
/**
* Expand query with optional LLM assistance.
* Falls back to local extraction if LLM is unavailable or fails.
*/
export async function expandQueryWithLlm(
query: string,
llmExpander?: LlmQueryExpander,
opts?: { ftsTokenizer?: "unicode61" | "trigram" },
): Promise<string[]> {
// If LLM expander is provided, try it first
if (llmExpander) {
try {
const llmKeywords = await llmExpander(query);
if (llmKeywords.length > 0) {
return llmKeywords;
}
} catch {
// LLM failed, fall back to local extraction
}
}
// Fall back to local keyword extraction
return extractKeywords(query, opts);
}

View File

@@ -42,11 +42,3 @@ export function resolveMemoryCacheSummary(cache: { enabled: boolean; entries?: n
const suffix = typeof cache.entries === "number" ? ` (${cache.entries})` : "";
return { tone: "ok", text: `cache on${suffix}` };
}
/** Resolve cache enabled state without count text. */
export function resolveMemoryCacheState(cache: { enabled: boolean }): {
tone: Tone;
state: "enabled" | "disabled";
} {
return cache.enabled ? { tone: "ok", state: "enabled" } : { tone: "muted", state: "disabled" };
}