mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-23 21:59:14 +09:00
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>
16 lines
868 B
TypeScript
16 lines
868 B
TypeScript
import type { PluginOptions } from 'claude-code'
|
|
|
|
/** The plugin's `userConfig`, validated: a bad value is the default (guard on, graph deletes confirmed). */
|
|
export type ModOptions = { readonly guard: boolean; readonly confirmDeletes: boolean; readonly extra: Readonly<Record<string, unknown>> }
|
|
|
|
// 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 {
|
|
const o = options ?? {}
|
|
const confirmDeletes = flag(o.confirmDeletes, true)
|
|
return { guard: flag(o.guard, true), confirmDeletes, extra: { confirmDeletes } }
|
|
}
|