diff --git a/extensions/matrix/runtime-api.ts b/extensions/matrix/runtime-api.ts index f9079d7430a..a35a7ab07d0 100644 --- a/extensions/matrix/runtime-api.ts +++ b/extensions/matrix/runtime-api.ts @@ -1 +1,83 @@ -export * from "openclaw/plugin-sdk/matrix"; +export { + createActionGate, + jsonResult, + readNumberParam, + readReactionParams, + readStringParam, +} from "../../src/agents/tools/common.js"; +export type { ReplyPayload } from "../../src/auto-reply/types.js"; +export { + compileAllowlist, + resolveCompiledAllowlistMatch, +} from "../../src/channels/allowlist-match.js"; +export { mergeAllowlist, summarizeMapping } from "../../src/channels/allowlists/resolve-utils.js"; +export { resolveControlCommandGate } from "../../src/channels/command-gating.js"; +export type { NormalizedLocation } from "../../src/channels/location.js"; +export { formatLocationText, toLocationContext } from "../../src/channels/location.js"; +export { logInboundDrop, logTypingFailure } from "../../src/channels/logging.js"; +export type { AllowlistMatch } from "../../src/channels/plugins/allowlist-match.js"; +export { formatAllowlistMatchMeta } from "../../src/channels/plugins/allowlist-match.js"; +export { + buildChannelKeyCandidates, + resolveChannelEntryMatch, +} from "../../src/channels/plugins/channel-config.js"; +export { buildChannelConfigSchema } from "../../src/channels/plugins/config-schema.js"; +export { createAccountListHelpers } from "../../src/channels/plugins/account-helpers.js"; +export type { + BaseProbeResult, + ChannelDirectoryEntry, + ChannelGroupContext, + ChannelMessageActionAdapter, + ChannelMessageActionContext, + ChannelMessageActionName, + ChannelOutboundAdapter, + ChannelResolveKind, + ChannelResolveResult, + ChannelToolSend, +} from "../../src/channels/plugins/types.js"; +export type { ChannelPlugin } from "../../src/channels/plugins/types.plugin.js"; +export { createReplyPrefixOptions } from "../../src/channels/reply-prefix.js"; +export { createTypingCallbacks } from "../../src/channels/typing.js"; +export { + GROUP_POLICY_BLOCKED_LABEL, + resolveAllowlistProviderRuntimeGroupPolicy, + resolveDefaultGroupPolicy, + warnMissingProviderGroupPolicyFallbackOnce, +} from "../../src/config/runtime-group-policy.js"; +export type { + DmPolicy, + GroupPolicy, + GroupToolPolicyConfig, + MarkdownTableMode, +} from "../../src/config/types.js"; +export type { SecretInput } from "../../src/config/types.secrets.js"; +export { + hasConfiguredSecretInput, + normalizeResolvedSecretInputString, + normalizeSecretInputString, +} from "../../src/config/types.secrets.js"; +export { ToolPolicySchema } from "../../src/config/zod-schema.agent-runtime.js"; +export { MarkdownConfigSchema } from "../../src/config/zod-schema.core.js"; +export { fetchWithSsrFGuard } from "../../src/infra/net/fetch-guard.js"; +export { issuePairingChallenge } from "../../src/pairing/pairing-challenge.js"; +export type { PluginRuntime, RuntimeLogger } from "../../src/plugins/runtime/types.js"; +export { DEFAULT_ACCOUNT_ID } from "../../src/routing/session-key.js"; +export type { PollInput } from "../../src/polls.js"; +export { + readStoreAllowFromForDmPolicy, + resolveDmGroupAccessWithLists, +} from "../../src/security/dm-policy-shared.js"; +export { normalizeStringEntries } from "../../src/shared/string-normalization.js"; +export { + evaluateGroupRouteAccessForPolicy, + resolveSenderScopedGroupPolicy, +} from "../../src/plugin-sdk/group-access.js"; +export { createScopedPairingAccess } from "../../src/plugin-sdk/pairing-access.js"; +export { runPluginCommandWithTimeout } from "../../src/plugin-sdk/run-command.js"; +export { dispatchReplyFromConfigWithSettledDispatcher } from "../../src/plugin-sdk/inbound-reply-dispatch.js"; +export { resolveRuntimeEnv } from "../../src/plugin-sdk/runtime.js"; +export { resolveInboundSessionEnvelopeContext } from "../../src/channels/session-envelope.js"; +export { + buildProbeChannelStatusSummary, + collectStatusIssuesFromLastError, +} from "../../src/plugin-sdk/status-helpers.js"; diff --git a/extensions/matrix/src/runtime-api.test.ts b/extensions/matrix/src/runtime-api.test.ts new file mode 100644 index 00000000000..a3768fbaf4b --- /dev/null +++ b/extensions/matrix/src/runtime-api.test.ts @@ -0,0 +1,17 @@ +import { describe, expect, it } from "vitest"; +import * as runtimeApi from "../runtime-api.js"; + +describe("matrix runtime-api", () => { + it("re-exports createAccountListHelpers as a live runtime value", () => { + expect(typeof runtimeApi.createAccountListHelpers).toBe("function"); + + const helpers = runtimeApi.createAccountListHelpers("matrix"); + expect(typeof helpers.listAccountIds).toBe("function"); + expect(typeof helpers.resolveDefaultAccountId).toBe("function"); + }); + + it("does not re-export setup entrypoints that create extension cycles", () => { + expect("matrixSetupWizard" in runtimeApi).toBe(false); + expect("matrixSetupAdapter" in runtimeApi).toBe(false); + }); +});