/** Input from Claude Code PreToolUse/PostToolUse hooks (JSON on stdin) */ export interface HookInput { session_id: string; transcript_path?: string; cwd: string; permission_mode?: string; hook_event_name: string; tool_name?: string; tool_input?: Record; tool_response?: Record; tool_use_id?: string; } /** Output for PreToolUse hooks */ export interface PreToolUseOutput { hookSpecificOutput: { hookEventName: 'PreToolUse'; permissionDecision?: 'allow' | 'deny' | 'ask'; permissionDecisionReason?: string; additionalContext?: string; updatedInput?: Record; }; } /** Output for PostToolUse hooks */ export interface PostToolUseOutput { decision?: 'block'; reason?: string; hookSpecificOutput?: { hookEventName: 'PostToolUse'; additionalContext?: string; }; } /** Output for Stop hooks */ export interface StopOutput { decision?: 'block'; reason?: string; } /** A guard's response — what guidance to inject */ export interface GuardResult { /** Text injected into the agent's context */ context?: string; /** For PreToolUse: permission decision */ decision?: 'allow' | 'deny' | 'ask'; /** For Stop/PostToolUse: block reason */ blockReason?: string; } /** Known guard names */ export type GuardName = 'explore' | 'hazard' | 'commit-nudge' | 'scope-drift' | 'compaction' | 'stop-check' | 'subagent-gate' | 'push-nudge' | 'workflow-gate' | 'review-tier' | 'version-check'; /** Guard registration entry */ export interface GuardDefinition { name: GuardName; description: string; /** Which hook event this guard fires on */ hookEvent: 'PreToolUse' | 'PostToolUse' | 'Stop' | 'PreCompact'; /** Regex matcher for tool name (PreToolUse/PostToolUse only) */ matcher?: string; /** Which --level installs this guard */ level: 'scoring' | 'full'; } /** Guidance configuration fields for .slope/config.json */ export interface GuidanceConfig { /** Disabled guard names */ disabled?: string[]; /** File paths to check for codebase index (explore guard) */ indexPaths?: string[]; /** Number of sprints to look back for hazards (default 5) */ hazardRecency?: number; /** Minutes before commit nudge fires (default 15) */ commitInterval?: number; /** Minutes before push nudge fires (default 30) */ pushInterval?: number; /** Enable scope drift detection (default true) */ scopeDrift?: boolean; /** Max turns for Explore subagents (default 10) */ subagentExploreTurns?: number; /** Max turns for Plan subagents (default 15) */ subagentPlanTurns?: number; /** Models allowed for Explore/Plan subagents (default ['haiku']) */ subagentAllowModels?: string[]; /** Unpushed commit count before push nudge fires (default 5) */ pushCommitThreshold?: number; /** Directory for compaction handoff files (default '.slope/handoffs') */ handoffsDir?: string; } /** All guard definitions */ export declare const GUARD_DEFINITIONS: GuardDefinition[]; /** A custom guard defined by a plugin (not constrained to GuardName union) */ export interface CustomGuardDefinition { name: string; description: string; hookEvent: 'PreToolUse' | 'PostToolUse' | 'Stop' | 'PreCompact'; matcher?: string; level: 'scoring' | 'full'; command: string; } /** Union type for functions that accept both built-in and custom guards */ export type AnyGuardDefinition = GuardDefinition | CustomGuardDefinition; /** Register a custom guard plugin. Idempotent — skips if name already registered. */ export declare function registerCustomGuard(guard: CustomGuardDefinition): void; /** Returns all guard definitions: built-in + custom */ export declare function getAllGuardDefinitions(): AnyGuardDefinition[]; /** Look up a custom guard by name */ export declare function getCustomGuard(name: string): CustomGuardDefinition | undefined; /** Clear all custom guards (for testing) */ export declare function clearCustomGuards(): void; /** Format a GuardResult as PreToolUse JSON output */ export declare function formatPreToolUseOutput(result: GuardResult): PreToolUseOutput; /** Format a GuardResult as PostToolUse JSON output */ export declare function formatPostToolUseOutput(result: GuardResult): PostToolUseOutput; /** Format a GuardResult as Stop JSON output */ export declare function formatStopOutput(result: GuardResult): StopOutput; /** * Generate Claude Code settings.json hooks configuration for installed guards. * Returns the `hooks` object to merge into .claude/settings.json. */ export declare function generateClaudeCodeHooksConfig(guards: AnyGuardDefinition[], guardScriptPath: string): Record; }>>; //# sourceMappingURL=guard.d.ts.map