mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-24 07:01:49 +00:00
fix(extensions): bypass stale doctor runtime exports
This commit is contained in:
@@ -3,7 +3,11 @@ import type {
|
||||
ChannelDoctorLegacyConfigRule,
|
||||
} from "openclaw/plugin-sdk/channel-contract";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||
import * as runtimeDoctor from "openclaw/plugin-sdk/runtime-doctor";
|
||||
import {
|
||||
hasLegacyAccountStreamingAliases,
|
||||
normalizeLegacyDmAliases,
|
||||
normalizeLegacyStreamingAliases,
|
||||
} from "../../../src/config/channel-compat-normalization.js";
|
||||
import { resolveDiscordPreviewStreamMode } from "./preview-streaming.js";
|
||||
|
||||
function asObjectRecord(value: unknown): Record<string, unknown> | null {
|
||||
@@ -139,8 +143,7 @@ export const legacyConfigRules: ChannelDoctorLegacyConfigRule[] = [
|
||||
path: ["channels", "discord", "accounts"],
|
||||
message:
|
||||
"channels.discord.accounts.<id>.streamMode, streaming (scalar), chunkMode, blockStreaming, draftChunk, and blockStreamingCoalesce are legacy; use channels.discord.accounts.<id>.streaming.{mode,chunkMode,preview.chunk,block.enabled,block.coalesce}.",
|
||||
match: (value) =>
|
||||
runtimeDoctor.hasLegacyAccountStreamingAliases(value, hasLegacyDiscordStreamingAliases),
|
||||
match: (value) => hasLegacyAccountStreamingAliases(value, hasLegacyDiscordStreamingAliases),
|
||||
},
|
||||
{
|
||||
path: ["channels", "discord", "voice", "tts"],
|
||||
@@ -171,7 +174,7 @@ export function normalizeCompatibilityConfig({
|
||||
let changed = false;
|
||||
const shouldPromoteRootDmAllowFrom = !asObjectRecord(updated.accounts);
|
||||
|
||||
const dm = runtimeDoctor.normalizeLegacyDmAliases({
|
||||
const dm = normalizeLegacyDmAliases({
|
||||
entry: updated,
|
||||
pathPrefix: "channels.discord",
|
||||
changes,
|
||||
@@ -180,7 +183,7 @@ export function normalizeCompatibilityConfig({
|
||||
updated = dm.entry;
|
||||
changed = changed || dm.changed;
|
||||
|
||||
const streaming = runtimeDoctor.normalizeLegacyStreamingAliases({
|
||||
const streaming = normalizeLegacyStreamingAliases({
|
||||
entry: updated,
|
||||
pathPrefix: "channels.discord",
|
||||
changes,
|
||||
@@ -203,14 +206,14 @@ export function normalizeCompatibilityConfig({
|
||||
}
|
||||
let accountEntry = account;
|
||||
let accountChanged = false;
|
||||
const accountDm = runtimeDoctor.normalizeLegacyDmAliases({
|
||||
const accountDm = normalizeLegacyDmAliases({
|
||||
entry: accountEntry,
|
||||
pathPrefix: `channels.discord.accounts.${accountId}`,
|
||||
changes,
|
||||
});
|
||||
accountEntry = accountDm.entry;
|
||||
accountChanged = accountDm.changed;
|
||||
const accountStreaming = runtimeDoctor.normalizeLegacyStreamingAliases({
|
||||
const accountStreaming = normalizeLegacyStreamingAliases({
|
||||
entry: accountEntry,
|
||||
pathPrefix: `channels.discord.accounts.${accountId}`,
|
||||
changes,
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
hasLegacyStreamingAliases,
|
||||
normalizeLegacyDmAliases,
|
||||
normalizeLegacyStreamingAliases,
|
||||
} from "openclaw/plugin-sdk/runtime-doctor";
|
||||
} from "../../../src/config/channel-compat-normalization.js";
|
||||
import { resolveSlackNativeStreaming, resolveSlackStreamingMode } from "./streaming-compat.js";
|
||||
|
||||
function asObjectRecord(value: unknown): Record<string, unknown> | null {
|
||||
|
||||
@@ -3,7 +3,7 @@ import type {
|
||||
ChannelDoctorLegacyConfigRule,
|
||||
} from "openclaw/plugin-sdk/channel-contract";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||
import * as runtimeDoctor from "openclaw/plugin-sdk/runtime-doctor";
|
||||
import { hasLegacyAccountStreamingAliases } from "../../../src/config/channel-compat-normalization.js";
|
||||
import { resolveTelegramPreviewStreamMode } from "./preview-streaming.js";
|
||||
|
||||
function asObjectRecord(value: unknown): Record<string, unknown> | null {
|
||||
@@ -172,8 +172,7 @@ export const legacyConfigRules: ChannelDoctorLegacyConfigRule[] = [
|
||||
path: ["channels", "telegram", "accounts"],
|
||||
message:
|
||||
"channels.telegram.accounts.<id>.streamMode, streaming (scalar), chunkMode, blockStreaming, draftChunk, and blockStreamingCoalesce are legacy; use channels.telegram.accounts.<id>.streaming.{mode,chunkMode,preview.chunk,block.enabled,block.coalesce}.",
|
||||
match: (value) =>
|
||||
runtimeDoctor.hasLegacyAccountStreamingAliases(value, hasLegacyTelegramStreamingAliases),
|
||||
match: (value) => hasLegacyAccountStreamingAliases(value, hasLegacyTelegramStreamingAliases),
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user