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

26 lines (25 loc) 851 B
import { fileURLToPath as __fileURLToPath } from 'url'; import { dirname as __pathDirname } from 'path'; const __filename = __fileURLToPath(import.meta.url); const __dirname = __pathDirname(__filename); import { create } from "zustand"; const useTaskStore = create((set, get) => ({ tasks: [], setTasks: (tasks) => set({ tasks }), addTask: (task) => set((state) => ({ tasks: [...state.tasks, task] })), updateTask: (id, updates) => set((state) => ({ tasks: state.tasks.map( (task) => task.id === id ? { ...task, ...updates } : task ) })), removeTask: (id) => set((state) => ({ tasks: state.tasks.filter((task) => task.id !== id) })), getTaskById: (id) => get().tasks.find((task) => task.id === id), getTasksByState: (state) => get().tasks.filter((task) => task.state === state) })); export { useTaskStore };