Commit d86a150
refactor(frame-manager): extract WhatsApp sync into lifecycle hooks (#6)
* refactor(frame-manager): extract WhatsApp sync into lifecycle hooks
- Create new frame-lifecycle-hooks.ts module for extensible frame events
- Remove WhatsApp-specific code from FrameManager (was 20 lines of tight coupling)
- FrameManager now calls frameLifecycleHooks.triggerClose() instead
- WhatsApp sync registers itself as a hook via registerWhatsAppSyncHook()
- Benefits:
- FrameManager no longer knows about WhatsApp
- Other integrations can subscribe to frame events
- Better testability and separation of concerns
- Fire-and-forget hooks don't block frame operations
https://claude.ai/code/session_014ojs76858uGzWb6Hrbs4VG
* refactor(errors): consolidate error codes and handler into single module
- Merge duplicate ErrorCode enums into src/core/errors/index.ts
- Add new error codes: AUTH_*, FS_*, GIT_*, NET_* categories
- Add getUserFriendlyMessage() for user-facing error messages
- Move ErrorHandler class with retry/circuit breaker to errors module
- Move validation utilities (validateInput, validateEmail, validatePath)
- error-handler.ts now re-exports from errors for backwards compatibility
Benefits:
- Single source of truth for all error codes
- Consistent error handling across CLI and core
- No more conflicting StackMemoryError class definitions
- Better organization with categorized error codes
https://claude.ai/code/session_014ojs76858uGzWb6Hrbs4VG
* chore: update package-lock.json
https://claude.ai/code/session_014ojs76858uGzWb6Hrbs4VG
* refactor(frame-manager): add lifecycle hooks and missing methods to RefactoredFrameManager
- Add frameLifecycleHooks integration to RefactoredFrameManager.closeFrame()
- Add missing methods for feature parity with legacy FrameManager:
- setQueryMode() - change query mode for frame retrieval
- getRecentFrames() - get recent frames with metadata
- addContext() - add context metadata to current frame
- deleteFrame() - delete frame completely (for handoffs)
- extractTagsFromFrame() - extract tags for categorization
- calculateFrameImportance() - calculate frame importance
- Add setQueryMode() and removeFrame() to FrameStack
This brings RefactoredFrameManager to feature parity with legacy FrameManager,
enabling eventual removal of the legacy implementation.
https://claude.ai/code/session_014ojs76858uGzWb6Hrbs4VG
* refactor(context): migrate all imports to use index.js and fix type exports
- Update all direct imports from frame-manager.ts to use index.js
- Update type-only imports to use frame-types.ts
- Fix type exports to use `export type` for pure type definitions
(required because esbuild strips type-only modules at runtime)
- Update tests to use new import paths:
- FrameManager now refers to RefactoredFrameManager
- LegacyFrameManager available for backwards compatibility tests
All code now imports FrameManager from index.js, which provides
the RefactoredFrameManager as the primary implementation.
https://claude.ai/code/session_014ojs76858uGzWb6Hrbs4VG
* refactor(context): remove legacy FrameManager and consolidate imports
- Delete frame-manager.ts (1,391 lines) - legacy implementation
- Update all imports to use index.js centralized exports
- Fix updateParentFrame to properly update parent_frame_id and depth
- Add validation for non-existent parent frames
- Support parent_frame_id and depth updates in FrameDatabase
- Rewrite cycle detection tests to use unified FrameManager
https://claude.ai/code/session_014ojs76858uGzWb6Hrbs4VG
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent eba2a74 commit d86a150
84 files changed
Lines changed: 1003 additions & 2047 deletions
File tree
- src
- __tests__
- generated
- integration
- fixtures
- helpers
- agents/core
- cli
- commands
- core
- context
- __tests__
- database
- digest
- __tests__
- errors
- frame
- merge
- __tests__
- monitoring
- performance
- retrieval
- storage
- __tests__
- features
- tasks
- web/server
- hooks
- integrations
- mcp
- handlers
- ralph
- bridge
- context
- learning
- orchestration
- swarm
- visualization
- mcp
- skills
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
0 commit comments