MCPcopy Create free account
hub / github.com/backnotprop/plannotator / readArchivedPlan

Function readArchivedPlan

packages/shared/storage.ts:184–194  ·  view source on GitHub ↗
(filename: string, customPath?: string | null)

Source from the content-addressed store, hash-verified

182 * Returns null if the file doesn't exist or on read error.
183 */
184export function readArchivedPlan(filename: string, customPath?: string | null): string | null {
185 const planDir = getPlanDir(customPath);
186 const filePath = resolve(planDir, filename);
187 // Guard against path traversal (resolve + trailing separator, matching reference-handlers.ts)
188 if (!filePath.startsWith(planDir + sep)) return null;
189 try {
190 return readFileSync(filePath, "utf-8");
191 } catch {
192 return null;
193 }
194}
195
196// --- Version History ---
197

Callers 3

startPlannotatorServerFunction · 0.90
fetchFunction · 0.90
startPlanReviewServerFunction · 0.85

Calls 2

getPlanDirFunction · 0.85
resolveFunction · 0.70

Tested by

no test coverage detected