diff --git a/extensions/matrix/src/legacy-state.ts b/extensions/matrix/src/legacy-state.ts index 1a23c3703e3..61dedd5bac7 100644 --- a/extensions/matrix/src/legacy-state.ts +++ b/extensions/matrix/src/legacy-state.ts @@ -6,7 +6,7 @@ import { resolveStateDir } from "openclaw/plugin-sdk/state-paths"; import { resolveLegacyMatrixFlatStoreTarget } from "./migration-config.js"; import { resolveMatrixLegacyFlatStoragePaths } from "./storage-paths.js"; -export type MatrixLegacyStateMigrationResult = { +type MatrixLegacyStateMigrationResult = { migrated: boolean; changes: string[]; warnings: string[]; diff --git a/extensions/matrix/src/matrix/backup-health.ts b/extensions/matrix/src/matrix/backup-health.ts index 63c255197e7..79d702456b9 100644 --- a/extensions/matrix/src/matrix/backup-health.ts +++ b/extensions/matrix/src/matrix/backup-health.ts @@ -1,4 +1,4 @@ -export type MatrixRoomKeyBackupStatusLike = { +type MatrixRoomKeyBackupStatusLike = { serverVersion: string | null; activeVersion: string | null; trusted: boolean | null; @@ -8,7 +8,7 @@ export type MatrixRoomKeyBackupStatusLike = { keyLoadError: string | null; }; -export type MatrixRoomKeyBackupIssueCode = +type MatrixRoomKeyBackupIssueCode = | "missing-server-backup" | "key-load-failed" | "key-not-loaded" @@ -18,7 +18,7 @@ export type MatrixRoomKeyBackupIssueCode = | "indeterminate" | "ok"; -export type MatrixRoomKeyBackupIssue = { +type MatrixRoomKeyBackupIssue = { code: MatrixRoomKeyBackupIssueCode; summary: string; message: string | null; diff --git a/extensions/matrix/src/matrix/client/config.ts b/extensions/matrix/src/matrix/client/config.ts index 20604d983aa..04d3405b2af 100644 --- a/extensions/matrix/src/matrix/client/config.ts +++ b/extensions/matrix/src/matrix/client/config.ts @@ -32,7 +32,6 @@ import { resolveGlobalMatrixEnvConfig, resolveMatrixEnvAuthReadiness, resolveScopedMatrixEnvConfig, - type MatrixEnvConfig, } from "./env-auth.js"; import { repairCurrentTokenStorageMetaDeviceId } from "./storage.js"; import type { MatrixAuth, MatrixResolvedConfig } from "./types.js"; @@ -449,10 +448,8 @@ function buildMatrixNetworkFields(params: { export { getMatrixScopedEnvVarNames } from "../../env-vars.js"; export { hasReadyMatrixEnvAuth, - resolveGlobalMatrixEnvConfig, resolveMatrixEnvAuthReadiness, resolveScopedMatrixEnvConfig, - type MatrixEnvConfig, } from "./env-auth.js"; export { resolveValidatedMatrixHomeserverUrl, diff --git a/extensions/matrix/src/matrix/client/env-auth.ts b/extensions/matrix/src/matrix/client/env-auth.ts index b54b51ce75b..862b57a345f 100644 --- a/extensions/matrix/src/matrix/client/env-auth.ts +++ b/extensions/matrix/src/matrix/client/env-auth.ts @@ -1,7 +1,7 @@ import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id"; import { getMatrixScopedEnvVarNames } from "../../env-vars.js"; -export type MatrixEnvConfig = { +type MatrixEnvConfig = { homeserver: string; userId: string; accessToken?: string; diff --git a/extensions/matrix/src/matrix/client/storage.ts b/extensions/matrix/src/matrix/client/storage.ts index 759909068b0..f3ed0bd6046 100644 --- a/extensions/matrix/src/matrix/client/storage.ts +++ b/extensions/matrix/src/matrix/client/storage.ts @@ -15,7 +15,7 @@ import { import type { MatrixAuth } from "./types.js"; import type { MatrixStoragePaths } from "./types.js"; -export const DEFAULT_ACCOUNT_KEY = "default"; +const DEFAULT_ACCOUNT_KEY = "default"; const STORAGE_META_FILENAME = "storage-meta.json"; const THREAD_BINDINGS_FILENAME = "thread-bindings.json"; const LEGACY_CRYPTO_MIGRATION_FILENAME = "legacy-crypto-migration.json"; diff --git a/extensions/matrix/src/matrix/encryption-guidance.ts b/extensions/matrix/src/matrix/encryption-guidance.ts index 300d3de1039..85298c34546 100644 --- a/extensions/matrix/src/matrix/encryption-guidance.ts +++ b/extensions/matrix/src/matrix/encryption-guidance.ts @@ -3,10 +3,7 @@ import { resolveMatrixDefaultOrOnlyAccountId } from "../account-selection.js"; import type { CoreConfig } from "../types.js"; import { resolveMatrixConfigFieldPath } from "./config-paths.js"; -export function resolveMatrixEncryptionConfigPath( - cfg: CoreConfig, - accountId?: string | null, -): string { +function resolveMatrixEncryptionConfigPath(cfg: CoreConfig, accountId?: string | null): string { const effectiveAccountId = normalizeOptionalAccountId(accountId) ?? resolveMatrixDefaultOrOnlyAccountId(cfg); return resolveMatrixConfigFieldPath(cfg, effectiveAccountId, "encryption"); diff --git a/extensions/matrix/src/matrix/media-errors.ts b/extensions/matrix/src/matrix/media-errors.ts index f0603e7a830..1fdf391794b 100644 --- a/extensions/matrix/src/matrix/media-errors.ts +++ b/extensions/matrix/src/matrix/media-errors.ts @@ -1,4 +1,4 @@ -export const MATRIX_MEDIA_SIZE_LIMIT_ERROR_MESSAGE = "Matrix media exceeds configured size limit"; +const MATRIX_MEDIA_SIZE_LIMIT_ERROR_MESSAGE = "Matrix media exceeds configured size limit"; export class MatrixMediaSizeLimitError extends Error { readonly code = "MATRIX_MEDIA_SIZE_LIMIT" as const; diff --git a/extensions/matrix/src/matrix/media-text.ts b/extensions/matrix/src/matrix/media-text.ts index d8570365023..98b6c2b7cce 100644 --- a/extensions/matrix/src/matrix/media-text.ts +++ b/extensions/matrix/src/matrix/media-text.ts @@ -35,7 +35,7 @@ function formatMatrixAttachmentMarker(params: { return params.unavailable ? `[matrix ${label} unavailable]` : `[matrix ${label}]`; } -export function isLikelyBareFilename(text: string): boolean { +function isLikelyBareFilename(text: string): boolean { const trimmed = text.trim(); if (!trimmed || trimmed.includes("\n") || /\s/.test(trimmed)) { return false; @@ -97,7 +97,7 @@ export function resolveMatrixMessageBody(params: { return attachment.caption; } -export function formatMatrixAttachmentText(params: { +function formatMatrixAttachmentText(params: { attachment?: MatrixMessageAttachmentSummary; tooLarge?: boolean; unavailable?: boolean; diff --git a/extensions/matrix/src/matrix/monitor/access-state.ts b/extensions/matrix/src/matrix/monitor/access-state.ts index f6bc41171e7..ca48f4e10c9 100644 --- a/extensions/matrix/src/matrix/monitor/access-state.ts +++ b/extensions/matrix/src/matrix/monitor/access-state.ts @@ -12,7 +12,7 @@ type MatrixMonitorAllowListMatch = { matchSource?: "wildcard" | "id" | "prefixed-id" | "prefixed-user"; }; -export type MatrixMonitorAccessState = { +type MatrixMonitorAccessState = { effectiveAllowFrom: string[]; effectiveGroupAllowFrom: string[]; effectiveRoomUsers: string[]; diff --git a/extensions/matrix/src/matrix/monitor/allowlist.ts b/extensions/matrix/src/matrix/monitor/allowlist.ts index e95492bb51d..2af8cc2d8a6 100644 --- a/extensions/matrix/src/matrix/monitor/allowlist.ts +++ b/extensions/matrix/src/matrix/monitor/allowlist.ts @@ -67,9 +67,7 @@ export function normalizeMatrixAllowList(list?: Array) { return normalizeAllowList(list).map((entry) => normalizeMatrixAllowListEntry(entry)); } -export type MatrixAllowListMatch = AllowlistMatch< - "wildcard" | "id" | "prefixed-id" | "prefixed-user" ->; +type MatrixAllowListMatch = AllowlistMatch<"wildcard" | "id" | "prefixed-id" | "prefixed-user">; type MatrixAllowListMatchSource = NonNullable; diff --git a/extensions/matrix/src/matrix/monitor/reply-context.ts b/extensions/matrix/src/matrix/monitor/reply-context.ts index b96a3b001d5..c506f48bbe8 100644 --- a/extensions/matrix/src/matrix/monitor/reply-context.ts +++ b/extensions/matrix/src/matrix/monitor/reply-context.ts @@ -5,7 +5,7 @@ import type { MatrixRawEvent } from "./types.js"; const MAX_CACHED_REPLY_CONTEXTS = 256; const MAX_REPLY_BODY_LENGTH = 500; -export type MatrixReplyContext = { +type MatrixReplyContext = { replyToBody?: string; replyToSender?: string; replyToSenderId?: string; diff --git a/extensions/matrix/src/matrix/monitor/room-history.ts b/extensions/matrix/src/matrix/monitor/room-history.ts index 1960cbb8585..5bd389495c0 100644 --- a/extensions/matrix/src/matrix/monitor/room-history.ts +++ b/extensions/matrix/src/matrix/monitor/room-history.ts @@ -26,16 +26,16 @@ const MAX_PREPARED_TRIGGER_ENTRIES = 500; export type { HistoryEntry }; -export type HistorySnapshotToken = { +type HistorySnapshotToken = { snapshotIdx: number; queueGeneration: number; }; -export type PreparedTriggerResult = { +type PreparedTriggerResult = { history: HistoryEntry[]; } & HistorySnapshotToken; -export type RoomHistoryTracker = { +type RoomHistoryTracker = { /** * Record a non-trigger message for future context. * Call this when a room message arrives but does not mention the bot. @@ -66,7 +66,7 @@ export type RoomHistoryTracker = { ) => void; }; -export type RoomHistoryTrackerTestApi = RoomHistoryTracker & { +type RoomHistoryTrackerTestApi = RoomHistoryTracker & { /** * Test-only helper for inspecting pending room history directly. */ diff --git a/extensions/matrix/src/matrix/monitor/rooms.ts b/extensions/matrix/src/matrix/monitor/rooms.ts index d428fac31c0..e723426ba28 100644 --- a/extensions/matrix/src/matrix/monitor/rooms.ts +++ b/extensions/matrix/src/matrix/monitor/rooms.ts @@ -1,7 +1,7 @@ import type { MatrixRoomConfig } from "../../types.js"; import { buildChannelKeyCandidates, resolveChannelEntryMatch } from "./runtime-api.js"; -export type MatrixRoomConfigResolved = { +type MatrixRoomConfigResolved = { allowed: boolean; allowlistConfigured: boolean; config?: MatrixRoomConfig; diff --git a/extensions/matrix/src/matrix/monitor/threads.ts b/extensions/matrix/src/matrix/monitor/threads.ts index 3c2554bd763..8d3d1055941 100644 --- a/extensions/matrix/src/matrix/monitor/threads.ts +++ b/extensions/matrix/src/matrix/monitor/threads.ts @@ -2,9 +2,9 @@ import { resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing"; import type { MatrixRawEvent, RoomMessageEventContent } from "./types.js"; import { RelationType } from "./types.js"; -export type MatrixThreadReplies = "off" | "inbound" | "always"; +type MatrixThreadReplies = "off" | "inbound" | "always"; -export type MatrixThreadRouting = { +type MatrixThreadRouting = { threadId?: string; }; diff --git a/extensions/matrix/src/matrix/poll-types.ts b/extensions/matrix/src/matrix/poll-types.ts index fcf35805f25..fa5d440d073 100644 --- a/extensions/matrix/src/matrix/poll-types.ts +++ b/extensions/matrix/src/matrix/poll-types.ts @@ -11,14 +11,14 @@ import { normalizePollInput, type PollInput } from "openclaw/plugin-sdk/poll-run import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime"; export const M_POLL_START = "m.poll.start" as const; -export const M_POLL_RESPONSE = "m.poll.response" as const; -export const M_POLL_END = "m.poll.end" as const; +const M_POLL_RESPONSE = "m.poll.response" as const; +const M_POLL_END = "m.poll.end" as const; -export const ORG_POLL_START = "org.matrix.msc3381.poll.start" as const; -export const ORG_POLL_RESPONSE = "org.matrix.msc3381.poll.response" as const; -export const ORG_POLL_END = "org.matrix.msc3381.poll.end" as const; +const ORG_POLL_START = "org.matrix.msc3381.poll.start" as const; +const ORG_POLL_RESPONSE = "org.matrix.msc3381.poll.response" as const; +const ORG_POLL_END = "org.matrix.msc3381.poll.end" as const; -export const POLL_EVENT_TYPES = [ +const POLL_EVENT_TYPES = [ M_POLL_START, M_POLL_RESPONSE, M_POLL_END, @@ -27,28 +27,28 @@ export const POLL_EVENT_TYPES = [ ORG_POLL_END, ]; -export const POLL_START_TYPES = [M_POLL_START, ORG_POLL_START]; -export const POLL_RESPONSE_TYPES = [M_POLL_RESPONSE, ORG_POLL_RESPONSE]; -export const POLL_END_TYPES = [M_POLL_END, ORG_POLL_END]; +const POLL_START_TYPES = [M_POLL_START, ORG_POLL_START]; +const POLL_RESPONSE_TYPES = [M_POLL_RESPONSE, ORG_POLL_RESPONSE]; +const POLL_END_TYPES = [M_POLL_END, ORG_POLL_END]; -export type PollKind = "m.poll.disclosed" | "m.poll.undisclosed"; +type PollKind = "m.poll.disclosed" | "m.poll.undisclosed"; -export type TextContent = { +type TextContent = { "m.text"?: string; "org.matrix.msc1767.text"?: string; body?: string; }; -export type PollAnswer = { +type PollAnswer = { id: string; } & TextContent; -export type PollParsedAnswer = { +type PollParsedAnswer = { id: string; text: string; }; -export type PollStartSubtype = { +type PollStartSubtype = { question: TextContent; kind?: PollKind; max_selections?: number; @@ -63,7 +63,7 @@ export type PollStartContent = { "org.matrix.msc1767.text"?: string; }; -export type PollSummary = { +type PollSummary = { eventId: string; roomId: string; sender: string; @@ -74,7 +74,7 @@ export type PollSummary = { maxSelections: number; }; -export type PollResultsSummary = PollSummary & { +type PollResultsSummary = PollSummary & { entries: Array<{ id: string; text: string; @@ -84,18 +84,18 @@ export type PollResultsSummary = PollSummary & { closed: boolean; }; -export type ParsedPollStart = { +type ParsedPollStart = { question: string; answers: PollParsedAnswer[]; kind: PollKind; maxSelections: number; }; -export type PollResponseSubtype = { +type PollResponseSubtype = { answers: string[]; }; -export type PollResponseContent = { +type PollResponseContent = { [M_POLL_RESPONSE]?: PollResponseSubtype; [ORG_POLL_RESPONSE]?: PollResponseSubtype; "m.relates_to": { @@ -108,11 +108,11 @@ export function isPollStartType(eventType: string): boolean { return (POLL_START_TYPES as readonly string[]).includes(eventType); } -export function isPollResponseType(eventType: string): boolean { +function isPollResponseType(eventType: string): boolean { return (POLL_RESPONSE_TYPES as readonly string[]).includes(eventType); } -export function isPollEndType(eventType: string): boolean { +function isPollEndType(eventType: string): boolean { return (POLL_END_TYPES as readonly string[]).includes(eventType); } @@ -120,7 +120,7 @@ export function isPollEventType(eventType: string): boolean { return (POLL_EVENT_TYPES as readonly string[]).includes(eventType); } -export function getTextContent(text?: TextContent): string { +function getTextContent(text?: TextContent): string { if (!text) { return ""; } diff --git a/extensions/matrix/src/matrix/reaction-common.ts b/extensions/matrix/src/matrix/reaction-common.ts index 9943d62d185..c2fa0c42913 100644 --- a/extensions/matrix/src/matrix/reaction-common.ts +++ b/extensions/matrix/src/matrix/reaction-common.ts @@ -3,7 +3,7 @@ import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runti export const MATRIX_ANNOTATION_RELATION_TYPE = "m.annotation"; export const MATRIX_REACTION_EVENT_TYPE = "m.reaction"; -export type MatrixReactionEventContent = { +type MatrixReactionEventContent = { "m.relates_to": { rel_type: typeof MATRIX_ANNOTATION_RELATION_TYPE; event_id: string; @@ -17,7 +17,7 @@ export type MatrixReactionSummary = { users: string[]; }; -export type MatrixReactionAnnotation = { +type MatrixReactionAnnotation = { key: string; eventId?: string; }; @@ -28,7 +28,7 @@ type MatrixReactionEventLike = { event_id?: string | null; }; -export function normalizeMatrixReactionMessageId(messageId: string): string { +function normalizeMatrixReactionMessageId(messageId: string): string { const normalized = messageId.trim(); if (!normalized) { throw new Error("Matrix reaction requires a messageId"); @@ -36,7 +36,7 @@ export function normalizeMatrixReactionMessageId(messageId: string): string { return normalized; } -export function normalizeMatrixReactionEmoji(emoji: string): string { +function normalizeMatrixReactionEmoji(emoji: string): string { const normalized = emoji.trim(); if (!normalized) { throw new Error("Matrix reaction requires an emoji"); @@ -96,7 +96,7 @@ export function extractMatrixReactionAnnotation( }; } -export function extractMatrixReactionKey(content: unknown): string | undefined { +function extractMatrixReactionKey(content: unknown): string | undefined { return extractMatrixReactionAnnotation(content)?.key; } diff --git a/extensions/matrix/src/matrix/sdk/event-helpers.ts b/extensions/matrix/src/matrix/sdk/event-helpers.ts index 74a0b9da7ea..3a47341e236 100644 --- a/extensions/matrix/src/matrix/sdk/event-helpers.ts +++ b/extensions/matrix/src/matrix/sdk/event-helpers.ts @@ -1,7 +1,7 @@ import type { MatrixEvent } from "matrix-js-sdk/lib/matrix.js"; import type { MatrixRawEvent } from "./types.js"; -export type MatrixEventContentMode = "current" | "original"; +type MatrixEventContentMode = "current" | "original"; export function matrixEventToRaw( event: MatrixEvent, diff --git a/extensions/matrix/src/matrix/sdk/logger.ts b/extensions/matrix/src/matrix/sdk/logger.ts index 91765122163..fd303393d4d 100644 --- a/extensions/matrix/src/matrix/sdk/logger.ts +++ b/extensions/matrix/src/matrix/sdk/logger.ts @@ -3,7 +3,7 @@ import { redactSensitiveText } from "openclaw/plugin-sdk/logging-core"; import type { RuntimeLogger } from "openclaw/plugin-sdk/plugin-runtime"; import { getMatrixRuntime } from "../../runtime.js"; -export type Logger = { +type Logger = { trace: (module: string, ...messageOrObject: unknown[]) => void; debug: (module: string, ...messageOrObject: unknown[]) => void; info: (module: string, ...messageOrObject: unknown[]) => void; diff --git a/extensions/matrix/src/matrix/sdk/transport-runtime-api.ts b/extensions/matrix/src/matrix/sdk/transport-runtime-api.ts index 6783848ae07..3db076d7b48 100644 --- a/extensions/matrix/src/matrix/sdk/transport-runtime-api.ts +++ b/extensions/matrix/src/matrix/sdk/transport-runtime-api.ts @@ -1,7 +1,4 @@ -import { - fetchWithRuntimeDispatcherOrMockedGlobal, - isMockedFetch, -} from "openclaw/plugin-sdk/runtime-fetch"; +import { fetchWithRuntimeDispatcherOrMockedGlobal } from "openclaw/plugin-sdk/runtime-fetch"; import { closeDispatcher, createPinnedDispatcher, @@ -15,7 +12,6 @@ export { closeDispatcher, createPinnedDispatcher, fetchWithRuntimeDispatcherOrMockedGlobal, - isMockedFetch, resolvePinnedHostnameWithPolicy, type PinnedDispatcherPolicy, type SsrFPolicy, diff --git a/extensions/matrix/src/matrix/sdk/types.ts b/extensions/matrix/src/matrix/sdk/types.ts index 6834ee5eaed..15b552f9949 100644 --- a/extensions/matrix/src/matrix/sdk/types.ts +++ b/extensions/matrix/src/matrix/sdk/types.ts @@ -130,7 +130,7 @@ export type MatrixDeviceVerificationStatusLike = { signedByOwner?: boolean; }; -export type MatrixKeyBackupInfo = { +type MatrixKeyBackupInfo = { algorithm: string; auth_data: Record; count?: number; @@ -138,24 +138,24 @@ export type MatrixKeyBackupInfo = { version?: string; }; -export type MatrixKeyBackupTrustInfo = { +type MatrixKeyBackupTrustInfo = { trusted: boolean; matchesDecryptionKey: boolean; }; -export type MatrixRoomKeyBackupRestoreResult = { +type MatrixRoomKeyBackupRestoreResult = { total: number; imported: number; }; -export type MatrixImportRoomKeyProgress = { +type MatrixImportRoomKeyProgress = { stage: string; successes?: number; failures?: number; total?: number; }; -export type MatrixSecretStorageKeyDescription = { +type MatrixSecretStorageKeyDescription = { passphrase?: unknown; name?: string; [key: string]: unknown; diff --git a/extensions/matrix/src/matrix/sdk/verification-status.ts b/extensions/matrix/src/matrix/sdk/verification-status.ts index ebaf62e0b27..41e22526ec2 100644 --- a/extensions/matrix/src/matrix/sdk/verification-status.ts +++ b/extensions/matrix/src/matrix/sdk/verification-status.ts @@ -1,6 +1,6 @@ import type { MatrixDeviceVerificationStatusLike } from "./types.js"; -export function isMatrixDeviceLocallyVerified( +function isMatrixDeviceLocallyVerified( status: MatrixDeviceVerificationStatusLike | null | undefined, ): boolean { return status?.localVerified === true; diff --git a/extensions/matrix/src/matrix/send/media.ts b/extensions/matrix/src/matrix/send/media.ts index 42db1ba234f..663d95e0712 100644 --- a/extensions/matrix/src/matrix/send/media.ts +++ b/extensions/matrix/src/matrix/send/media.ts @@ -18,7 +18,7 @@ import { const getCore = () => getMatrixRuntime(); -export function buildMatrixMediaInfo(params: { +function buildMatrixMediaInfo(params: { size: number; mimetype?: string; durationMs?: number; diff --git a/extensions/matrix/src/matrix/send/types.ts b/extensions/matrix/src/matrix/send/types.ts index e3bf69e7e47..78e7113fd95 100644 --- a/extensions/matrix/src/matrix/send/types.ts +++ b/extensions/matrix/src/matrix/send/types.ts @@ -51,7 +51,7 @@ export type MatrixThreadRelation = { export type MatrixRelation = MatrixReplyRelation | MatrixThreadRelation; -export type MatrixReplyMeta = { +type MatrixReplyMeta = { "m.relates_to"?: MatrixRelation; }; diff --git a/extensions/matrix/src/matrix/session-store-metadata.ts b/extensions/matrix/src/matrix/session-store-metadata.ts index 9663dbcba43..d6d926eaf46 100644 --- a/extensions/matrix/src/matrix/session-store-metadata.ts +++ b/extensions/matrix/src/matrix/session-store-metadata.ts @@ -1,7 +1,7 @@ import { normalizeAccountId } from "openclaw/plugin-sdk/account-id"; import { resolveMatrixDirectUserId, resolveMatrixTargetIdentity } from "./target-ids.js"; -export function trimMaybeString(value: unknown): string | undefined { +function trimMaybeString(value: unknown): string | undefined { if (typeof value !== "string") { return undefined; } @@ -18,12 +18,12 @@ function resolveMatrixRoomTargetId(value: unknown): string | undefined { return target?.kind === "room" && target.id.startsWith("!") ? target.id : undefined; } -export function resolveMatrixSessionAccountId(value: unknown): string | undefined { +function resolveMatrixSessionAccountId(value: unknown): string | undefined { const trimmed = trimMaybeString(value); return trimmed ? normalizeAccountId(trimmed) : undefined; } -export function resolveMatrixStoredRoomId(params: { +function resolveMatrixStoredRoomId(params: { deliveryTo?: unknown; lastTo?: unknown; originNativeChannelId?: unknown; diff --git a/extensions/matrix/src/matrix/thread-bindings-shared.ts b/extensions/matrix/src/matrix/thread-bindings-shared.ts index 0c6c32b376c..b570a2388b6 100644 --- a/extensions/matrix/src/matrix/thread-bindings-shared.ts +++ b/extensions/matrix/src/matrix/thread-bindings-shared.ts @@ -4,7 +4,7 @@ import type { } from "openclaw/plugin-sdk/thread-bindings-session-runtime"; import { resolveThreadBindingLifecycle } from "openclaw/plugin-sdk/thread-bindings-session-runtime"; -export type MatrixThreadBindingTargetKind = "subagent" | "acp"; +type MatrixThreadBindingTargetKind = "subagent" | "acp"; export type MatrixThreadBindingRecord = { accountId: string; @@ -44,7 +44,7 @@ export type MatrixThreadBindingManager = { stop: () => void; }; -export type MatrixThreadBindingManagerCacheEntry = { +type MatrixThreadBindingManagerCacheEntry = { filePath: string; manager: MatrixThreadBindingManager; }; diff --git a/extensions/matrix/src/migration-snapshot-backup.ts b/extensions/matrix/src/migration-snapshot-backup.ts index f2918a2c34e..65af25fb2ce 100644 --- a/extensions/matrix/src/migration-snapshot-backup.ts +++ b/extensions/matrix/src/migration-snapshot-backup.ts @@ -14,7 +14,7 @@ type MatrixMigrationSnapshotMarker = { includeWorkspace: boolean; }; -export type MatrixMigrationSnapshotResult = { +type MatrixMigrationSnapshotResult = { created: boolean; archivePath: string; markerPath: string; diff --git a/extensions/matrix/src/migration-snapshot.ts b/extensions/matrix/src/migration-snapshot.ts index 17a475187ad..37d0918556c 100644 --- a/extensions/matrix/src/migration-snapshot.ts +++ b/extensions/matrix/src/migration-snapshot.ts @@ -5,7 +5,6 @@ import { maybeCreateMatrixMigrationSnapshot, resolveMatrixMigrationSnapshotMarkerPath, resolveMatrixMigrationSnapshotOutputDir, - type MatrixMigrationSnapshotResult, } from "./migration-snapshot-backup.js"; export type MatrixMigrationStatus = { @@ -52,4 +51,3 @@ export { resolveMatrixMigrationSnapshotMarkerPath, resolveMatrixMigrationSnapshotOutputDir, }; -export type { MatrixMigrationSnapshotResult }; diff --git a/extensions/matrix/src/plugin-entry.runtime.ts b/extensions/matrix/src/plugin-entry.runtime.ts index 719f2d84e14..c3632f0cf8e 100644 --- a/extensions/matrix/src/plugin-entry.runtime.ts +++ b/extensions/matrix/src/plugin-entry.runtime.ts @@ -15,13 +15,6 @@ function sendError(respond: (ok: boolean, payload?: unknown) => void, err: unkno respond(false, { error: formatMatrixErrorMessage(err) }); } -export async function ensureMatrixCryptoRuntime( - ...args: Parameters -): Promise { - const { ensureMatrixCryptoRuntime: ensureRuntime } = await import("./matrix/deps.js"); - await ensureRuntime(...args); -} - export async function handleVerifyRecoveryKey({ params, respond, diff --git a/extensions/matrix/src/secret-contract.ts b/extensions/matrix/src/secret-contract.ts index bbfa49f7071..b2e3da3bdd8 100644 --- a/extensions/matrix/src/secret-contract.ts +++ b/extensions/matrix/src/secret-contract.ts @@ -7,7 +7,6 @@ import { normalizeSecretStringValue, type ResolverContext, type SecretDefaults, - type SecretTargetRegistryEntry, } from "openclaw/plugin-sdk/channel-secret-basic-runtime"; import { getMatrixScopedEnvVarNames } from "./env-vars.js"; @@ -56,7 +55,7 @@ export const secretTargetRegistryEntries = [ includeInConfigure: true, includeInAudit: true, }, -] satisfies SecretTargetRegistryEntry[]; +] satisfies import("openclaw/plugin-sdk/channel-secret-basic-runtime").SecretTargetRegistryEntry[]; export function collectRuntimeConfigAssignments(params: { config: { channels?: Record }; diff --git a/extensions/matrix/src/types.ts b/extensions/matrix/src/types.ts index 24832bcc59f..a6674adba0c 100644 --- a/extensions/matrix/src/types.ts +++ b/extensions/matrix/src/types.ts @@ -5,11 +5,10 @@ import type { OpenClawConfig, SecretInput, } from "./runtime-api.js"; -export type { ContextVisibilityMode, DmPolicy, GroupPolicy }; export type ReplyToMode = "off" | "first" | "all" | "batched"; -export type MatrixDmConfig = { +type MatrixDmConfig = { /** If false, ignore all incoming Matrix DMs. Default: true. */ enabled?: boolean; /** Direct message access policy (default: pairing). */ @@ -50,7 +49,7 @@ export type MatrixRoomConfig = { systemPrompt?: string; }; -export type MatrixActionConfig = { +type MatrixActionConfig = { reactions?: boolean; messages?: boolean; pins?: boolean; @@ -60,7 +59,7 @@ export type MatrixActionConfig = { verification?: boolean; }; -export type MatrixThreadBindingsConfig = { +type MatrixThreadBindingsConfig = { enabled?: boolean; idleHours?: number; maxAgeHours?: number; @@ -68,7 +67,7 @@ export type MatrixThreadBindingsConfig = { spawnAcpSessions?: boolean; }; -export type MatrixExecApprovalTarget = "dm" | "channel" | "both"; +type MatrixExecApprovalTarget = "dm" | "channel" | "both"; export type MatrixExecApprovalConfig = { /** If true, deliver exec approvals through Matrix-native prompts. */ @@ -94,7 +93,7 @@ export type MatrixStreamingConfig = { }; }; -export type MatrixNetworkConfig = { +type MatrixNetworkConfig = { /** Dangerous opt-in for trusted private/internal Matrix homeservers. */ dangerouslyAllowPrivateNetwork?: boolean; };