MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / recentPaths

Function recentPaths

graph-ui/src/agents/agent-store.ts:371–392  ·  view source on GitHub ↗
(
    actor: ActorState,
    now: number,
    windowMs: number,
    limit = 6,
)

Source from the content-addressed store, hash-verified

369 * nicht darin.
370 */
371export function recentPaths(
372 actor: ActorState,
373 now: number,
374 windowMs: number,
375 limit = 6,
376): string[] {
377 const out: string[] = [];
378 for (let i = actor.events.length - 1; i >= 0; i -= 1) {
379 const event = actor.events[i] as AgentEvent;
380 if (windowMs > 0 && now - event.ts > windowMs) {
381 break;
382 }
383 if (event.path.length === 0 || out.includes(event.path)) {
384 continue;
385 }
386 out.push(event.path);
387 if (out.length >= limit) {
388 break;
389 }
390 }
391 return out;
392}

Callers 2

viewOfFunction · 0.90

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected