// Paths and constants. import { homedir } from "node:os"; import { join } from "node:path"; export const MEMORY_DIR = join(homedir(), ".pi", "agent", "memory"); export const DB_PATH = join(MEMORY_DIR, "pi-mem-cc.db"); // Tool output field truncation (chars). Mirrors claude-mem's 16k head/tail. export const MAX_FIELD_CHARS = 16_000; export const HEAD_RATIO = 0.6; export const TAIL_RATIO = 0.3; // Search defaults. export const DEFAULT_SEARCH_LIMIT = 10; export const DEFAULT_TIMELINE_WINDOW_MS = 30 * 60_000; // 30 min // Skip these noisy tool calls entirely — don't even send to observer. export const SKIP_TOOLS = new Set([ // Empty status / health checks. // (Add more as needed.) ]); // Skip these tool calls based on argument shape (return true to skip). export function shouldSkipByArgs(toolName: string, input: unknown): boolean { if (SKIP_TOOLS.has(toolName)) return true; // Skip ls with no follow-up potential (very narrow filter; pi's tools are mostly useful). if (toolName === "bash") { const cmd = (input as { command?: string })?.command ?? ""; if (/^(ls|pwd|whoami|date|echo)\b/.test(cmd.trim())) return true; } return false; }