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.
This commit is contained in:
Peter Steinberger
2025-11-29 05:27:58 +00:00
parent 26e02a9b8b
commit 7564c4e7f4
3 changed files with 23 additions and 15 deletions

View File

@@ -46,8 +46,8 @@ export type WarelayConfig = {
logging?: LoggingConfig;
inbound?: {
allowFrom?: string[]; // E.164 numbers allowed to trigger auto-reply (without whatsapp:)
samePhoneMarker?: string; // Prefix for same-phone mode messages (default: "[same-phone]")
samePhoneResponsePrefix?: string; // Prefix auto-added to replies in same-phone mode (e.g., "🦞")
messagePrefix?: string; // Prefix added to all inbound messages (default: "[warelay]" if no allowFrom, else "")
responsePrefix?: string; // Prefix auto-added to all outbound replies (e.g., "🦞")
timestampPrefix?: boolean; // Prepend compact timestamp to messages (default: false)
timestampTimezone?: string; // IANA timezone for timestamp (default: UTC), e.g., "Europe/Vienna"
transcribeAudio?: {
@@ -143,8 +143,8 @@ const WarelaySchema = z.object({
inbound: z
.object({
allowFrom: z.array(z.string()).optional(),
samePhoneMarker: z.string().optional(),
samePhoneResponsePrefix: z.string().optional(),
messagePrefix: z.string().optional(),
responsePrefix: z.string().optional(),
timestampPrefix: z.boolean().optional(),
timestampTimezone: z.string().optional(),
transcribeAudio: z