From 90554ea0481fe3eb62960f06bfd9a2f510bc7070 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 1 May 2026 10:57:24 +0100 Subject: [PATCH] refactor: prune stale extension helpers --- extensions/matrix/src/matrix/media-text.ts | 7 ------ extensions/matrix/src/matrix/poll-types.ts | 4 ---- extensions/matrix/src/matrix/target-ids.ts | 23 ------------------- .../mattermost/src/mattermost/slash-state.ts | 7 ------ .../memory-core/src/memory/test-manager.ts | 13 ----------- .../msteams/src/attachments/download.ts | 5 ---- 6 files changed, 59 deletions(-) delete mode 100644 extensions/memory-core/src/memory/test-manager.ts diff --git a/extensions/matrix/src/matrix/media-text.ts b/extensions/matrix/src/matrix/media-text.ts index 2fe3598bbe1..d8570365023 100644 --- a/extensions/matrix/src/matrix/media-text.ts +++ b/extensions/matrix/src/matrix/media-text.ts @@ -2,7 +2,6 @@ import path from "node:path"; import type { MatrixMessageAttachmentKind, MatrixMessageAttachmentSummary, - MatrixMessageSummary, } from "./actions/types.js"; const MATRIX_MEDIA_KINDS: Record = { @@ -134,12 +133,6 @@ export function formatMatrixMessageText(params: { return `${body}\n\n${marker}`; } -export function formatMatrixMessageSummaryText( - summary: Pick, -): string | undefined { - return formatMatrixMessageText(summary); -} - export function formatMatrixMediaUnavailableText(params: { body?: string; filename?: string; diff --git a/extensions/matrix/src/matrix/poll-types.ts b/extensions/matrix/src/matrix/poll-types.ts index cec3f73b528..fcf35805f25 100644 --- a/extensions/matrix/src/matrix/poll-types.ts +++ b/extensions/matrix/src/matrix/poll-types.ts @@ -55,10 +55,6 @@ export type PollStartSubtype = { answers: PollAnswer[]; }; -export type LegacyPollStartContent = { - "m.poll"?: PollStartSubtype; -}; - export type PollStartContent = { [M_POLL_START]?: PollStartSubtype; [ORG_POLL_START]?: PollStartSubtype; diff --git a/extensions/matrix/src/matrix/target-ids.ts b/extensions/matrix/src/matrix/target-ids.ts index 413993eecb2..131fed3bc44 100644 --- a/extensions/matrix/src/matrix/target-ids.ts +++ b/extensions/matrix/src/matrix/target-ids.ts @@ -62,29 +62,6 @@ export function normalizeMatrixMessagingTarget(raw: string): string | undefined return normalized || undefined; } -export function normalizeMatrixDirectoryUserId(raw: string): string | undefined { - const normalized = stripKnownPrefixes(raw, [MATRIX_PREFIX, USER_PREFIX]); - if (!normalized || normalized === "*") { - return undefined; - } - return isMatrixQualifiedUserId(normalized) ? `user:${normalized}` : normalized; -} - -export function normalizeMatrixDirectoryGroupId(raw: string): string | undefined { - const normalized = stripKnownPrefixes(raw, [MATRIX_PREFIX]); - if (!normalized || normalized === "*") { - return undefined; - } - const lowered = normalizeLowercaseStringOrEmpty(normalized); - if (lowered.startsWith(ROOM_PREFIX) || lowered.startsWith(CHANNEL_PREFIX)) { - return normalized; - } - if (normalized.startsWith("!")) { - return `room:${normalized}`; - } - return normalized; -} - export function resolveMatrixDirectUserId(params: { from?: string; to?: string; diff --git a/extensions/mattermost/src/mattermost/slash-state.ts b/extensions/mattermost/src/mattermost/slash-state.ts index 5f71b07310d..c6f2bb6151e 100644 --- a/extensions/mattermost/src/mattermost/slash-state.ts +++ b/extensions/mattermost/src/mattermost/slash-state.ts @@ -71,13 +71,6 @@ export function getSlashCommandState(accountId: string): SlashCommandAccountStat return accountStates.get(accountId) ?? null; } -/** - * Get all active slash command account states. - */ -export function getAllSlashCommandStates(): ReadonlyMap { - return accountStates; -} - /** * Activate slash commands for a specific account. * Called from the monitor after bot connects. diff --git a/extensions/memory-core/src/memory/test-manager.ts b/extensions/memory-core/src/memory/test-manager.ts deleted file mode 100644 index 65c16df7eee..00000000000 --- a/extensions/memory-core/src/memory/test-manager.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { OpenClawConfig } from "openclaw/plugin-sdk/memory-core-host-engine-foundation"; -import { getMemorySearchManager, type MemoryIndexManager } from "./index.js"; - -export async function createMemoryManagerOrThrow( - cfg: OpenClawConfig, - agentId = "main", -): Promise { - const result = await getMemorySearchManager({ cfg, agentId }); - if (!result.manager) { - throw new Error("manager missing"); - } - return result.manager as unknown as MemoryIndexManager; -} diff --git a/extensions/msteams/src/attachments/download.ts b/extensions/msteams/src/attachments/download.ts index 918309a8055..8cce4eb4a1a 100644 --- a/extensions/msteams/src/attachments/download.ts +++ b/extensions/msteams/src/attachments/download.ts @@ -309,8 +309,3 @@ function safeHostForLog(url: string): string { return "invalid-url"; } } - -/** - * @deprecated Use `downloadMSTeamsAttachments` instead (supports all file types). - */ -export const downloadMSTeamsImageAttachments = downloadMSTeamsAttachments;