mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-23 21:59:14 +09:00
Tighten-only guards on each plugin's own tools (secrets; dossier ID numbers; intelligence reset confirm + public-transfer email screen; destructive cognitum-iot confirm), /<short>-mod local commands, status files, tests and smoke steps. Minor version bumps. Co-Authored-By: RuFlo <ruv@ruv.net>
17 lines
677 B
TypeScript
17 lines
677 B
TypeScript
/** Counters the mod keeps for the session and writes to `.claude-flow/intelligence-mod/status.json` for the console. */
|
|
export type Stats = {
|
|
blocked: number
|
|
scans: number
|
|
commands: number
|
|
lastDenied?: string
|
|
}
|
|
|
|
export const newStats = (): Stats => ({ blocked: 0, scans: 0, commands: 0 })
|
|
|
|
export const STATUS_PATH = '.claude-flow/intelligence-mod/status.json'
|
|
|
|
/** The file's text: mode flags plus the counters; `version` lets the console refuse a shape it does not know. */
|
|
export function statusText(stats: Stats, mode: Record<string, boolean>, nowMs: number): string {
|
|
return `${JSON.stringify({ version: 1, updatedMs: nowMs, ...mode, ...stats }, null, 2)}\n`
|
|
}
|