UNPKG

@stackmemoryai/stackmemory

Version:

Project-scoped memory for AI coding tools. Durable context across sessions with MCP integration, frames, smart retrieval, Claude Code skills, and automatic hooks.

26 lines (25 loc) 782 B
import { fileURLToPath as __fileURLToPath } from 'url'; import { dirname as __pathDirname } from 'path'; const __filename = __fileURLToPath(import.meta.url); const __dirname = __pathDirname(__filename); function deriveProjectId(repoPath) { const id = repoPath.replace(/\/+$/, "").split("/").pop() || "project"; return id.toLowerCase().replace(/[^a-z0-9-]/g, "-").slice(-50) || "project"; } function compactPlan(plan) { try { const steps = Array.isArray(plan?.steps) ? plan.steps.map((s) => ({ id: s.id, title: s.title, acceptanceCriteria: s.acceptanceCriteria })) : []; return { summary: plan?.summary, steps, risks: plan?.risks }; } catch { return plan; } } export { compactPlan, deriveProjectId }; //# sourceMappingURL=utils.js.map