Joel Hooks
97f4f80cec
fix(gateway): skip session prompt for passive intel Slack messages
...
Recreate this by adding a passiveIntel guard in packages/gateway/src/command-queue.ts, emitting queue.passive_intel.logged, acking passive intel without calling session.prompt(), and fixing the gateway package TypeScript blockers needed for bunx tsc --noEmit -p packages/gateway/tsconfig.json to pass.
2026-03-09 06:55:45 -07:00
Joel Hooks
b8c1dc3a48
Extract reusable queue core from message-store into @joelclaw/queue (ADR-0217 Phase 1 Story 1)
...
## Overview
Extracted generic Redis stream + priority index primitives from @joelclaw/message-store into a new @joelclaw/queue package. This separates the reusable queue mechanics from gateway-specific logic.
## Changes
### New Package: @joelclaw/queue
- Generic Redis stream + consumer group management
- Priority-based sorted set indexing (P0-P3)
- Functions: init(), persist(), ack(), getUnacked(), drainByPriority(), indexMessagesByPriority(), trimOld()
- Configurable via QueueConfig (streamKey, priorityKey, consumerGroup, consumerName)
- No gateway-specific dedup, classification, or coalescing
- Exported via @joelclaw/queue for reuse
### Updated: @joelclaw/message-store (Gateway Adapter)
- Now depends on @joelclaw/queue
- Preserved public API (init, persist, ack, drainByPriority, etc.)
- Retained gateway-specific behaviors:
- classifyPriority() for Telegram/iMessage/heartbeat classification
- Dedup hashing with 30s window
- P0 drain streak (allow lower priority after 3 P0s)
- P3 coalescing (combine multiple P3s within 60s)
- Channel context stripping
- Wraps queue functions for composition
### Testing
- message-store: 10 tests passing
- queue: 5 tests passing
- TypeScript: no errors
- Biome: no formatting issues
## Files
Created:
- packages/queue/package.json
- packages/queue/src/index.ts
- packages/queue/src/store.ts
- packages/queue/src/types.ts
- packages/queue/__tests__/store.test.ts
Modified:
- packages/message-store/package.json
- packages/message-store/src/store.ts
- packages/message-store/src/types.ts
- packages/message-store/src/index.ts
- pnpm-lock.yaml
## Architecture
This implements hexagonal architecture by:
- Moving pure queue mechanics into a reusable interface
- Keeping gateway adapters thin (composition, not inheritance)
- Enabling future queue consumers (workflows, memory, etc.) without gateway coupling
## Next Steps (ADR-0217 Phase 1 Story 2)
- Add queue registry for named queue instances
- CLI for queue introspection and management
2026-03-06 11:09:42 -08:00