{"record":{"id":"bd399fc3893beaca","repo":"paperclipai/paperclip","slug":"template-path-must-be-one-of-template-files-join","errorCode":null,"errorMessage":"template path must be one of ${TEMPLATE_FILES.join(\", \")}","messagePattern":"template path must be one of (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/plugin-llm-wiki/src/wiki/core.ts","lineNumber":4449,"sourceCode":"  );\n  const row = meta[0] ?? null;\n  return {\n    wikiId,\n    spaceSlug: space.slug,\n    path,\n    contents,\n    title: row?.title ?? inferTitle(path, contents),\n    pageType: row?.page_type ?? inferPageType(path),\n    backlinks: Array.isArray(row?.backlinks) ? row?.backlinks : [],\n    sourceRefs: Array.isArray(row?.source_refs) ? row?.source_refs : [],\n    updatedAt: row?.updated_at ?? null,\n    hash: contentHash(contents),\n  };\n}\n\nexport async function readTemplate(ctx: PluginContext, input: { companyId: string; path: string }) {\n  if (!isTemplateFile(input.path)) {\n    throw new Error(`template path must be one of ${TEMPLATE_FILES.join(\", \")}`);\n  }\n  try {\n    const contents = await ctx.localFolders.readText(input.companyId, WIKI_ROOT_FOLDER_KEY, input.path);\n    return { path: input.path, contents, hash: contentHash(contents), exists: true };\n  } catch (error) {\n    return { path: input.path, contents: \"\", hash: null, exists: false, error: error instanceof Error ? error.message : String(error) };\n  }\n}\n\nexport async function writeTemplate(ctx: PluginContext, input: { companyId: string; path: string; contents: string }) {\n  if (!isTemplateFile(input.path)) {\n    throw new Error(`template path must be one of ${TEMPLATE_FILES.join(\", \")}`);\n  }\n  await ctx.localFolders.writeTextAtomic(input.companyId, WIKI_ROOT_FOLDER_KEY, input.path, input.contents);\n  return { status: \"ok\", path: input.path, hash: contentHash(input.contents) };\n}\n\nexport type DistillationCursorRow = {","sourceCodeStart":4431,"sourceCodeEnd":4467,"githubUrl":"https://github.com/paperclipai/paperclip/blob/5716fe907e596ce73501408fc6efdb19fb61edf2/packages/plugins/plugin-llm-wiki/src/wiki/core.ts#L4431-L4467","documentation":"Error \"template path must be one of ${TEMPLATE_FILES.join(\", \")}\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/plugins/plugin-llm-wiki/src/wiki/core.ts:4451 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the listed template file paths."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5716fe907e596ce73501408fc6efdb19fb61edf2","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}