mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:40:44 +00:00
refactor: prune stale extension helpers
This commit is contained in:
@@ -2,7 +2,6 @@ import path from "node:path";
|
||||
import type {
|
||||
MatrixMessageAttachmentKind,
|
||||
MatrixMessageAttachmentSummary,
|
||||
MatrixMessageSummary,
|
||||
} from "./actions/types.js";
|
||||
|
||||
const MATRIX_MEDIA_KINDS: Record<string, MatrixMessageAttachmentKind> = {
|
||||
@@ -134,12 +133,6 @@ export function formatMatrixMessageText(params: {
|
||||
return `${body}\n\n${marker}`;
|
||||
}
|
||||
|
||||
export function formatMatrixMessageSummaryText(
|
||||
summary: Pick<MatrixMessageSummary, "body" | "attachment">,
|
||||
): string | undefined {
|
||||
return formatMatrixMessageText(summary);
|
||||
}
|
||||
|
||||
export function formatMatrixMediaUnavailableText(params: {
|
||||
body?: string;
|
||||
filename?: string;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<string, SlashCommandAccountState> {
|
||||
return accountStates;
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate slash commands for a specific account.
|
||||
* Called from the monitor after bot connects.
|
||||
|
||||
@@ -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<MemoryIndexManager> {
|
||||
const result = await getMemorySearchManager({ cfg, agentId });
|
||||
if (!result.manager) {
|
||||
throw new Error("manager missing");
|
||||
}
|
||||
return result.manager as unknown as MemoryIndexManager;
|
||||
}
|
||||
@@ -309,8 +309,3 @@ function safeHostForLog(url: string): string {
|
||||
return "invalid-url";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `downloadMSTeamsAttachments` instead (supports all file types).
|
||||
*/
|
||||
export const downloadMSTeamsImageAttachments = downloadMSTeamsAttachments;
|
||||
|
||||
Reference in New Issue
Block a user