/** * Helpers Generator * Creates utility scripts in .claude/helpers/ */ import type { InitOptions } from './types.js'; export declare const ATTRIBUTION_FOOTER = "\uD83E\uDD16 Generated with [RuFlo](https://github.com/ruvnet/ruflo)"; /** * Detect whether a Claude Code PostToolUse payload represents a FAILED tool run. * * Why this matters: the learning substrate had 898 feedback records, 100% * success, 0 failures — because the post-edit/post-task hooks recorded a * hardcoded `success:true` and never inspected the tool outcome. With no * negative examples, the oracle tier can't teach good-vs-bad (see the DB * analysis + ADR-174). Claude Code passes the tool result in the PostToolUse * hook payload (`tool_response`), which for a failed Write/Edit/Bash carries an * error marker. This predicate is the single source of truth the generated * hook inlines, and is unit-tested here so the detection stays honest. * * Conservative: returns true only on a POSITIVE error signal; ambiguous/missing * payloads default to success (matches prior behavior, avoids false failures). */ export declare function isToolFailure(hookInput: unknown): boolean; /** * Generate pre-commit hook script */ export declare function generatePreCommitHook(): string; /** * Generate post-commit hook script */ export declare function generatePostCommitHook(): string; /** * Generate session manager script */ export declare function generateSessionManager(): string; /** * Generate agent router script */ export declare function generateAgentRouter(): string; /** * Generate memory helper script */ export declare function generateMemoryHelper(): string; /** * Generate hook-handler.cjs (cross-platform hook dispatcher) * This is the inline fallback when file copy from the package fails. * Uses string concatenation instead of template literals to avoid escaping issues. */ export declare function generateHookHandler(): string; /** * Generate a minimal intelligence.cjs stub for fallback installs. * Provides the same API as the full intelligence.cjs but with simplified logic. * Gets overwritten when source copy succeeds (full version has PageRank, Jaccard, etc.) */ export declare function generateIntelligenceStub(): string; /** * Generate a minimal auto-memory-hook.mjs fallback for fresh installs. * This ESM script handles import/sync/status commands gracefully when * @claude-flow/memory is not installed. Gets overwritten when source copy succeeds. */ export declare function generateAutoMemoryHook(): string; /** * Generate Windows PowerShell daemon manager */ export declare function generateWindowsDaemonManager(): string; /** * Generate Windows batch file wrapper */ export declare function generateWindowsBatchWrapper(): string; /** * Generate cross-platform session manager */ export declare function generateCrossPlatformSessionManager(): string; /** * Generate all helper files */ export declare function generateHelpers(options: InitOptions): Record; /** * Generate cross-platform Node.js port of ruflo-hook.sh (#2132). * * The bash shim works on Mac/Linux but fails on native Windows (exit 126). * This .cjs version is always deployed to .claude/helpers/ so: * - Windows: settings.json overrides plugin bash hooks with node-based cmds * - Mac/Linux: plugin hooks.json still uses .sh (faster, battle-tested) * - Both: .claude/helpers/ruflo-hook.cjs available as a canonical cross-platform shim */ export declare function generateRufloHookCjs(): string; //# sourceMappingURL=helpers-generator.d.ts.map