From 4b73dc95c4efda323f2d9ea2a6d2ae0acb6086e4 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 18 Jan 2026 18:59:02 +0000 Subject: [PATCH] fix: normalize envelope options --- src/auto-reply/envelope.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/auto-reply/envelope.ts b/src/auto-reply/envelope.ts index 064533eca..348d8ed68 100644 --- a/src/auto-reply/envelope.ts +++ b/src/auto-reply/envelope.ts @@ -33,6 +33,13 @@ export type EnvelopeFormatOptions = { userTimezone?: string; }; +type NormalizedEnvelopeOptions = { + timezone: string; + includeTimestamp: boolean; + includeElapsed: boolean; + userTimezone?: string; +}; + type ResolvedEnvelopeTimezone = | { mode: "utc" } | { mode: "local" } @@ -48,7 +55,7 @@ export function resolveEnvelopeFormatOptions(cfg?: ClawdbotConfig): EnvelopeForm }; } -function normalizeEnvelopeOptions(options?: EnvelopeFormatOptions): Required { +function normalizeEnvelopeOptions(options?: EnvelopeFormatOptions): NormalizedEnvelopeOptions { const includeTimestamp = options?.includeTimestamp !== false; const includeElapsed = options?.includeElapsed !== false; return { @@ -68,7 +75,7 @@ function resolveExplicitTimezone(value: string): string | undefined { } } -function resolveEnvelopeTimezone(options: EnvelopeFormatOptions): ResolvedEnvelopeTimezone { +function resolveEnvelopeTimezone(options: NormalizedEnvelopeOptions): ResolvedEnvelopeTimezone { const trimmed = options.timezone?.trim(); if (!trimmed) return { mode: "utc" }; const lowered = trimmed.toLowerCase();