refactor: trim extension helper exports

This commit is contained in:
Peter Steinberger
2026-05-02 09:15:25 +01:00
parent 06110de6f6
commit bccd50b09b
3 changed files with 1 additions and 21 deletions

View File

@@ -213,14 +213,6 @@ export function clearSession(accountId: string): void {
}
}
/** Update only lastSeq on the persisted session. */
export function updateLastSeq(accountId: string, lastSeq: number): void {
const existing = loadSession(accountId);
if (existing?.sessionId) {
saveSession({ ...existing, lastSeq });
}
}
/** Load all saved sessions from disk. */
export function getAllSessions(): SessionState[] {
const sessions = new Map<string, SessionState>();

View File

@@ -151,18 +151,6 @@ export async function sendGroupMessageWithStory({
return { channel: "tlon", messageId: `${fromShip}/${sentAt}` };
}
export function buildMediaText(text: string | undefined, mediaUrl: string | undefined): string {
const cleanText = text?.trim() ?? "";
const cleanUrl = mediaUrl?.trim() ?? "";
if (cleanText && cleanUrl) {
return `${cleanText}\n${cleanUrl}`;
}
if (cleanUrl) {
return cleanUrl;
}
return cleanText;
}
/**
* Build a story with text and optional media (image)
*/

View File

@@ -18,7 +18,7 @@ function extractUrlCitations(annotations: unknown): string[] {
.map((annotation) => annotation.url as string);
}
export const XAI_RESPONSES_BASE_URL = "https://api.x.ai/v1";
const XAI_RESPONSES_BASE_URL = "https://api.x.ai/v1";
export const XAI_RESPONSES_ENDPOINT = `${XAI_RESPONSES_BASE_URL}/responses`;
function trimString(value: unknown): string | undefined {