mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-28 09:23:08 +08:00
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.
This commit is contained in:
60
ccw/src/core/hooks/index.ts
Normal file
60
ccw/src/core/hooks/index.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* 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';
|
||||
Reference in New Issue
Block a user