UNPKG

@stackmemoryai/stackmemory

Version:

Lossless, project-scoped memory for AI coding tools. Durable context across sessions with 56 MCP tools, FTS5 search, conductor orchestrator, loop/watch monitoring, snapshot capture, pre-flight overlap checks, Claude/Codex/OpenCode wrappers, Linear sync, a

25 lines (24 loc) 748 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 };