@@ -72,6 +72,7 @@ import { resolveSlackDmHistoryContext, resolveSlackDmHistoryLimit } from "./prep
7272import { resolveSlackRoutingContext } from "./prepare-routing.js" ;
7373import { resolveSlackThreadContextData } from "./prepare-thread-context.js" ;
7474import { isSlackSubteamMentionForBot , normalizeSlackId } from "./subteam-mentions.js" ;
75+ import { resolveSlackTimestampMs } from "./timestamp.js" ;
7576import type { PreparedSlackMessage } from "./types.js" ;
7677
7778const mentionRegexCache = new WeakMap < SlackMonitorContext , Map < string , RegExp [ ] > > ( ) ;
@@ -83,7 +84,6 @@ const SLACK_HISTORY_MEDIA_MAX_ATTACHMENTS = 4;
8384const SLACK_HISTORY_MEDIA_MAX_BYTES = 10 * 1024 * 1024 ;
8485const SLACK_HISTORY_MEDIA_IDLE_TIMEOUT_MS = 1_000 ;
8586const SLACK_HISTORY_MEDIA_TOTAL_TIMEOUT_MS = 3_000 ;
86- const SLACK_TIMESTAMP_RE = / ^ \d + (?: \. \d + ) ? $ / ;
8787
8888function recordString (
8989 record : Record < string , unknown > | undefined ,
@@ -105,15 +105,6 @@ function recordNullableString(
105105 return normalizeOptionalString ( record [ key ] ) ;
106106}
107107
108- function resolveSlackTimestampMs ( ts : string | undefined ) : number | undefined {
109- const trimmed = ts ?. trim ( ) ;
110- if ( ! trimmed || ! SLACK_TIMESTAMP_RE . test ( trimmed ) ) {
111- return undefined ;
112- }
113- const parsed = Number ( trimmed ) ;
114- return Number . isFinite ( parsed ) ? Math . round ( parsed * 1000 ) : undefined ;
115- }
116-
117108function mergeSlackAssistantThreadContext (
118109 primary : Omit < SlackAssistantThreadContext , "updatedAt" > | undefined ,
119110 fallback : Omit < SlackAssistantThreadContext , "updatedAt" > | undefined ,
0 commit comments