fix: restore rebased full gate
This commit is contained in:
parent
b5d2123156
commit
861fcb1575
4
extensions/bluebubbles/runtime-api.ts
Normal file
4
extensions/bluebubbles/runtime-api.ts
Normal file
@ -0,0 +1,4 @@
|
||||
export {
|
||||
resolveBlueBubblesGroupRequireMention,
|
||||
resolveBlueBubblesGroupToolPolicy,
|
||||
} from "./src/group-policy.js";
|
||||
@ -3,7 +3,7 @@ import {
|
||||
resolveChannelGroupToolsPolicy,
|
||||
type GroupToolPolicyConfig,
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import type { OpenClawConfig } from "./runtime-api.js";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||
|
||||
type BlueBubblesGroupContext = {
|
||||
cfg: OpenClawConfig;
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
export {
|
||||
buildComputedAccountStatusSnapshot,
|
||||
buildTokenChannelStatusSummary,
|
||||
listDiscordDirectoryGroupsFromConfig,
|
||||
listDiscordDirectoryPeersFromConfig,
|
||||
PAIRING_APPROVED_MESSAGE,
|
||||
projectCredentialSnapshotFields,
|
||||
resolveConfiguredFromCredentialStatuses,
|
||||
@ -12,6 +14,7 @@ export {
|
||||
readNumberParam,
|
||||
readStringArrayParam,
|
||||
readStringParam,
|
||||
resolvePollMaxSelections,
|
||||
type ActionGate,
|
||||
type ChannelPlugin,
|
||||
type OpenClawConfig,
|
||||
@ -19,9 +22,11 @@ export {
|
||||
export { DiscordConfigSchema } from "openclaw/plugin-sdk/discord-core";
|
||||
export { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
||||
export {
|
||||
listDiscordDirectoryGroupsFromConfig,
|
||||
listDiscordDirectoryPeersFromConfig,
|
||||
} from "./directory-config.js";
|
||||
assertMediaNotDataUrl,
|
||||
parseAvailableTags,
|
||||
readReactionParams,
|
||||
withNormalizedTimestamp,
|
||||
} from "openclaw/plugin-sdk/discord-core";
|
||||
export {
|
||||
createHybridChannelConfigAdapter,
|
||||
createScopedChannelConfigAdapter,
|
||||
@ -41,13 +46,6 @@ export type {
|
||||
ChannelMessageActionName,
|
||||
} from "openclaw/plugin-sdk/channel-runtime";
|
||||
export type { DiscordConfig } from "openclaw/plugin-sdk/discord";
|
||||
export {
|
||||
assertMediaNotDataUrl,
|
||||
parseAvailableTags,
|
||||
readReactionParams,
|
||||
resolvePollMaxSelections,
|
||||
withNormalizedTimestamp,
|
||||
} from "openclaw/plugin-sdk/discord-core";
|
||||
export type { DiscordAccountConfig, DiscordActionConfig } from "openclaw/plugin-sdk/discord";
|
||||
export {
|
||||
hasConfiguredSecretInput,
|
||||
|
||||
@ -84,7 +84,11 @@ import {
|
||||
import { runWithReconnect } from "./reconnect.js";
|
||||
import { deliverMattermostReplyPayload } from "./reply-delivery.js";
|
||||
import { sendMessageMattermost } from "./send.js";
|
||||
import { cleanupSlashCommands } from "./slash-commands.js";
|
||||
import {
|
||||
cleanupSlashCommands,
|
||||
isSlashCommandsEnabled,
|
||||
resolveSlashCommandConfig,
|
||||
} from "./slash-commands.js";
|
||||
import { deactivateSlashCommands, getSlashCommandState } from "./slash-state.js";
|
||||
|
||||
export {
|
||||
@ -269,6 +273,7 @@ export async function monitorMattermostProvider(opts: MonitorMattermostOpts = {}
|
||||
const botUserId = botUser.id;
|
||||
const botUsername = botUser.username?.trim() || undefined;
|
||||
runtime.log?.(`mattermost connected as ${botUsername ? `@${botUsername}` : botUserId}`);
|
||||
const slashEnabled = isSlashCommandsEnabled(resolveSlashCommandConfig(account.config.commands));
|
||||
|
||||
await registerMattermostMonitorSlashCommands({
|
||||
client,
|
||||
|
||||
@ -201,22 +201,9 @@ async function expectSlackSendRejected(params: Record<string, unknown>, error: R
|
||||
|
||||
beforeEach(async () => {
|
||||
vi.resetModules();
|
||||
<<<<<<< HEAD
|
||||
({ discordMessageActions } =
|
||||
await import("../../../../extensions/discord/src/channel-actions.js"));
|
||||
({ handleDiscordMessageAction } =
|
||||
await import("../../../../extensions/discord/src/actions/handle-action.js"));
|
||||
({ telegramMessageActions } =
|
||||
await import("../../../../extensions/telegram/src/channel-actions.js"));
|
||||
||||||| parent of 69827439b1 (fix: stabilize rebased full gate)
|
||||
({ discordMessageActions } = await import("./discord.js"));
|
||||
({ handleDiscordMessageAction } = await import("./discord/handle-action.js"));
|
||||
({ telegramMessageActions } = await import("./telegram.js"));
|
||||
=======
|
||||
({ discordMessageActions } = await import("../../../../extensions/discord/runtime-api.js"));
|
||||
({ handleDiscordMessageAction } = await import("./discord/handle-action.js"));
|
||||
({ telegramMessageActions } = await import("../../../../extensions/telegram/runtime-api.js"));
|
||||
>>>>>>> 69827439b1 (fix: stabilize rebased full gate)
|
||||
({ signalMessageActions } = await import("../../../../extensions/signal/src/message-actions.js"));
|
||||
({ createSlackActions } = await import("../../../../extensions/slack/src/channel-actions.js"));
|
||||
vi.clearAllMocks();
|
||||
|
||||
@ -2,7 +2,9 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { PluginCompatibilityNotice } from "../plugins/status.js";
|
||||
|
||||
const readConfigFileSnapshot = vi.fn();
|
||||
const buildPluginCompatibilityNotices = vi.fn((): PluginCompatibilityNotice[] => []);
|
||||
const buildPluginCompatibilityNotices = vi.fn<(_params?: unknown) => PluginCompatibilityNotice[]>(
|
||||
() => [],
|
||||
);
|
||||
|
||||
vi.mock("../config/config.js", () => ({
|
||||
readConfigFileSnapshot,
|
||||
|
||||
@ -1,12 +1,6 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { MsgContext } from "../auto-reply/templating.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import {
|
||||
buildProviderRegistry,
|
||||
createMediaAttachmentCache,
|
||||
normalizeMediaAttachments,
|
||||
runCapability,
|
||||
} from "./runner.js";
|
||||
|
||||
const catalog = [
|
||||
{
|
||||
@ -17,17 +11,34 @@ const catalog = [
|
||||
},
|
||||
];
|
||||
|
||||
const loadModelCatalog = vi.hoisted(() => vi.fn(async () => catalog));
|
||||
|
||||
vi.mock("../agents/model-catalog.js", async () => {
|
||||
const actual = await vi.importActual<typeof import("../agents/model-catalog.js")>(
|
||||
"../agents/model-catalog.js",
|
||||
);
|
||||
return {
|
||||
...actual,
|
||||
loadModelCatalog: vi.fn(async () => catalog),
|
||||
loadModelCatalog,
|
||||
};
|
||||
});
|
||||
|
||||
let buildProviderRegistry: typeof import("./runner.js").buildProviderRegistry;
|
||||
let createMediaAttachmentCache: typeof import("./runner.js").createMediaAttachmentCache;
|
||||
let normalizeMediaAttachments: typeof import("./runner.js").normalizeMediaAttachments;
|
||||
let runCapability: typeof import("./runner.js").runCapability;
|
||||
|
||||
describe("runCapability image skip", () => {
|
||||
beforeEach(async () => {
|
||||
vi.resetModules();
|
||||
({
|
||||
buildProviderRegistry,
|
||||
createMediaAttachmentCache,
|
||||
normalizeMediaAttachments,
|
||||
runCapability,
|
||||
} = await import("./runner.js"));
|
||||
});
|
||||
|
||||
it("skips image understanding when the active model supports vision", async () => {
|
||||
const ctx: MsgContext = { MediaPath: "/tmp/image.png", MediaType: "image/png" };
|
||||
const media = normalizeMediaAttachments(ctx);
|
||||
|
||||
@ -28,7 +28,7 @@ export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
|
||||
export {
|
||||
resolveBlueBubblesGroupRequireMention,
|
||||
resolveBlueBubblesGroupToolPolicy,
|
||||
} from "../../extensions/bluebubbles/src/group-policy.js";
|
||||
} from "../../extensions/bluebubbles/runtime-api.js";
|
||||
export { formatPairingApproveHint } from "../channels/plugins/helpers.js";
|
||||
export { resolveChannelMediaMaxBytes } from "../channels/plugins/media-limits.js";
|
||||
export {
|
||||
|
||||
@ -46,5 +46,5 @@ export { mapAllowlistResolutionInputs } from "./allowlist-resolution.js";
|
||||
export {
|
||||
resolveBlueBubblesGroupRequireMention,
|
||||
resolveBlueBubblesGroupToolPolicy,
|
||||
} from "../../extensions/bluebubbles/src/group-policy.js";
|
||||
} from "../../extensions/bluebubbles/runtime-api.js";
|
||||
export { collectBlueBubblesStatusIssues } from "../channels/plugins/status-issues/bluebubbles.js";
|
||||
|
||||
@ -20,7 +20,7 @@ export {
|
||||
export { buildComputedAccountStatusSnapshot } from "./status-helpers.js";
|
||||
export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
|
||||
export { createAccountStatusSink, runPassiveAccountLifecycle } from "./channel-lifecycle.js";
|
||||
export { resolveGoogleChatGroupRequireMention } from "../../extensions/googlechat/src/group-policy.js";
|
||||
export { resolveGoogleChatGroupRequireMention } from "../../extensions/googlechat/runtime-api.js";
|
||||
export { formatPairingApproveHint } from "../channels/plugins/helpers.js";
|
||||
export { resolveChannelMediaMaxBytes } from "../channels/plugins/media-limits.js";
|
||||
export {
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
// Public web-search registration helpers for provider plugins.
|
||||
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import type {
|
||||
WebSearchCredentialResolutionSource,
|
||||
WebSearchProviderPlugin,
|
||||
@ -8,22 +7,12 @@ import type {
|
||||
} from "../plugins/types.js";
|
||||
export { readNumberParam, readStringArrayParam, readStringParam } from "../agents/tools/common.js";
|
||||
export { resolveCitationRedirectUrl } from "../agents/tools/web-search-citation-redirect.js";
|
||||
export {
|
||||
getScopedCredentialValue,
|
||||
getTopLevelCredentialValue,
|
||||
resolveProviderWebSearchPluginConfig,
|
||||
setScopedCredentialValue,
|
||||
setProviderWebSearchPluginConfigValue,
|
||||
setTopLevelCredentialValue,
|
||||
} from "../agents/tools/web-search-provider-config.js";
|
||||
export type { SearchConfigRecord } from "../agents/tools/web-search-provider-common.js";
|
||||
export { resolveWebSearchProviderCredential } from "../agents/tools/web-search-provider-credentials.js";
|
||||
export { withTrustedWebToolsEndpoint } from "../agents/tools/web-guarded-fetch.js";
|
||||
export {
|
||||
buildSearchCacheKey,
|
||||
DEFAULT_SEARCH_COUNT,
|
||||
MAX_SEARCH_COUNT,
|
||||
FRESHNESS_TO_RECENCY,
|
||||
isoToPerplexityDate,
|
||||
MAX_SEARCH_COUNT,
|
||||
normalizeFreshness,
|
||||
normalizeToIsoDate,
|
||||
readCachedSearchPayload,
|
||||
@ -37,6 +26,17 @@ export {
|
||||
withTrustedWebSearchEndpoint,
|
||||
writeCachedSearchPayload,
|
||||
} from "../agents/tools/web-search-provider-common.js";
|
||||
export {
|
||||
getScopedCredentialValue,
|
||||
getTopLevelCredentialValue,
|
||||
resolveProviderWebSearchPluginConfig,
|
||||
setScopedCredentialValue,
|
||||
setProviderWebSearchPluginConfigValue,
|
||||
setTopLevelCredentialValue,
|
||||
} from "../agents/tools/web-search-provider-config.js";
|
||||
export type { SearchConfigRecord } from "../agents/tools/web-search-provider-common.js";
|
||||
export { resolveWebSearchProviderCredential } from "../agents/tools/web-search-provider-credentials.js";
|
||||
export { withTrustedWebToolsEndpoint } from "../agents/tools/web-guarded-fetch.js";
|
||||
export {
|
||||
DEFAULT_CACHE_TTL_MINUTES,
|
||||
DEFAULT_TIMEOUT_SECONDS,
|
||||
@ -51,7 +51,6 @@ export { enablePluginInConfig } from "../plugins/enable.js";
|
||||
export { formatCliCommand } from "../cli/command-format.js";
|
||||
export { wrapWebContent } from "../security/external-content.js";
|
||||
export type {
|
||||
OpenClawConfig,
|
||||
WebSearchCredentialResolutionSource,
|
||||
WebSearchProviderPlugin,
|
||||
WebSearchProviderToolDefinition,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user