mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:30:42 +00:00
refactor: trim extension helper exports
This commit is contained in:
@@ -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>();
|
||||
|
||||
@@ -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)
|
||||
*/
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user