docs: document messaging extension sources

This commit is contained in:
Peter Steinberger
2026-06-04 22:02:52 -04:00
parent 7ac1eeb122
commit efd1a9ace6
918 changed files with 918 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
// Matrix API module exposes the plugin public contract.
export { matrixPlugin } from "./src/channel.js";
export { createMatrixSetupWizardProxy, matrixSetupAdapter } from "./src/setup-core.js";
export { matrixOnboardingAdapter } from "./src/setup-surface.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements auth presence behavior.
import fs from "node:fs";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements cli metadata behavior.
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
import { registerMatrixCliMetadata } from "./src/cli-metadata.js";

View File

@@ -1,3 +1,4 @@
// Matrix API module exposes the plugin public contract.
export {
createMatrixThreadBindingManager,
resetMatrixThreadBindingsForTests,

View File

@@ -1 +1,2 @@
// Matrix API module exposes the plugin public contract.
export { normalizeCompatibilityConfig, legacyConfigRules } from "./src/doctor-contract.js";

View File

@@ -1,3 +1,4 @@
// Matrix API module exposes the plugin public contract.
export * from "./src/account-selection.js";
export * from "./src/env-vars.js";
export * from "./src/storage-paths.js";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover index plugin behavior.
import { createTestPluginApi } from "openclaw/plugin-sdk/plugin-test-api";
import { describe, expect, it, vi } from "vitest";
import { registerMatrixCliMetadata } from "./cli-metadata.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin entrypoint registers its OpenClaw integration.
import {
defineBundledChannelEntry,
type OpenClawPluginApi,

View File

@@ -1 +1,2 @@
// Matrix plugin module implements plugin entry.handlers behavior.
export * from "./src/plugin-entry.runtime.ts";

View File

@@ -1,3 +1,4 @@
// Matrix API module exposes the plugin public contract.
export {
type MatrixResolvedStringField,
type MatrixResolvedStringValues,

View File

@@ -1 +1,2 @@
// Matrix API module exposes the plugin public contract.
export * from "./src/matrix-migration.runtime.js";

View File

@@ -1,3 +1,4 @@
// Matrix API module exposes the plugin public contract.
export {
channelSecrets,
collectRuntimeConfigAssignments,

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements setup entry behavior.
import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
export default defineBundledChannelSetupEntry({

View File

@@ -1,3 +1,4 @@
// Matrix tests cover account selection plugin behavior.
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import { describe, expect, it } from "vitest";
import {

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements account selection behavior.
import {
listCombinedAccountIds,
listConfiguredAccountIds,

View File

@@ -1,3 +1,4 @@
// Matrix tests cover actions.account propagation plugin behavior.
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { ChannelMessageActionContext } from "../runtime-api.js";
import type { CoreConfig } from "./types.js";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover actions plugin behavior.
import { beforeEach, describe, expect, it } from "vitest";
import type { PluginRuntime } from "../runtime-api.js";
import { matrixMessageActions } from "./actions.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements actions behavior.
import {
createActionGate,
readPositiveIntegerParam,

View File

@@ -1,3 +1,4 @@
// Matrix tests cover approval auth plugin behavior.
import { describe, expect, it } from "vitest";
import { matrixApprovalAuth } from "./approval-auth.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements approval auth behavior.
import {
createResolvedApproverActionAuthAdapter,
resolveApprovalApprovers,

View File

@@ -1,3 +1,4 @@
// Matrix tests cover approval handler plugin behavior.
import type {
ExecApprovalRequest,
PluginApprovalRequest,

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements approval handler behavior.
import { setTimeout as sleep } from "node:timers/promises";
import type {
ChannelApprovalCapabilityHandlerContext,

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements approval ids behavior.
import { normalizeMatrixUserId } from "./matrix/monitor/allowlist.js";
export function normalizeMatrixApproverId(value: string | number): string | undefined {

View File

@@ -1,3 +1,4 @@
// Matrix tests cover approval native plugin behavior.
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import { describe, expect, it } from "vitest";
import { matrixApprovalCapability } from "./approval-native.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements approval native behavior.
import {
createChannelApprovalCapability,
createApproverRestrictedNativeApprovalCapability,

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements approval reaction auth behavior.
import { resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
import { normalizeMatrixApproverId } from "./approval-ids.js";
import { resolveMatrixAccount } from "./matrix/accounts.js";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover approval reactions plugin behavior.
import { afterEach, describe, expect, it, vi } from "vitest";
import {
buildMatrixApprovalReactionHint,

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements approval reactions behavior.
import type { ExecApprovalReplyDecision } from "openclaw/plugin-sdk/approval-runtime";
import { getOptionalMatrixRuntime } from "./runtime.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements auth precedence behavior.
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
export type MatrixResolvedStringField =

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements channel account paths behavior.
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
import type { PinnedDispatcherPolicy, SsrFPolicy } from "openclaw/plugin-sdk/ssrf-dispatcher";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover channel.account paths plugin behavior.
import { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createMatrixPairingText, createMatrixProbeAccount } from "./channel-account-paths.js";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover channelirectory plugin behavior.
import { createRuntimeEnv } from "openclaw/plugin-sdk/plugin-test-runtime";
import { beforeEach, describe, expect, it } from "vitest";
import type { RuntimeEnv } from "../runtime-api.js";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover channel.message adapter plugin behavior.
import {
verifyChannelMessageAdapterCapabilityProofs,
verifyChannelMessageLiveCapabilityAdapterProofs,

View File

@@ -1,3 +1,4 @@
// Matrix tests cover channel.resolve plugin behavior.
import { createNonExitingRuntimeEnv } from "openclaw/plugin-sdk/plugin-test-runtime";
import { beforeEach, describe, expect, it, vi } from "vitest";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements channel behavior.
import { listMatrixDirectoryGroupsLive, listMatrixDirectoryPeersLive } from "./directory-live.js";
import { resolveMatrixAuth } from "./matrix/client.js";
import { probeMatrix } from "./matrix/probe.js";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover channel.setup plugin behavior.
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { RuntimeEnv } from "../runtime-api.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements channel.setup behavior.
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
import type { ChannelPlugin } from "openclaw/plugin-sdk/channel-core";
import { matrixConfigAdapter } from "./config-adapter.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements channel behavior.
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
import {
adaptScopedAccountAccessor,

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements cli metadata behavior.
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/channel-plugin-common";
export function registerMatrixCliMetadata(api: OpenClawPluginApi) {

View File

@@ -1,3 +1,4 @@
// Matrix tests cover cli plugin behavior.
import { Command } from "commander";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { registerMatrixCli, resetMatrixCliStateForTests } from "./cli.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements cli behavior.
import type { Command } from "commander";
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
import { parseStrictInteger, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";

View File

@@ -1,3 +1,4 @@
// Matrix helper module supports config adapter behavior.
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
import {
adaptScopedAccountAccessor,

View File

@@ -1,3 +1,4 @@
// Matrix tests cover config schema plugin behavior.
import { describe, expect, it } from "vitest";
import { MatrixConfigSchema } from "./config-schema.js";

View File

@@ -1,3 +1,4 @@
// Matrix helper module supports config schema behavior.
import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-primitives";
import {
AllowFromListSchema,

View File

@@ -1,3 +1,4 @@
// Matrix helper module supports config ui hints behavior.
import type { ChannelConfigUiHint } from "openclaw/plugin-sdk/channel-core";
export const matrixChannelConfigUiHints = {

View File

@@ -1,3 +1,4 @@
// Matrix tests cover directory live plugin behavior.
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
const { matrixAuthedHttpClientCtorMock, requestJsonMock } = vi.hoisted(() => ({

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements directory live behavior.
import {
normalizeLowercaseStringOrEmpty,
normalizeOptionalString,

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements doctor contract behavior.
import type {
ChannelDoctorConfigMutation,
ChannelDoctorLegacyConfigRule,

View File

@@ -1,3 +1,4 @@
// Matrix tests cover doctor plugin behavior.
import fs from "node:fs/promises";
import { tmpdir } from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements doctor behavior.
import type { ChannelDoctorAdapter } from "openclaw/plugin-sdk/channel-contract";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import {

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements env vars behavior.
import { normalizeAccountId, normalizeOptionalAccountId } from "openclaw/plugin-sdk/account-id";
const MATRIX_SCOPED_ENV_SUFFIXES = [

View File

@@ -1,3 +1,4 @@
// Matrix tests cover exec approval resolver plugin behavior.
import { beforeEach, describe, expect, it, vi } from "vitest";
const approvalRuntimeHoisted = vi.hoisted(() => ({

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements exec approval resolver behavior.
import { resolveApprovalOverGateway } from "openclaw/plugin-sdk/approval-gateway-runtime";
import type { ExecApprovalReplyDecision } from "openclaw/plugin-sdk/approval-runtime";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover exec approvals plugin behavior.
import fs from "node:fs";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements exec approvals behavior.
import { resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
import {
createChannelExecApprovalProfile,

View File

@@ -1,3 +1,4 @@
// Matrix tests cover group mentions plugin behavior.
import { describe, expect, it } from "vitest";
import { resolveMatrixGroupToolPolicy } from "./group-mentions.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements group mentions behavior.
import { resolveMatrixAccountConfig } from "./matrix/accounts.js";
import { resolveMatrixRoomConfig } from "./matrix/monitor/rooms.js";
import { normalizeMatrixResolvableTarget } from "./matrix/target-ids.js";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover legacy crypto inspector availability plugin behavior.
import path from "node:path";
import { beforeEach, describe, expect, it, vi } from "vitest";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements legacy crypto inspector availability behavior.
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover legacy crypto plugin behavior.
import fs from "node:fs";
import path from "node:path";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements legacy crypto behavior.
import fs from "node:fs";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover legacy state plugin behavior.
import fs from "node:fs";
import path from "node:path";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements legacy state behavior.
import fs from "node:fs";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements matrix migration behavior.
export { autoMigrateLegacyMatrixState, detectLegacyMatrixState } from "./legacy-state.js";
export { autoPrepareLegacyMatrixCrypto, detectLegacyMatrixCrypto } from "./legacy-crypto.js";
export {

View File

@@ -1,3 +1,4 @@
// Matrix helper module supports account config behavior.
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
import {

View File

@@ -1,3 +1,4 @@
// Matrix tests cover accounts.readiness plugin behavior.
import { describe, expect, it } from "vitest";
import { installMatrixTestRuntime } from "../test-runtime.js";
import type { CoreConfig } from "../types.js";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover accounts plugin behavior.
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { getMatrixScopedEnvVarNames } from "../env-vars.js";
import type { CoreConfig } from "../types.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements accounts behavior.
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input-runtime";
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements actions behavior.
export type {
MatrixActionClientOpts,
MatrixMessageSummary,

View File

@@ -1,3 +1,4 @@
// Matrix tests cover client plugin behavior.
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import {
createMockMatrixClient,

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements client behavior.
import { withResolvedRuntimeMatrixClient } from "../client-bootstrap.js";
import { resolveMatrixRoomId } from "../send.js";
import type { MatrixActionClient, MatrixActionClientOpts } from "./types.js";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover devices plugin behavior.
import { beforeEach, describe, expect, it, vi } from "vitest";
const withResolvedActionClientMock = vi.fn();

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements devices behavior.
import { summarizeMatrixDeviceHealth } from "../device-health.js";
import { withResolvedActionClient } from "./client.js";
import type { MatrixActionClientOpts } from "./types.js";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover limits plugin behavior.
import { describe, expect, it } from "vitest";
import { resolveMatrixActionLimit } from "./limits.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements limits behavior.
import { resolveIntegerOption } from "openclaw/plugin-sdk/number-runtime";
export function resolveMatrixActionLimit(raw: unknown, fallback: number): number {

View File

@@ -1,3 +1,4 @@
// Matrix tests cover messages plugin behavior.
import { describe, expect, it, vi } from "vitest";
import { setMatrixRuntime } from "../../runtime.js";
import type { MatrixClient } from "../sdk.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements messages behavior.
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
import { fetchMatrixPollMessageSummary, resolveMatrixPollRootEventId } from "../poll-summary.js";
import { isPollEventType } from "../poll-types.js";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover pins plugin behavior.
import { describe, expect, it, vi } from "vitest";
import type { MatrixClient } from "../sdk.js";
import { listMatrixPins, pinMatrixMessage, unpinMatrixMessage } from "./pins.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements pins behavior.
import { withResolvedRoomAction } from "./client.js";
import { fetchEventSummary, readPinnedEvents } from "./summary.js";
import {

View File

@@ -1,3 +1,4 @@
// Matrix tests cover polls plugin behavior.
import { describe, expect, it, vi } from "vitest";
import type { MatrixClient } from "../sdk.js";
import { voteMatrixPoll } from "./polls.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements polls behavior.
import { uniqueStrings, uniqueValues } from "openclaw/plugin-sdk/string-coerce-runtime";
import {
buildPollResponseContent,

View File

@@ -1,3 +1,4 @@
// Matrix tests cover profile plugin behavior.
import { beforeEach, describe, expect, it, vi } from "vitest";
const loadWebMediaMock = vi.fn();

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements profile behavior.
import { getMatrixRuntime } from "../../runtime.js";
import { syncMatrixOwnProfile, type MatrixProfileSyncResult } from "../profile.js";
import { withResolvedActionClient } from "./client.js";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover reactions plugin behavior.
import { describe, expect, it, vi } from "vitest";
import type { MatrixClient } from "../sdk.js";
import { listMatrixReactions, removeMatrixReactions } from "./reactions.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements reactions behavior.
import {
buildMatrixReactionRelationsPath,
selectOwnMatrixReactionEventIds,

View File

@@ -1,3 +1,4 @@
// Matrix tests cover room plugin behavior.
import { describe, expect, it, vi } from "vitest";
import type { MatrixClient } from "../sdk.js";
import { getMatrixMemberInfo, getMatrixRoomInfo } from "./room.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements room behavior.
import { resolveMatrixRoomId } from "../send.js";
import { withResolvedActionClient, withResolvedRoomAction } from "./client.js";
import { EventType, type MatrixActionClientOpts } from "./types.js";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover summary plugin behavior.
import { describe, expect, it } from "vitest";
import { summarizeMatrixRawEvent } from "./summary.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements summary behavior.
import { isMatrixNotFoundError } from "../errors.js";
import { resolveMatrixMessageAttachment, resolveMatrixMessageBody } from "../media-text.js";
import { fetchMatrixPollMessageSummary } from "../poll-summary.js";

View File

@@ -1,3 +1,4 @@
// Matrix type declarations define plugin contracts.
import type { CoreConfig } from "../../types.js";
import { MATRIX_REACTION_EVENT_TYPE } from "../reaction-common.js";
import type { MatrixClient, MessageEventContent } from "../sdk.js";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover verification plugin behavior.
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
const withResolvedActionClientMock = vi.fn();

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements verification behavior.
import { setTimeout as sleep } from "node:timers/promises";
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements active client behavior.
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
import type { MatrixClient } from "./sdk.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements async lock behavior.
export type AsyncLock = <T>(fn: () => Promise<T>) => Promise<T>;
export function createAsyncLock(): AsyncLock {

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements backup health behavior.
type MatrixRoomKeyBackupStatusLike = {
serverVersion: string | null;
activeVersion: string | null;

View File

@@ -1,3 +1,4 @@
// Matrix tests cover client bootstrap plugin behavior.
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import {
createMockMatrixClient,

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements client bootstrap behavior.
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
import type { CoreConfig } from "../types.js";
import { getActiveMatrixClient } from "./active-client.js";

View File

@@ -1,3 +1,4 @@
// Matrix helper module supports client resolver helpers behavior.
import { expect, vi, type Mock } from "vitest";
import type { MatrixClient } from "./sdk.js";

View File

@@ -1,3 +1,4 @@
// Matrix tests cover client plugin behavior.
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { installMatrixTestRuntime } from "../test-runtime.js";
import type { CoreConfig } from "../types.js";

View File

@@ -1,3 +1,4 @@
// Matrix plugin module implements client behavior.
export type { MatrixAuth } from "./client/types.js";
export { isBunRuntime } from "./client/runtime.js";
export { getMatrixScopedEnvVarNames } from "../env-vars.js";

Some files were not shown because too many files have changed in this diff Show More