Commit Graph

74 Commits

Author SHA1 Message Date
Peter Steinberger
cee09fa3e5 Tau RPC: resolve on agent_end or exit 2025-12-03 11:34:00 +00:00
Peter Steinberger
b6a04aadd2 Pi: resume Tau sessions with --continue 2025-12-03 11:33:51 +00:00
Peter Steinberger
ff625f0b63 Docs: note 1s tool coalescing window 2025-12-03 10:19:10 +00:00
Peter Steinberger
040c991ce9 Verbose: batch rapid tool results 2025-12-03 10:11:41 +00:00
Peter Steinberger
c9fd48de31 Verbose: include tool arg metadata in prefixes 2025-12-03 09:57:41 +00:00
Peter Steinberger
01185952e6 Verbose: send tool result metadata only 2025-12-03 09:40:05 +00:00
Peter Steinberger
c8309e73aa Tau RPC: resolve on agent_end 2025-12-03 09:39:26 +00:00
Peter Steinberger
4143c2be2d Docs: note streaming verbose tool results 2025-12-03 09:22:43 +00:00
Peter Steinberger
05ce99d557 Docs: mention verbose hints 2025-12-03 09:08:03 +00:00
Peter Steinberger
e33c7a813d Auto-reply: add /verbose directives and tool result replies 2025-12-03 09:04:37 +00:00
Peter Steinberger
e5fff1d374 Auto-reply: ack think directives 2025-12-03 08:54:38 +00:00
Peter Steinberger
6ec2335bae Docs: document thinking levels 2025-12-03 08:45:30 +00:00
Peter Steinberger
2fbd0b9f74 Changelog: heartbeat array handling 2025-12-03 01:03:59 +00:00
Peter Steinberger
d25d12ca8a Auto-reply: smarter chunking breaks 2025-12-03 00:25:01 +00:00
Peter Steinberger
0f378bb640 limits: chunk replies for twilio/web 2025-12-02 23:10:16 +00:00
Peter Steinberger
f374561579 auto-reply: support multi-text RPC outputs 2025-12-02 23:03:55 +00:00
Peter Steinberger
088887c8fe chore: cut 1.3.1 in changelog 2025-12-02 21:13:47 +00:00
Peter Steinberger
8c7f4e4ab0 docs: note media cleanup and tau rpc typing 2025-12-02 21:13:21 +00:00
Peter Steinberger
5e5adbfc8f test(media): add redirect coverage and update changelog 2025-12-02 21:09:26 +00:00
Peter Steinberger
873ba41650 docs: update agent guidance and changelog 2025-12-02 20:10:43 +00:00
Peter Steinberger
65c7078abb chore: credit media fix contributor 2025-12-02 18:38:02 +00:00
Peter Steinberger
dc226c4ee0 fix(media): block symlink traversal 2025-12-02 18:37:15 +00:00
Peter Steinberger
5b5eebe015 chore(logs): rotate daily and prune after 24h 2025-12-02 17:11:43 +00:00
Peter Steinberger
1f0c022b96 chore(security): purge session store on logout 2025-12-02 16:33:44 +00:00
Peter Steinberger
241941fb70 chore(security): harden ipc socket 2025-12-02 16:09:40 +00:00
Peter Steinberger
bdaf64e6dc Changelog: note multi-agent and batching
Co-authored-by: RealSid08 <RealSid08@users.noreply.github.com>
2025-12-02 11:11:50 +00:00
Peter Steinberger
6c12d50895 chore: bump version to 1.3.0 2025-12-02 07:54:49 +00:00
Peter Steinberger
32564ca6d3 Add typing indicator after IPC send
After sending via IPC, automatically show "composing" indicator so
user knows more messages may be coming from the running session.
2025-12-02 06:58:17 +00:00
Peter Steinberger
030968e2de Add IPC to prevent Signal session corruption from concurrent connections
When the relay is running, `warelay send` and `warelay heartbeat` now
communicate via Unix socket IPC (~/.warelay/relay.sock) to send messages
through the relay's existing WhatsApp connection.

Previously, these commands created new Baileys sockets that wrote to the
same auth state files, corrupting the Signal session ratchet and causing
the relay's subsequent sends to fail silently.

Changes:
- Add src/web/ipc.ts with Unix socket server/client
- Relay starts IPC server after connecting
- send command tries IPC first, falls back to direct
- heartbeat uses sendWithIpcFallback helper
- inbound.ts exposes sendMessage on listener object
- Messages sent via IPC are added to echo detection set
2025-12-02 06:31:07 +00:00
Peter Steinberger
f2d2d3dce6 web: isolate session fixtures and skip heartbeat when busy 2025-12-02 06:17:16 +00:00
Peter Steinberger
a052d535a0 Update changelog with error message and test isolation fixes 2025-12-02 05:59:31 +00:00
Peter Steinberger
8a94bc1b30 Fix empty result JSON dump and missing heartbeat prefix
Bug fixes:
- Empty result field handling: Changed truthy check to explicit type
  check (`typeof parsed?.text === "string"`) in command-reply.ts.
  Previously, Claude CLI returning `result: ""` would cause raw JSON
  to be sent to WhatsApp.
- Response prefix on heartbeat: Apply `responsePrefix` to heartbeat
  alert messages in runReplyHeartbeat, matching behavior of regular
  message handler.
2025-12-02 04:29:17 +00:00
Peter Steinberger
4c4a08fade Increase watchdog timeout to 30 minutes
Changed from 10 to 30 minutes to avoid false positives when
heartbeatMinutes is set to 10. The watchdog should be significantly
longer than the heartbeat interval to account for:
- Network latency
- Slow command responses
- Brief connection hiccups

With heartbeatMinutes=10, a 30-minute watchdog gives 3x buffer before
triggering auto-restart.
2025-11-30 18:03:19 +00:00
Peter Steinberger
9f1c2169eb Fix test isolation to prevent loading real user config
Tests were picking up real ~/.warelay/warelay.json with emojis and
prefixes (like "🦞"), causing test assertions to fail. Added proper
config mocks to all test files.

Changes:
- Mock loadConfig() in index.core.test.ts, inbound.media.test.ts,
  monitor-inbox.test.ts
- Update test-helpers.ts default mock to disable all prefixes
- Tests now use clean config: no messagePrefix, no responsePrefix,
  no timestamp, allowFrom=["*"]

This ensures tests validate core behavior without user-specific config.
The responsePrefix feature itself is already fully config-driven - this
only fixes test isolation.
2025-11-30 18:00:57 +00:00
Peter Steinberger
a7b6914a64 feat: same-phone mode with echo detection and configurable marker
Adds full support for self-messaging setups where you chat with yourself
and an AI assistant replies in the same WhatsApp bubble.

Changes:
- Same-phone mode (from === to) always allowed, bypasses allowFrom check
- Echo detection via bounded Set (max 100) prevents infinite loops
- Configurable samePhoneMarker in config (default: "[same-phone]")
- Messages prefixed with marker so assistants know the context
- fromMe filter removed from inbound.ts (echo detection in auto-reply)
- Verbose logging for same-phone detection and echo skips

Tests:
- Same-phone allowed without/despite allowFrom configuration
- Body prefixed only when from === to
- Non-same-phone rejected when not in allowFrom
2025-11-29 04:52:21 +00:00
Peter Steinberger
f13519d277 chore: release 1.2.2 2025-11-28 08:17:22 +01:00
Peter Steinberger
9486f06adb chore: move heartbeat notes to unreleased 1.2.2 2025-11-28 08:14:51 +01:00
Peter Steinberger
258bb716c5 chore: release 1.2.1 2025-11-28 08:11:07 +01:00
Peter Steinberger
83f03a9b23 docs: document mime-first media handling 2025-11-28 08:07:53 +01:00
Peter Steinberger
0866974e59 Release 1.2.0 2025-11-27 18:52:26 +01:00
Peter Steinberger
bb21763957 Docs: refresh 1.2.0 changelog; fix webhook host import 2025-11-27 18:46:46 +01:00
Peter Steinberger
2a4f56e66b Fix WebSocket crash + heartbeat default 10min + docs refresh
- Wrap Baileys connection.update listeners in try-catch to prevent
  unhandled exceptions from crashing the relay process
- Add WebSocket-level error handlers in session.ts
- Add global unhandledRejection/uncaughtException handlers in index.ts
- Make listener.onClose error-safe with .catch() in auto-reply.ts
- Change default heartbeat from 30min to 10min
- Rewrite claude-config.md with personality, better explain personal
  assistant features, add recommended MCPs section
2025-11-27 18:21:14 +01:00
Peter Steinberger
cb050b022f Heartbeat: session-id override and safer fallback 2025-11-26 18:19:54 +01:00
Peter Steinberger
f3604a4a28 Changelog: bump to 1.2.0 unreleased 2025-11-26 18:18:13 +01:00
Peter Steinberger
ba543640d3 Heartbeat: harden targeting and support lid mapping 2025-11-26 18:15:57 +01:00
Peter Steinberger
b13fa6bcc3 CLI: rename heartbeat tmux helper and log file path 2025-11-26 18:00:23 +01:00
Peter Steinberger
1c64f83b31 Heartbeat: add relay helper and fix CLI tests 2025-11-26 17:49:34 +01:00
Peter Steinberger
4c58baa14b docs: document heartbeat idle override and tests 2025-11-26 17:31:56 +01:00
Peter Steinberger
a6af33d262 docs: document heartbeat triggers 2025-11-26 17:05:09 +01:00
Peter Steinberger
5d0c5c7a50 docs: open 1.1.x unreleased section 2025-11-26 03:33:44 +01:00