Commit Graph

414 Commits (a76d00a08e12b2c66d6a323b2eef47ab06a03862)

Author SHA1 Message Date
Joao Lisboa 73a9fdca2a fix: send Claude identity prefix on first session message
The systemSent variable was being set to true before being passed to
runCommandReply, causing the identity prefix to never be injected.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 21:07:13 +00:00
Joao Lisboa 06dd9b8ed8 fix: follow redirects when downloading Twilio media
node:https request() doesn't follow redirects by default, causing
Twilio media URLs (which 302 to CDN) to save placeholder/metadata
instead of actual images.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 21:07:13 +00:00
Joao Lisboa a86cb932cf chore: user-agnostic Claude identity and tests
- Use ~/Clawd instead of hardcoded /Users/steipete/clawd
- Add MEDIA: syntax instructions to identity prefix
- Update tests to check for 'scratchpad' instead of specific path

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 21:07:13 +00:00
Joao Lisboa 2fae0a9f47 fix: media serving and id consistency
- server.ts: Replace sendFile with manual readFile+send to fix
  NotFoundError when serving media (sendFile failed even after stat)
- store.ts: Return id with file extension so it matches actual filename

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 21:07:13 +00:00
Joao Lisboa 2ec9192010 fix: use export type for type-only re-exports
Fixes build error with isolatedModules.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 21:06:27 +00:00
Peter Steinberger b172b538fc perf(pi): reuse tau rpc for command auto-replies 2025-12-02 20:09:51 +00:00
Peter Steinberger 2cf134668c fix(media): block symlink traversal 2025-12-02 18:37:15 +00:00
Joao Lisboa b94b220156 Fix path traversal vulnerability in media server
The /media/:id endpoint was vulnerable to path traversal attacks.
Since this endpoint is exposed via Tailscale Funnel (unlike the
WhatsApp webhook which requires Twilio signature validation),
attackers could directly request paths like /media/%2e%2e%2fwarelay.json
to access sensitive files in ~/.warelay/ (e.g. warelay.json), or even
escape further to the user's home directory via multiple ../ sequences.

Fix: validate resolved paths stay within the media directory.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 19:33:21 +01:00
Peter Steinberger 26921cbe68 chore(logs): rotate daily and prune after 24h 2025-12-02 17:11:43 +00:00
Peter Steinberger 8844674825 chore(security): purge session store on logout 2025-12-02 16:33:44 +00:00
Peter Steinberger c9fbe2cb92 chore(security): harden ipc socket 2025-12-02 16:09:40 +00:00
Peter Steinberger ed080ae988 Tests: cover agents and fix web defaults
Co-authored-by: RealSid08 <RealSid08@users.noreply.github.com>
2025-12-02 11:08:00 +00:00
Peter Steinberger f31e89d5af Agents: add pluggable CLIs
Co-authored-by: RealSid08 <RealSid08@users.noreply.github.com>
2025-12-02 11:07:46 +00:00
Peter Steinberger 5b54d4de7a feat(web): batch inbound messages 2025-12-02 07:54:13 +00:00
Peter Steinberger 96152f6577 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 e86b507da7 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 2fc3a822c8 web: isolate session fixtures and skip heartbeat when busy 2025-12-02 06:17:16 +00:00
Peter Steinberger d107b79c63 Fix test corrupting production sessions.json
The test 'falls back to most recent session when no to is provided' was
using resolveStorePath() which returns the real ~/.warelay/sessions.json.
This overwrote production session data with test values, causing session
fragmentation issues.

Changed to use a temp directory like other tests.
2025-12-02 05:54:31 +00:00
Peter Steinberger c5ab442f46 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 c5677df56e 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 21ba0fb8a4 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 69319a0569 Add auto-recovery from stuck WhatsApp sessions
Fixes issue where unauthorized messages from +212652169245 (5elements spa)
triggered Bad MAC errors and silently killed the event emitter, preventing
all future message processing.

Changes:
1. Early allowFrom filtering in inbound.ts - blocks unauthorized senders
   before they trigger encryption errors
2. Message timeout watchdog - auto-restarts connection if no messages
   received for 10 minutes
3. Health monitoring in heartbeat - warns if >30 min without messages
4. Mock loadConfig in tests to handle new dependency

Root cause: Event emitter stopped firing after Bad MAC errors from
decryption attempts on messages from unauthorized senders. Connection
stayed alive but all subsequent messages.upsert events silently failed.
2025-11-30 17:53:32 +00:00
Peter Steinberger 37d8e55991 Skip responsePrefix for HEARTBEAT_OK responses
Preserve exact match so warelay recognizes heartbeat responses
and doesn't send them as messages.
2025-11-29 06:02:21 +00:00
Peter Steinberger 8d20edb028 Simplify timestampPrefix: bool or timezone string, default true
- timestampPrefix: true (UTC), false (off), or 'America/New_York'
- Removed separate timestampTimezone option
- Default is now enabled (true/UTC) unless explicitly false
2025-11-29 05:29:29 +00:00
Peter Steinberger 7564c4e7f4 Generalize prefix config: messagePrefix + responsePrefix
Replaces samePhoneMarker/samePhoneResponsePrefix with:
- messagePrefix: prefix for all inbound messages
  - Default: '[warelay]' if no allowFrom, else ''
- responsePrefix: prefix for all outbound replies

Also adds timestamp options:
- timestampPrefix: boolean to enable [Nov 29 06:30] format
- timestampTimezone: IANA timezone (default UTC)

Updated README with new config table entries.
2025-11-29 05:27:58 +00:00
Peter Steinberger 26e02a9b8b Add timestampPrefix config for datetime awareness
New config options:
- timestampPrefix: boolean - prepend timestamp to messages
- timestampTimezone: string - IANA timezone (default: UTC)

Format: [Nov 29 06:30] - compact but informative
Helps AI assistants stay aware of current date/time.
2025-11-29 05:25:53 +00:00
Peter Steinberger 25ec133574 Add samePhoneResponsePrefix config option
Automatically prefixes responses with a configurable string when in
same-phone mode. This helps distinguish bot replies from user messages
in the same chat bubble.

Example config:
  "samePhoneResponsePrefix": "🦞"

Will prefix all same-phone replies with the lobster emoji.
2025-11-29 05:24:01 +00:00
Peter Steinberger d88ede92b9 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 12d7be7cad feat(heartbeat): allow manual message and dry-run for web/twilio 2025-11-28 08:14:07 +01:00
Peter Steinberger c11abc1134 chore: release 1.2.1 2025-11-28 08:11:07 +01:00
Peter Steinberger 7d6a4f5204 fix(media): sniff mime and keep extensions 2025-11-28 08:07:53 +01:00
Peter Steinberger 0cc732dce3 Docs: refresh 1.2.0 changelog; fix webhook host import 2025-11-27 18:46:46 +01:00
Peter Steinberger 9b3c4db10d Heartbeat defaults and ws guard; format 2025-11-27 18:37:30 +01:00
Peter Steinberger 85f53a4174 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 d4580d1a31 Fix CI: type gaps and hasMedia check 2025-11-27 18:14:20 +01:00
Peter Steinberger 93a103dde5 Tests: cover identity prefix gating 2025-11-27 04:40:03 +01:00
Peter Steinberger 9e6ad97cfb Claude prompt: only prepend on first turn 2025-11-27 03:53:13 +01:00
Peter Steinberger 8d995a8529 Heartbeat: add ultrathink marker 2025-11-27 03:15:51 +01:00
Peter Steinberger f869cd4b79 Heartbeat: shorten prompt to token 2025-11-27 02:48:23 +01:00
Peter Steinberger 26b087c1b4 Heartbeat: honor session override 2025-11-26 18:32:25 +01:00
Peter Steinberger 63bf4683c5 Heartbeat: allow session-id override (with test) 2025-11-26 18:28:02 +01:00
Peter Steinberger 73456a68d7 Fix heartbeat CLI import for recipients resolution 2025-11-26 18:22:28 +01:00
Peter Steinberger 8f6e43fd66 Changelog: bump to 1.2.0 unreleased 2025-11-26 18:18:13 +01:00
Peter Steinberger ebce6ef263 Docs: show --all heartbeat example 2025-11-26 18:17:30 +01:00
Peter Steinberger c20a266a11 Heartbeat: harden targeting and support lid mapping 2025-11-26 18:15:57 +01:00
Marcus Neves b825f141f3 fix: add @lid format support and allowFrom wildcard handling
- Add support for WhatsApp Linked ID (@lid) format in jidToE164()
- Use existing lid-mapping-*_reverse.json files for LID resolution
- Fix allowFrom wildcard '*' to actually allow all senders
- Maintain backward compatibility with @s.whatsapp.net format

Fixes issues where:
- Messages from newer WhatsApp versions are silently dropped
- allowFrom: ['*'] configuration doesn't work as documented
2025-11-26 18:03:12 +01:00
Peter Steinberger 7e5b3958cc CLI: rename heartbeat tmux helper and log file path 2025-11-26 18:00:23 +01:00
Peter Steinberger deded848ee Heartbeat: add relay helper and fix CLI tests 2025-11-26 17:49:34 +01:00
Peter Steinberger 117161e6ff docs: document heartbeat idle override and tests 2025-11-26 17:31:56 +01:00
Peter Steinberger 98d52edcc9 test: cover heartbeat skip preserving session timestamp 2025-11-26 17:29:12 +01:00
Peter Steinberger 135d930c99 feat: add heartbeat idle override and preserve session freshness 2025-11-26 17:26:17 +01:00
Peter Steinberger e6c78df975 chore: add verbose heartbeat session logging 2025-11-26 17:21:59 +01:00
Peter Steinberger 3749797434 chore: log heartbeat session snapshot 2025-11-26 17:20:48 +01:00
Peter Steinberger 507ed25289 chore: log heartbeat fallback and add test 2025-11-26 17:12:28 +01:00
Peter Steinberger 0d5e5f8dee fix: heartbeat falls back to last session contact 2025-11-26 17:08:43 +01:00
Peter Steinberger 271004bf60 feat: add heartbeat cli and relay trigger 2025-11-26 17:04:43 +01:00
Peter Steinberger c194247dab test(auto-reply): cover cwd timeout hint and queue meta 2025-11-26 03:03:13 +01:00
Peter Steinberger a48420d85f docs: finalize web refactor and coverage 2025-11-26 02:54:43 +01:00
Peter Steinberger 5c66e8273b chore: update changelog and surface web relay settings 2025-11-26 02:43:24 +01:00
Peter Steinberger 5992e629c3 web: add reconnect logging + troubleshooting doc 2025-11-26 02:41:10 +01:00
Peter Steinberger 765d67cd18 web: extract reconnect helpers and add tests 2025-11-26 02:39:31 +01:00
Peter Steinberger baf20af17f web: add heartbeat and bounded reconnect tuning 2025-11-26 02:34:43 +01:00
Peter Steinberger e482e7768b chore: commit pending cli/web test tweaks 2025-11-26 02:19:45 +01:00
Peter Steinberger 4a8bb56a1e chore(auto-reply): include cwd in timeout message 2025-11-26 02:18:16 +01:00
Peter Steinberger ce5b02a9ad test(auto-reply): add helper coverage and docs 2025-11-26 02:09:50 +01:00
Peter Steinberger 5c8ce41e12 refactor(auto-reply): split reply helpers 2025-11-26 02:03:51 +01:00
Peter Steinberger a2586b8b06 feat(web): add logout command and tests 2025-11-26 01:29:02 +01:00
Peter Steinberger 1fd4485716 Auto-reply: refresh typing indicator every 8s 2025-11-26 01:27:51 +01:00
Peter Steinberger b029ab933e chore(tests): organize web test imports 2025-11-26 01:24:34 +01:00
Peter Steinberger e0b28b6718 test(web): split provider web suite 2025-11-26 01:23:34 +01:00
Peter Steinberger 4dd2f3b7f7 refactor(web): split provider module 2025-11-26 01:16:54 +01:00
Peter Steinberger e5f677803f chore: format to 2-space and bump changelog 2025-11-26 00:53:53 +01:00
Peter Steinberger a67f4db5e2 chore: format + lint 2025-11-26 00:30:30 +01:00
Peter Steinberger 8a01dc7f4c style: normalize indentation to 2 spaces 2025-11-26 00:15:10 +01:00
Peter Steinberger af8af4881b docs/tests: typing interval docs and coverage 2025-11-26 00:10:38 +01:00
Peter Steinberger d871dad85f feat: keep typing indicators alive during commands 2025-11-26 00:05:11 +01:00
Peter Steinberger 5b83d30887 test: cover sendSystemOnce default 2025-11-25 23:57:41 +01:00
Peter Steinberger 2e3b8a03aa feat: send session prompt once 2025-11-25 23:52:38 +01:00
Peter Steinberger d924b7d283 docs: document media caps and tidy web tests 2025-11-25 23:43:57 +01:00
Peter Steinberger e0425ad3e1 feat: support audio/video/doc media caps and transcript context 2025-11-25 23:21:35 +01:00
Peter Steinberger e642f128ae feat: transcribe audio and surface transcript to prompts 2025-11-25 23:13:22 +01:00
Peter Steinberger 7d0ae151e8 feat: optional audio transcription via CLI 2025-11-25 23:06:54 +01:00
Peter Steinberger f945e284e1 test: cover media formats + doc resize cap 2025-11-25 22:23:06 +01:00
Peter Steinberger 0a0418b973 web: compress auto-reply media 2025-11-25 20:09:03 +01:00
Peter Steinberger dda017df23 Web relay: auto-reconnect Baileys and test 2025-11-25 18:09:57 +01:00
Peter Steinberger 46be5eac7d Auto-reply: send timeout fallback and tests 2025-11-25 17:52:57 +01:00
Peter Steinberger 20fc412765 Refactor: derive version from package.json 2025-11-25 17:10:53 +01:00
Peter Steinberger c251681a40 Chore: prep 0.1.4 unreleased placeholder and release guardrails 2025-11-25 17:08:13 +01:00
Peter Steinberger 9c25e15e92 Release 0.1.3 2025-11-25 16:53:30 +01:00
Peter Steinberger bcbf0de240 Add cwd option for command replies 2025-11-25 16:19:24 +01:00
Peter Steinberger 80d9d288c2 chore: bump to 0.1.2 and fix commander typings 2025-11-25 14:26:55 +01:00
Peter Steinberger dd55a80430 chore: prep 0.1.1 (version bump, lowercase branding, ua update) 2025-11-25 14:13:17 +01:00
Peter Steinberger 3b8783ec0e docs: colorized help and example footer 2025-11-25 14:09:59 +01:00
Peter Steinberger cadd29e147 fix: make CLI bin invoke program parse 2025-11-25 13:22:54 +01:00
Peter Steinberger b6250efbf3 Raise test coverage to ~73% 2025-11-25 12:48:12 +01:00
Peter Steinberger 962dfa08d1 CLI: add verbose flag to send and status 2025-11-25 12:43:20 +01:00
Peter Steinberger dd32638eb4 Cleanup: remove deprecated up alias and update ingress docs 2025-11-25 12:40:56 +01:00
Peter Steinberger c83efdc5bc CLI: unify webhook ingress and keep up as tailscale alias 2025-11-25 12:38:38 +01:00
Peter Steinberger e6b98cb445 CLI: drop web:login alias and simplify web quickstart 2025-11-25 12:30:43 +01:00
Peter Steinberger 2ba56b82e7 Add media hosting and store tests 2025-11-25 12:30:43 +01:00
Peter Steinberger ff6e13d274 Add CLI and infra test coverage 2025-11-25 12:30:43 +01:00
Peter Steinberger 4fa414919b fix: restore zod typing and import ClaudeJsonParseResult 2025-11-25 12:25:05 +01:00
Peter Steinberger 4704099d2b tests: mock twilio auth for update-webhook helpers 2025-11-25 12:21:59 +01:00
Peter Steinberger 38659f5d3e test: sync updated specs 2025-11-25 12:12:29 +01:00
Peter Steinberger 800c7a1e1f chore: sync source updates 2025-11-25 12:12:13 +01:00
Peter Steinberger 7e9e8fd9c9 ci: fix node path and lint warnings 2025-11-25 12:08:08 +01:00
Peter Steinberger da6727ffae claude: allow scratchpad markdown or images, remind length 2025-11-25 06:50:52 +01:00
Peter Steinberger 7e24f3ab95 claude: expand Clawd prompt, remind 1500 char limit 2025-11-25 06:50:15 +01:00
Peter Steinberger 8161b7a877 claude: tell Clawd to use ~/clawd markdown scratchpad 2025-11-25 06:49:10 +01:00
Peter Steinberger dc31efb7aa web: announce available presence when relay starts 2025-11-25 06:42:39 +01:00
Peter Steinberger 0adc0ed7a6 claude: prefix prompt with Clawd identity 2025-11-25 06:41:27 +01:00
Peter Steinberger a331bd5ea1 web: send read receipts for inbound messages 2025-11-25 06:36:22 +01:00
Peter Steinberger 716f31f17a auto-reply: handle empty stdout gracefully 2025-11-25 06:33:49 +01:00
Peter Steinberger d925d9849c refactor: simplify MEDIA parsing, drop invalid lines, keep valid tokens 2025-11-25 06:17:48 +01:00
Peter Steinberger 49bf1fadb6 debug: log MEDIA extraction and parse Claude text for tokens 2025-11-25 06:14:12 +01:00
Peter Steinberger ad55832cda fix: strip trailing punctuation from MEDIA tokens and add tests 2025-11-25 06:07:11 +01:00
Peter Steinberger 9fbeb2ccd3 test: cover MEDIA backticks and web media fallback logging 2025-11-25 06:04:41 +01:00
Peter Steinberger 8ea7f9b439 fix: keep MEDIA tokens with punctuation and log web media failures 2025-11-25 06:02:41 +01:00
Peter Steinberger 071786fe16 feat: add relay:tmux:attach to join existing session 2025-11-25 05:53:21 +01:00
Peter Steinberger 072998a6ab refactor: extract MEDIA parsing helper and tidy whitespace 2025-11-25 05:49:18 +01:00
Peter Steinberger bafaed37fe chore: attach when starting relay tmux session 2025-11-25 05:48:00 +01:00
Peter Steinberger 6883c3ae4a fix: handle inline MEDIA tokens and host webhook media 2025-11-25 05:47:12 +01:00
Peter Steinberger 729ae64822 feat: add relay:tmux helper for relay watcher 2025-11-25 05:47:06 +01:00
Peter Steinberger 5ce869f86c fix: accept file/media tokens safely and improve web media send 2025-11-25 05:34:08 +01:00
Peter Steinberger 9bf35d3272 fix: harden MEDIA parsing and add tests 2025-11-25 05:25:57 +01:00
Peter Steinberger f4c5f2c193 test: cover media url extraction from command stdout 2025-11-25 05:21:59 +01:00
Peter Steinberger 54c763a679 chore: surface media URL in command prompts and tests 2025-11-25 05:20:50 +01:00
Peter Steinberger 6d41df2941 feat: download inbound media and expose to templating 2025-11-25 05:17:59 +01:00
Peter Steinberger a9533d0999 chore: add connection/send logs and web error surfacing 2025-11-25 05:10:19 +01:00
Peter Steinberger 35d7fe7fc7 chore: log web media sends 2025-11-25 05:09:09 +01:00
Peter Steinberger 948ff7f035 feat: add image support across web and twilio 2025-11-25 04:58:31 +01:00
Peter Steinberger daf45190a9 chore: add color to web auto-reply log 2025-11-25 04:42:45 +01:00
Peter Steinberger 3aedef4126 feat: log auto-reply body and stats for web provider 2025-11-25 04:42:19 +01:00
Peter Steinberger 2aac606979 chore: fix type regressions and helpers 2025-11-25 04:40:57 +01:00
Peter Steinberger 13be898c07 feat: serialize command auto-replies with queue 2025-11-25 04:40:49 +01:00
Peter Steinberger ec630839a9 chore: finish logger sweep and add retry tests 2025-11-25 04:30:40 +01:00
Peter Steinberger ca0b50d772 chore: align web provider logging and relay e2e 2025-11-25 04:15:20 +01:00
Peter Steinberger 39cd9bde1f chore: route exec logging through logger 2025-11-25 04:11:02 +01:00
Peter Steinberger 28277a298a feat: retries for webhook bring-up and send --json docs 2025-11-25 04:10:20 +01:00
Peter Steinberger d1923e6efe feat: add send --json, logger cleanup, and resilient Claude parsing 2025-11-25 04:08:42 +01:00
Peter Steinberger d7cc94333a chore: logger cleanup and test fixes 2025-11-25 04:05:02 +01:00
Peter Steinberger fdfb1df0de feat: add dry-run options and retry helper 2025-11-25 03:57:50 +01:00
Peter Steinberger af577f07da refactor: add provider barrels and webhook grouping 2025-11-25 03:56:11 +01:00
Peter Steinberger 1f5390ed99 chore: route port error debug through logger 2025-11-25 03:51:46 +01:00
Peter Steinberger d2abe3c459 chore: harden claude json parsing and logging 2025-11-25 03:50:52 +01:00
Peter Steinberger 594fb125e6 test: add infra coverage and fix web logging 2025-11-25 03:50:18 +01:00
Peter Steinberger 7fa071267c feat: add logger and twilio poll backoff 2025-11-25 03:48:49 +01:00
Peter Steinberger 8bd406f6b1 feat: add config validation and send dry-run 2025-11-25 03:46:26 +01:00
Peter Steinberger a89d7319a9 refactor: modularize cli helpers 2025-11-25 03:42:12 +01:00
Peter Steinberger 39b3fffe3b refactor: extract twilio message utilities 2025-11-25 03:22:18 +01:00
Peter Steinberger afdaa7ef98 Refactor CLI and Twilio modules; add helper tests and comments 2025-11-25 03:11:39 +01:00
Peter Steinberger c71abf13a1 Extract env + Twilio utils; shrink index 2025-11-25 02:20:35 +01:00
Peter Steinberger b8b0873c1e Extract auto-reply helpers into modules 2025-11-25 02:16:54 +01:00
Peter Steinberger ba3b271c39 Parse Claude JSON output to return text replies 2025-11-25 01:41:52 +01:00
Peter Steinberger 134edc5e49 Silence Baileys session logs unless verbose 2025-11-25 01:40:05 +01:00
Peter Steinberger d0c9bff4ca Ignore coverage output and document Claude text mode 2025-11-25 01:38:43 +01:00
Peter Steinberger b4e5f20cd7 Add claudeOutputFormat support and provider banners 2025-11-25 01:36:52 +01:00
Peter Steinberger d501ac7acb Show provider numbers in relay banner 2025-11-25 01:35:31 +01:00
Peter Steinberger 7a5f5b8efe Fix web auth detection and auto-restart after 515 2025-11-25 00:49:49 +01:00
Peter Steinberger e12e6989c0 Switch to Baileys multi-file auth with latest rc 2025-11-25 00:34:55 +01:00
Peter Steinberger 66359736d3 Update to latest Baileys RC and clean imports 2025-11-25 00:29:44 +01:00
Peter Steinberger 289b417c8e Pin to @whiskeysockets/baileys 7.0.0-rc.9 and remove auth fallback 2025-11-25 00:28:17 +01:00
Peter Steinberger 3b8a31660b Fix bailey auth import fallback and assert login alias 2025-11-25 00:22:49 +01:00
Peter Steinberger 9595964419 Add login alias for web QR and update docs/tests 2025-11-25 00:19:21 +01:00
Peter Steinberger 9dd257a92d Fix provider-web mocks and make tests green 2025-11-25 00:16:01 +01:00
Peter Steinberger 938e237411 Add command modules and tests; commit remaining changes 2025-11-25 00:12:12 +01:00
Peter Steinberger 52e0c8de25 Fix lint warnings and tighten test mocks 2025-11-25 00:10:34 +01:00
Peter Steinberger 73a3463ec8 Unify relay entrypoint and default to web when available 2025-11-24 23:55:49 +01:00
Peter Steinberger 9b4dceecfe Add web provider inbound monitor with auto-replies 2025-11-24 18:33:50 +01:00
Peter Steinberger 5ee4f3219d Add coverage run with thresholds and align tests to utils 2025-11-24 17:51:18 +01:00
Peter Steinberger 574a96050b Add utility tests for paths, prefixes, and sleep 2025-11-24 17:45:49 +01:00
Peter Steinberger cafca5c421 Refactor CLI into modules for web provider and utils 2025-11-24 17:43:37 +01:00
Peter Steinberger f88b3ceb7a Update deps to latest and align tests 2025-11-24 17:33:59 +01:00
Peter Steinberger 657188a7e2 Add vitest and unit coverage for provider helpers 2025-11-24 17:23:59 +01:00
Peter Steinberger 3c8a105165 Add WhatsApp Web provider option and docs 2025-11-24 17:21:47 +01:00
Peter Steinberger 12a3c11c6d Improve Twilio webhook update flow 2025-11-24 16:56:15 +01:00
Peter Steinberger 07f0a26419 Add messaging service webhook fallback; always log inbound 2025-11-24 16:47:30 +01:00
Peter Steinberger b453e285fd Experiment with Twilio webhook updates (no functional change yet) 2025-11-24 16:32:28 +01:00
Peter Steinberger 2f5a0d9402 Run auto-reply commands via spawn with TTY to avoid hangs 2025-11-24 16:15:34 +01:00
Peter Steinberger 47663c38fe Simplify command log to show resolved argv only 2025-11-24 16:11:57 +01:00
Peter Steinberger fa1b357fd6 Log stderr and timeout info for auto-reply commands 2025-11-24 16:11:06 +01:00
Peter Steinberger 17b4c5e7e7 Log templated command argv and enforce timeout kill 2025-11-24 16:09:13 +01:00
Peter Steinberger a5e2636e17 Add command timeout and async polling auto-replies 2025-11-24 16:06:45 +01:00
Peter Steinberger b4a995dbe5 Document config options and log auto-reply timing 2025-11-24 16:02:39 +01:00
Peter Steinberger 42f64279d5 Add claude auto-reply allowlist and verbose hooks 2025-11-24 16:00:56 +01:00
Peter Steinberger 7ed49a6569 Log command execution in config-driven replies 2025-11-24 15:58:21 +01:00
Peter Steinberger a566ba442b Fix webhook update: send form fields via request; keep SDK/phone fallbacks 2025-11-24 15:37:03 +01:00
Peter Steinberger d51cf21131 Add wa alias; drop deprecated setup alias 2025-11-24 15:31:21 +01:00
Peter Steinberger 4f32120176 Normalize webhook path, always log inbound, fix Twilio webhook field names, log polling tip 2025-11-24 15:28:27 +01:00
Peter Steinberger 4a7cfbcc7c Rename setup->up (alias kept) and keep process alive 2025-11-24 14:43:50 +01:00
Peter Steinberger a6e6a26097 Fallback webhook update to incoming phone number when channels sender update fails 2025-11-24 14:20:04 +01:00
Peter Steinberger d8bfd6ba5e Add Biome linting and improve webhook error handling 2025-11-24 14:06:52 +01:00
Peter Steinberger 9bdeb723b4 Keep process alive reliably with unref interval in waitForever 2025-11-24 13:36:22 +01:00
Peter Steinberger fc5f375142 Keep setup/webhook running with waitForever and graceful SIGINT 2025-11-24 13:25:42 +01:00
Peter Steinberger f7a7b1b29e Log incoming requests and add 404 handler for webhook server 2025-11-24 13:04:47 +01:00
Peter Steinberger efe0a76703 Use Twilio SDK channelsSenders.list to discover sender 2025-11-24 12:59:03 +01:00
Peter Steinberger 1af210988b Support TWILIO_SENDER_SID override before sender lookup 2025-11-24 12:56:32 +01:00
Peter Steinberger 3775caa72d Tighten types for Twilio requests and sender lookup 2025-11-24 12:53:09 +01:00
Peter Steinberger eb1c4ae7cf Fix Twilio sender list call (use params instead of qs) 2025-11-24 12:50:54 +01:00
Peter Steinberger e52e943317 Add TWILIO_SENDER_SID override and better funnel/setup error messages 2025-11-24 12:36:03 +01:00
Peter Steinberger 6c6e217f83 Improve funnel error UX and add -y auto-confirm 2025-11-24 12:30:36 +01:00
Peter Steinberger 52b0c6252d Add -y/--yes to auto-confirm prompts; verbose keeps showing command output 2025-11-24 12:07:55 +01:00
Peter Steinberger 1229a01767 Timeout tailscale funnel in verbose runs and surface command output 2025-11-24 12:02:57 +01:00
Peter Steinberger 1e00bff96a Silence dotenv tip output (quiet mode) 2025-11-24 12:00:15 +01:00
Peter Steinberger 821b7ae9b9 Add chalk styling and verbose command output 2025-11-24 11:59:10 +01:00
Peter Steinberger 7b7c148f48 Verbose mode now prints stdout/stderr of invoked commands 2025-11-24 11:54:43 +01:00
Peter Steinberger 0c5f3f37b4 Verbose mode now logs commands; prompts default to yes 2025-11-24 11:53:26 +01:00
Peter Steinberger 3198caf430 Add --verbose flag; silence webhook logs by default 2025-11-24 11:50:42 +01:00
Peter Steinberger 80c300cb67 Setup prompts default to Yes for Go/tailscaled and funnel assist 2025-11-24 11:47:11 +01:00
Peter Steinberger b9c9339ae4 Add guided funnel fallback: prompt to install Go/tailscaled when funnel disabled 2025-11-24 11:45:20 +01:00
Peter Steinberger 8874ebba55 Add per-function comments and minor typing polish 2025-11-24 11:40:54 +01:00
Peter Steinberger 1526c238bd Tighten types: remove anys, validate funnel status, typed exec helpers 2025-11-24 11:38:04 +01:00
Peter Steinberger a2b73ec571 Improve setup: detect missing Tailscale Funnel and document requirement 2025-11-24 11:35:12 +01:00
Peter Steinberger 16dfc1a5b9 Add warelay CLI with Twilio webhook support 2025-11-24 11:23:15 +01:00