Files
ruflo/plugins/ruflo-ruvector/hooks/status.ts
T
ruv 343215a5d8 feat(ruflo-ruvector): function-hook mod (ADR-445)
Local /<short>-mod command, status file, tighten-only secret guard where the plugin has write tools, tests, smoke steps M1-M3, README section.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-04 15:35:35 -04:00

13 lines
617 B
TypeScript

import type { ModOptions } from './options'
/** Counters the mod keeps for the session and writes to `.claude-flow/ruvector-mod/status.json`. */
export type Stats = { seen: number; blocked: number; lastBlocked?: string }
export const newStats = (): Stats => ({ seen: 0, blocked: 0 })
export const STATUS_PATH = '.claude-flow/ruvector-mod/status.json'
/** The file's text; `version` lets a reader refuse a shape it does not know. */
export const statusText = (stats: Stats, opts: ModOptions, nowMs: number): string =>
`${JSON.stringify({ version: 1, updatedMs: nowMs, guard: opts.guard, ...stats }, null, 2)}\n`