mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-12-05 06:56:22 +09:00
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>
13 lines
617 B
TypeScript
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`
|