Files
ruflo/plugins/ruflo-plugin-creator/hooks/status.ts
T
ruv 53563c63ae feat(ruflo-plugin-creator): 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

10 lines
538 B
TypeScript

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