@sema-agent/core
Version:
Stateless, task-oriented AI agent core
13 lines (12 loc) • 847 B
TypeScript
/**
* Render a memory entry's age as a natural-language phrase (CC-parity P0-1). CC's eval found
* models reason about memory age much better from natural language ("3 days ago") than from a boolean
* "older note" flag (verify-claims 0/2 → 3/3 once the age was spelled out), because the model can weigh
* staleness proportionally instead of as a single cliff. This is the relative phrase only; it is additional
* signal beside the entry, not a verdict on it.
*
* Buckets (each chooses the coarsest unit that's ≥1): `today` (<1 day, incl. future mtime / clock skew →
* clamped to today, never a negative age), `yesterday` (1–2 days), `N days ago` (2–7 days),
* `N weeks ago` (1 week – ~1 month), `N months ago` (≥ ~1 month). N is floored to the whole unit.
*/
export declare function formatMemoryAge(ageMs: number): string;