BuiltInLifecycleHooks class

Pre-configured lifecycle hooks that implement common operational concerns.

Each method returns a typed lifecycle callback set that can be registered with a LifecycleManager.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

auditLog({required void log(String entry)}) ConversationLifecycle
Audit log lifecycle hooks.
costTracking({required void onCostUpdate(int totalInputTokens, int totalOutputTokens, double estimatedCost), double inputTokenCost = 0.000003, double outputTokenCost = 0.000015}) SessionLifecycle
Cost tracking lifecycle hooks.
fileBackup({required Future<void> writeBackup(String path, String content), required Future<String?> readFile(String path)}) ToolLifecycle
File backup lifecycle hooks.
gitSafety({List<String> protectedBranches = const ['main', 'master'], void onWarning(String warning)?}) ToolLifecycle
Git safety lifecycle hooks.
rateLimiting({int maxToolCallsPerMinute = 120, void onLimitApproached(String warning)?, void onLimitExceeded(String error)?}) ToolLifecycle
Rate limiting lifecycle hooks.
registerAll(LifecycleManager manager, {void onCostUpdate(int, int, double)?, void logEntry(String)?, Future<void> writeBackup(String, String)?, Future<String?> readFile(String)?, List<String>? protectedBranches, void onGitWarning(String)?, void onSecretFound(String)?, int maxToolCallsPerMinute = 120, void onRateLimitWarning(String)?, void onRateLimitExceeded(String)?}) → void
Convenience method to register all built-in lifecycle hooks.
secretDetection({required void onSecretFound(String warning)}) ToolLifecycle
Secret detection lifecycle hooks.