test(auto-reply): add helper coverage and docs

This commit is contained in:
Peter Steinberger
2025-11-26 02:09:50 +01:00
parent 5c8ce41e12
commit ce5b02a9ad
5 changed files with 387 additions and 17 deletions

View File

@@ -0,0 +1,11 @@
# Auto-reply refactor notes (2025-11-26)
- Split `src/auto-reply/reply.ts` into smaller helpers:
- Command handling lives in `src/auto-reply/command-reply.ts`.
- Audio transcription helpers live in `src/auto-reply/transcription.ts`.
- Shared reply types live in `src/auto-reply/types.ts` (re-exported from `reply.ts`).
- `runCommandReply` now returns `{ payload, meta }`, supports injected enqueue runners for tests, logs structured metadata, and respects `mediaMaxMb` for local media paths.
- Added focused tests:
- `src/auto-reply/command-reply.test.ts` exercises Claude flag injection, session args, timeout messaging, media token handling, and Claude metadata reporting.
- `src/auto-reply/transcription.test.ts` covers media download + transcription command invocation.
- Existing public surface (`getReplyFromConfig`, `autoReplyIfConfigured`, `ReplyPayload`) remains unchanged; integration tests still pass (`pnpm test`).