paperclipai/paperclip · error
template path must be one of
Error message
template path must be one of ${TEMPLATE_FILES.join(", ")} What it means
Error "template path must be one of ${TEMPLATE_FILES.join(", ")}" thrown in paperclipai/paperclip.
Solutions
- Use one of the listed template file paths.
When it happens
Trigger: Thrown at packages/plugins/plugin-llm-wiki/src/wiki/core.ts:4451 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@5716fe907e (2026-08-18).
Data as JSON: /api/errors/bd399fc3893beaca.
Report an issue: GitHub.
Appendix: source
Thrown at packages/plugins/plugin-llm-wiki/src/wiki/core.ts:4449
);
const row = meta[0] ?? null;
return {
wikiId,
spaceSlug: space.slug,
path,
contents,
title: row?.title ?? inferTitle(path, contents),
pageType: row?.page_type ?? inferPageType(path),
backlinks: Array.isArray(row?.backlinks) ? row?.backlinks : [],
sourceRefs: Array.isArray(row?.source_refs) ? row?.source_refs : [],
updatedAt: row?.updated_at ?? null,
hash: contentHash(contents),
};
}
export async function readTemplate(ctx: PluginContext, input: { companyId: string; path: string }) {
if (!isTemplateFile(input.path)) {
throw new Error(`template path must be one of ${TEMPLATE_FILES.join(", ")}`);
}
try {
const contents = await ctx.localFolders.readText(input.companyId, WIKI_ROOT_FOLDER_KEY, input.path);
return { path: input.path, contents, hash: contentHash(contents), exists: true };
} catch (error) {
return { path: input.path, contents: "", hash: null, exists: false, error: error instanceof Error ? error.message : String(error) };
}
}
export async function writeTemplate(ctx: PluginContext, input: { companyId: string; path: string; contents: string }) {
if (!isTemplateFile(input.path)) {
throw new Error(`template path must be one of ${TEMPLATE_FILES.join(", ")}`);
}
await ctx.localFolders.writeTextAtomic(input.companyId, WIKI_ROOT_FOLDER_KEY, input.path, input.contents);
return { status: "ok", path: input.path, hash: contentHash(input.contents) };
}
export type DistillationCursorRow = {View on GitHub (pinned to 5716fe907e)