···99import "@atcute/client/lexicons";
10101111declare module "@atcute/client/lexicons" {
1212+ namespace ToolsAtpBorglePlay {
1313+ interface Record {
1414+ $type: "tools.atp.borgle.play";
1515+ game: Guess[];
1616+ }
1717+ interface Guess {
1818+ [Brand.Type]?: "tools.atp.borgle.play#guess";
1919+ /** Array of evaluation results for each letter in the guess */
2020+ evaluations: ("correct" | "present" | "absent")[];
2121+ /**
2222+ * The guessed word (5 letters, uppercase) \
2323+ * Minimum string length: 5 \
2424+ * Maximum string length: 5
2525+ */
2626+ guess: string;
2727+ }
2828+ }
2929+1230 namespace ToolsAtpTypingTest {
1331 interface Record {
1432 $type: "tools.atp.typing.test";
···122140 }
123141124142 interface Records {
143143+ "tools.atp.borgle.play": ToolsAtpBorglePlay.Record;
125144 "tools.atp.typing.test": ToolsAtpTypingTest.Record;
126145 }
127146
+26
src/lib/tid.ts
···4747}
48484949/**
5050+ * Extracts timestamp from a TID string
5151+ * @param tid - The TID string to parse
5252+ * @returns Date object representing the timestamp
5353+ */
5454+export function tidToTime(tid: string): Date {
5555+ // Convert TID string to integer
5656+ let value = 0n;
5757+ for (let i = 0; i < Math.min(tid.length, 13); i++) {
5858+ const char = tid[i];
5959+ const charValue = BASE32_SORT_ALPHABET.indexOf(char);
6060+ if (charValue === -1) {
6161+ throw new Error(`Invalid base32 character: ${char}`);
6262+ }
6363+ value = (value << 5n) | BigInt(charValue);
6464+ }
6565+6666+ // Extract timestamp (shift right 10 bits to remove clock ID, mask to get microseconds)
6767+ const micros = (value >> 10n) & 0x1fff_ffff_ffff_ffffn;
6868+6969+ // Convert microseconds to milliseconds for JavaScript Date
7070+ const millis = Number(micros / 1000n);
7171+7272+ return new Date(millis);
7373+}
7474+7575+/**
5076 * Generates a new Transaction ID with a random clock ID
5177 * @returns TransactionId
5278 */