mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-02 22:50:20 +00:00
fix(ci): restore typecheck on main
This commit is contained in:
@@ -10,6 +10,7 @@ import { resolveAgentModelPrimaryValue } from "../config/model-input.js";
|
||||
import { resolveSessionTranscriptsDirForAgent } from "../config/sessions.js";
|
||||
import { callGateway } from "../gateway/call.js";
|
||||
import { resolveControlUiLinks } from "../gateway/control-ui-links.js";
|
||||
import { normalizeControlUiBasePath } from "../gateway/control-ui-shared.js";
|
||||
import {
|
||||
detectBrowserOpenSupport,
|
||||
openUrl,
|
||||
|
||||
@@ -38,6 +38,8 @@ function getDefaultTableModes(): Map<string, MarkdownTableMode> {
|
||||
return cachedDefaultTableModes;
|
||||
}
|
||||
|
||||
export const DEFAULT_TABLE_MODES = getDefaultTableModes();
|
||||
|
||||
const isMarkdownTableMode = (value: unknown): value is MarkdownTableMode =>
|
||||
value === "off" || value === "bullets" || value === "code" || value === "block";
|
||||
|
||||
@@ -67,7 +69,7 @@ export function resolveMarkdownTableMode(params: {
|
||||
accountId?: string | null;
|
||||
}): MarkdownTableMode {
|
||||
const channel = normalizeChannelId(params.channel);
|
||||
const defaultMode = channel ? (getDefaultTableModes().get(channel) ?? "code") : "code";
|
||||
const defaultMode = channel ? (DEFAULT_TABLE_MODES.get(channel) ?? "code") : "code";
|
||||
if (!channel || !params.cfg) {
|
||||
return defaultMode;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { importFreshModule } from "../../test/helpers/import-fresh.ts";
|
||||
import type { BundledPluginMetadata } from "../plugins/bundled-plugin-metadata.js";
|
||||
|
||||
const listBundledPluginMetadataMock = vi.hoisted(() => vi.fn(() => []));
|
||||
const listBundledPluginMetadataMock = vi.hoisted(() =>
|
||||
vi.fn<(options?: unknown) => readonly BundledPluginMetadata[]>(() => []),
|
||||
);
|
||||
|
||||
describe("ChannelsSchema bundled runtime loading", () => {
|
||||
beforeEach(() => {
|
||||
listBundledPluginMetadataMock.mockClear();
|
||||
vi.doMock("../plugins/bundled-plugin-metadata.js", () => ({
|
||||
listBundledPluginMetadata: (...args: unknown[]) => listBundledPluginMetadataMock(...args),
|
||||
listBundledPluginMetadata: (options?: unknown) => listBundledPluginMetadataMock(options),
|
||||
}));
|
||||
});
|
||||
|
||||
@@ -48,7 +51,7 @@ describe("ChannelsSchema bundled runtime loading", () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as unknown as BundledPluginMetadata,
|
||||
]);
|
||||
|
||||
const runtime = await importFreshModule<typeof import("./zod-schema.providers.js")>(
|
||||
|
||||
@@ -8,6 +8,8 @@ import {
|
||||
doesApprovalRequestMatchChannelAccount,
|
||||
resolveApprovalRequestAccountId,
|
||||
resolveApprovalRequestChannelAccountId,
|
||||
} from "./approval-request-account-binding.js";
|
||||
import {
|
||||
resolveApprovalRequestOriginTarget,
|
||||
resolveExecApprovalSessionTarget,
|
||||
} from "./exec-approval-session-target.js";
|
||||
|
||||
Reference in New Issue
Block a user