89
}
90
}
92
>
/**
93
>
* Strips `before:…` and `after:…` timestamp tokens from filter text,
94
>
* returning only the plain text search portion.
95
>
*/
96
>
export function stripTimestampTokens(text: string): string {
97
return text.replace(timestampTokenPattern, '').trim();
98
}
100
>
/**
101
>
* Filters debug events by comma-separated text terms and optional
102
>
* `before:`/`after:` timestamp tokens.
103
>
*
104
>
* Terms prefixed with `!` are exclusions; all others are inclusions.
105
>
* At least one inclusion term must match (if any are present).
106
>
* Timestamp tokens are parsed and applied as date-range bounds, then
107
>
* stripped before text matching.
108
>
*/
109
>
export function filterDebugEventsByText(events: readonly IChatDebugEvent[], filterText: string): readonly IChatDebugEvent[] {
110
const beforeTimestamp = parseTimeToken(filterText, 'before');
111
const afterTimestamp = parseTimeToken(filterText, 'after');