From 33fa225f6592c19275f1d5e485df41f40acfd69c Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Fri, 19 Jun 2026 15:04:14 +0800 Subject: [PATCH] refactor(memory): drop unused host helpers --- .../src/host/query-expansion.ts | 31 ------------------- .../memory-host-sdk/src/host/status-format.ts | 8 ----- 2 files changed, 39 deletions(-) diff --git a/packages/memory-host-sdk/src/host/query-expansion.ts b/packages/memory-host-sdk/src/host/query-expansion.ts index 378bf156347..60855052f0e 100644 --- a/packages/memory-host-sdk/src/host/query-expansion.ts +++ b/packages/memory-host-sdk/src/host/query-expansion.ts @@ -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; - -/** - * 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 { - // 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); -} diff --git a/packages/memory-host-sdk/src/host/status-format.ts b/packages/memory-host-sdk/src/host/status-format.ts index 9defb056643..0477a4ebaad 100644 --- a/packages/memory-host-sdk/src/host/status-format.ts +++ b/packages/memory-host-sdk/src/host/status-format.ts @@ -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" }; -}