feat(ai-agents): Twitter auto-responder with AI summaries#59
Open
madidnyc wants to merge 64 commits intosteipete:mainfrom
Open
feat(ai-agents): Twitter auto-responder with AI summaries#59madidnyc wants to merge 64 commits intosteipete:mainfrom
madidnyc wants to merge 64 commits intosteipete:mainfrom
Conversation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Responder class that orchestrates Bird reply flow - Upload PNG via client.uploadMedia() - Select random template and build reply text via ReplyTemplateManager - Post reply with media attachment via client.reply() - Full dry-run mode support: skip Bird calls, log payload, return fake ID - Log media upload size and reply success metadata Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix TypeScript type errors in responder.ts: - Use cookieSource instead of source in resolveCredentials options - Fix TweetResult discriminated union handling (no error on success branch) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Removed rootDir constraint from tsconfig.json to allow scripts directory to be included in type checking alongside src directory. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Verified: bun run tsc --noEmit - no type errors Task 2.6 [VERIFY] Quality checkpoint passed without fixes needed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Wrap poller.search() with retry using birdSearch config - Wrap generator.generate() with circuit breaker protection - Handle circuit breaker open state: log warning and skip cycle - Circuit breaker tracks state in DB via recordManusSuccess/recordManusFailure Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create src/utils/errors.ts with error detection utilities: - isAuthError() for 401/403 detection - isDatabaseError() for SQLite errors - isCriticalError() for process-exit conditions - classifyError() for full error categorization - Update index.ts runCycle() with proper error handling: - Auth errors in search/reply stages exit immediately - Critical database errors exit to prevent corruption - Non-critical errors logged and skipped - All components use result pattern consistently Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Verified: bun run tsc --noEmit - no type errors Task 2.9 [VERIFY] Quality checkpoint passed without fixes needed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Note: Graceful shutdown was already implemented in the POC phase. This commit marks task 2.10 as complete after verification. Implementation matches design.md exactly: - SIGTERM/SIGINT handlers registered at startup - shutdown(signal) logs shutdown_initiated with signal name - Sets running = false to stop new cycles - Waits for currentCyclePromise with Promise.race() and 5min timeout - Closes DB via db.close() - Logs shutdown_complete - Exits with process.exit(0) Verified: Process exits cleanly on SIGTERM after completing current cycle. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Verified: bun run tsc --noEmit - no type errors Task 2.12 [VERIFY] Quality checkpoint passed. Phase 2 complete. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Filter pipeline unit tests added (33 tests passing). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix TypeScript strict mode errors in test files: - config.test.ts: Add proper type casting through unknown for deepMerge - filter.test.ts: Apply same fix for Config type conversion Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Verified: bun run test - 76 tests passed Verified: bun run tsc --noEmit - no type errors (after fixes) Fixed TypeScript type conversion errors in test files. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Reply template unit tests added (34 tests, 460 assertions). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Exclude database.test.ts from vitest (uses bun:sqlite, Bun-specific) - Update test script to run both vitest and bun tests - Add test:vitest and test:bun scripts for individual runners Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Verified: bun run test - 167 tests passed (vitest: 110, bun: 57) Fixed test configuration to run vitest + bun tests sequentially. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Verified: bun test src/__tests__/integration/ - 36 tests passed Integration tests working: filter-db (26), manus (10). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Verified: bun run test - 235 tests passed Complete test suite: unit (110), integration (36), E2E (32), database (57). Phase 3 Testing complete. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add biome.json from bird root with code style rules - Add lint scripts to package.json: - lint: Run both Biome and Oxlint - lint:biome: biome check src/ - lint:oxlint: oxlint src/ - lint:fix: biome check --write src/ - Fix all Biome lint errors across codebase: - Replace non-null assertions with proper guards - Move regex literals to top-level constants - Add explicit types for implicit any - Use block statements consistently - Use template literals over concatenation - All 235 tests passing Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Verified: lint (0 issues), check-types (pass), test (235 passing) Full local CI suite passes successfully. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test Plan
🤖 Generated with Claude Code