Files
ruflo/plugins/ruflo-workflows/hooks/options.ts
T
ruv 21adb5ce28 feat(mods): vendor the flag option parser from one origin with the screen sync and drift check (review #2)
Extend scripts/sync-mod-screen.mjs to a second kit: the flag() helper in hooks/options.ts of 38 mods now sits between SHARED FLAG markers and is
rewritten/checked from ruflo-agentdb. Drift, a lost marker or zero copies fails --check. Bump the 39 touched plugin versions and their version pins.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-04 23:46:06 -04:00

14 lines
649 B
TypeScript

import type { PluginOptions } from 'claude-code'
/** The plugin's `userConfig`, validated: a bad value is the default (guard on). */
export type ModOptions = { readonly guard: boolean }
// BEGIN SHARED FLAG (generated by scripts/sync-mod-screen.mjs; edit plugins/ruflo-agentdb/hooks/options.ts)
export const flag = (value: unknown, fallback: boolean) =>
value === true || value === 'true' || value === 'on' ? true : value === false || value === 'false' || value === 'off' ? false : fallback
// END SHARED FLAG
export function readOptions(options: PluginOptions | undefined): ModOptions {
return { guard: flag((options ?? {}).guard, true) }
}