Files
Claude-Code-Workflow/ccw/src/core/hooks/index.ts
catlog22 46d4b4edfd Add comprehensive tests for keyword detection, session state management, and user abort detection
- Implement tests for KeywordDetector including keyword detection, sanitization, and priority handling.
- Add tests for SessionStateService covering session validation, loading, saving, and state updates.
- Create tests for UserAbortDetector to validate user abort detection logic and pattern matching.
2026-02-18 21:48:56 +08:00

61 lines
1.2 KiB
TypeScript

/**
* Core Hooks Module
*
* Provides detector functions and utilities for Claude Code hooks integration.
*/
// Context Limit Detector
export {
isContextLimitStop,
getMatchingContextPattern,
getAllMatchingContextPatterns,
CONTEXT_LIMIT_PATTERNS,
type StopContext
} from './context-limit-detector.js';
// User Abort Detector
export {
isUserAbort,
getMatchingAbortPattern,
getAllMatchingAbortPatterns,
shouldAllowContinuation,
USER_ABORT_EXACT_PATTERNS,
USER_ABORT_SUBSTRING_PATTERNS,
USER_ABORT_PATTERNS
} from './user-abort-detector.js';
// Keyword Detector
export {
detectKeywords,
hasKeyword,
getAllKeywords,
getPrimaryKeyword,
getKeywordType,
hasKeywordType,
sanitizeText,
removeCodeBlocks,
KEYWORD_PATTERNS,
KEYWORD_PRIORITY,
type KeywordType,
type DetectedKeyword
} from './keyword-detector.js';
// Stop Handler
export {
StopHandler,
createStopHandler,
defaultStopHandler,
type ExtendedStopContext,
type StopResult,
type StopHandlerOptions
} from './stop-handler.js';
// Recovery Handler
export {
RecoveryHandler,
createRecoveryHandler,
type PreCompactInput,
type HookOutput,
type RecoveryHandlerOptions
} from './recovery-handler.js';