Skip to content

LLM Wiki is a cross-platform desktop application that turns your documents into an organized, interlinked knowledge base — automatically. Instead of traditional RAG (retrieve-and-answer from scratch every time), the LLM incrementally builds and maintains a persistent wiki from your sources。

TypeScript

fix: include source dotfolders in raw source lookups

nash_sua126829886b5
diff --git a/src/lib/chat-agent.ts b/src/lib/chat-agent.ts
index ad951558..1f7ac78e 100644
--- a/src/lib/chat-agent.ts
+++ b/src/lib/chat-agent.ts
@@ -898,7 +898,7 @@ async function runProjectFilesTool(args: {
const maxEntries = args.llmConfig.maxContextSize > 180_000 ? 160 : 80
const [wikiTree, rawTree] = await Promise.all([
listDirectory(`${args.projectPath}/wiki`).catch(() => [] as FileNode[]),
- listDirectory(`${args.projectPath}/raw/sources`).catch(() => [] as FileNode[]),
+ listDirectory(`${args.projectPath}/raw/sources`, true).catch(() => [] as FileNode[]),
])
const wikiEntries = flattenFileTree(wikiTree, "wiki").slice(0, maxEntries)
const rawEntries = flattenFileTree(rawTree, "raw/sources").slice(0, Math.floor(maxEntries / 2))
diff --git a/src/lib/raw-source-resolver.test.ts b/src/lib/raw-source-resolver.test.ts
index d4c40d4b..0fbfad04 100644
--- a/src/lib/raw-source-resolver.test.ts
+++ b/src/lib/raw-source-resolver.test.ts
@@ -40,6 +40,17 @@ describe("raw source image resolver", () => {
).resolves.toBe(`${tmp.path}/raw/sources/project-a/config.pdf`)
})
+ it("resolves media slugs for sources inside raw dotfolders", async () => {
+ if (!tmp) throw new Error("missing temp project")
+
+ await writeFileRaw(`${tmp.path}/raw/sources/.claude/research.md`, "dotfolder source\n")
+ const slug = sourceSummarySlugFromIdentity(".claude/research.md")
+
+ await expect(
+ findRawSourceForImage(`media/${slug}/img-1.png`, tmp.path),
+ ).resolves.toBe(`${tmp.path}/raw/sources/.claude/research.md`)
+ })
+
it("resolves nested source media slugs created with legacy percent-encoded source slugs", async () => {
if (!tmp) throw new Error("missing temp project")
diff --git a/src/lib/raw-source-resolver.ts b/src/lib/raw-source-resolver.ts
index 33765ca1..f6b010a1 100644
--- a/src/lib/raw-source-resolver.ts
+++ b/src/lib/raw-source-resolver.ts
@@ -41,7 +41,7 @@ export async function findRawSourceForImage(
let tree: FileNode[]
try {
- tree = await listDirectory(`${normalizedProjectPath}/raw/sources`)
+ tree = await listDirectory(`${normalizedProjectPath}/raw/sources`, true)
} catch {
return null
}