tessl install tessl/npm-ulid@3.0.0A universally-unique, lexicographically-sortable, identifier generator
Agent Success
Agent success rate when using this tile
78%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.34x
Baseline
Agent success rate without this tile
58%
Build a system that generates unique, sortable identifiers for events in a distributed logging platform.
Your task is to implement an event ID generation system that:
@generates
/**
* Generate a unique event identifier using the current timestamp
* @returns A unique event identifier string
*/
export function generateEventId(): string;
/**
* Generate a unique event identifier using a specific timestamp
* @param timestamp - Unix timestamp in milliseconds
* @returns A unique event identifier string
*/
export function generateEventIdWithTimestamp(timestamp: number): string;
/**
* Validate whether a string is a properly formatted event identifier
* @param id - The string to validate
* @returns true if valid, false otherwise
*/
export function isValidEventId(id: string): boolean;generateEventId() returns a 26-character string @testgenerateEventId() twice returns different identifiers @testgenerateEventIdWithTimestamp(1234567890000) returns a 26-character string @testgenerateEventIdWithTimestamp(1000) < generateEventIdWithTimestamp(2000) @testisValidEventId("01ARZ3NDEKTSV4RRFFQ69G5FAV") returns true @testisValidEventId("invalid123") returns false @testisValidEventId("") returns false @testProvides unique, lexicographically sortable identifier generation.
@satisfied-by