Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

1.0 KB
Raw Blame
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
  readonly managedWorkflows: boolean
  readonly maxBudgetCents: number
  readonly allowInlineAgents: 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 {
  const o = options ?? {}
  return {
    guard: flag(o.guard, true),
    managedWorkflows: flag(o.managedWorkflows, false),
    maxBudgetCents: typeof o.maxBudgetCents === 'string' && /^[1-9][0-9]{0,8}$/.test(o.maxBudgetCents) ? Number(o.maxBudgetCents) : o.maxBudgetCents === undefined ? 2500 : 0,
    allowInlineAgents: flag(o.allowInlineAgents, false),
  }
}