mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-20 21:23:23 +00:00
fix(ci): repair main tsgo regressions
This commit is contained in:
@@ -39,15 +39,16 @@ interface MockChild extends EventEmitter {
|
||||
function createMockChild(params?: { autoClose?: boolean; closeDelayMs?: number }): MockChild {
|
||||
const stdout = new EventEmitter();
|
||||
const stderr = new EventEmitter();
|
||||
const child = new EventEmitter();
|
||||
child.stdout = stdout;
|
||||
child.stderr = stderr;
|
||||
child.closeWith = (code = 0) => {
|
||||
child.emit("close", code);
|
||||
};
|
||||
child.kill = () => {
|
||||
// Let timeout rejection win in tests that simulate hung QMD commands.
|
||||
};
|
||||
const child: MockChild = Object.assign(new EventEmitter(), {
|
||||
stdout,
|
||||
stderr,
|
||||
closeWith: (code: number | null = 0) => {
|
||||
child.emit("close", code);
|
||||
},
|
||||
kill: () => {
|
||||
// Let timeout rejection win in tests that simulate hung QMD commands.
|
||||
},
|
||||
});
|
||||
if (params?.autoClose !== false) {
|
||||
const delayMs = params?.closeDelayMs ?? 0;
|
||||
if (delayMs <= 0) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { PluginManifestRegistry } from "../plugins/manifest-registry.js";
|
||||
import {
|
||||
rewriteUpdateFlagArgv,
|
||||
resolveMissingPluginCommandMessage,
|
||||
@@ -6,13 +7,23 @@ import {
|
||||
shouldUseRootHelpFastPath,
|
||||
} from "./run-main.js";
|
||||
|
||||
const memoryWikiCommandAliasRegistry = {
|
||||
const memoryWikiCommandAliasRegistry: PluginManifestRegistry = {
|
||||
plugins: [
|
||||
{
|
||||
id: "memory-wiki",
|
||||
channels: [],
|
||||
providers: [],
|
||||
cliBackends: [],
|
||||
skills: [],
|
||||
hooks: [],
|
||||
origin: "bundled",
|
||||
rootDir: "/tmp/memory-wiki",
|
||||
source: "bundled",
|
||||
manifestPath: "/tmp/memory-wiki/openclaw.plugin.json",
|
||||
commandAliases: [{ name: "wiki" }],
|
||||
},
|
||||
],
|
||||
diagnostics: [],
|
||||
};
|
||||
|
||||
describe("rewriteUpdateFlagArgv", () => {
|
||||
|
||||
@@ -783,9 +783,6 @@ async function runPostCorePluginUpdate(params: {
|
||||
async function continuePostCoreUpdateInFreshProcess(params: {
|
||||
root: string;
|
||||
channel: "stable" | "beta" | "dev";
|
||||
root: string;
|
||||
channel: "stable" | "beta" | "dev";
|
||||
opts: UpdateCommandOptions;
|
||||
opts: UpdateCommandOptions;
|
||||
}): Promise<boolean> {
|
||||
const entryPath = path.join(params.root, "dist", "entry.js");
|
||||
@@ -1170,7 +1167,6 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
||||
pluginsUpdatedInFreshProcess = await continuePostCoreUpdateInFreshProcess({
|
||||
root: postUpdateRoot,
|
||||
channel,
|
||||
resultMode: result.mode,
|
||||
opts,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,10 +28,10 @@ vi.mock("../logging/subsystem.js", () => ({
|
||||
}));
|
||||
|
||||
const { createGatewayCloseHandler } = await import("./server-close.js");
|
||||
type GatewayCloseHandlerParams = Parameters<typeof createGatewayCloseHandler>[0];
|
||||
type GatewayCloseClient = GatewayCloseHandlerParams["clients"] extends Set<infer T> ? T : never;
|
||||
|
||||
function createGatewayCloseTestDeps(
|
||||
overrides: Partial<Parameters<typeof createGatewayCloseHandler>[0]> = {},
|
||||
) {
|
||||
function createGatewayCloseTestDeps(overrides: Partial<GatewayCloseHandlerParams> = {}) {
|
||||
return {
|
||||
bonjourStop: null,
|
||||
tailscaleCleanup: null,
|
||||
@@ -54,8 +54,12 @@ function createGatewayCloseTestDeps(
|
||||
transcriptUnsub: null,
|
||||
lifecycleUnsub: null,
|
||||
chatRunState: { clear: vi.fn() },
|
||||
clients: new Set(),
|
||||
clients: new Set<GatewayCloseClient>(),
|
||||
configReloader: { stop: vi.fn(async () => undefined) },
|
||||
wss: {
|
||||
clients: new Set(),
|
||||
close: (cb: () => void) => cb(),
|
||||
} as never,
|
||||
httpServer: {
|
||||
close: (cb: (err?: Error | null) => void) => cb(null),
|
||||
closeIdleConnections: vi.fn(),
|
||||
@@ -96,7 +100,7 @@ describe("createGatewayCloseHandler", () => {
|
||||
transcriptUnsub: null,
|
||||
lifecycleUnsub,
|
||||
chatRunState: { clear: vi.fn() },
|
||||
clients: new Set(),
|
||||
clients: new Set<GatewayCloseClient>(),
|
||||
configReloader: { stop: vi.fn(async () => undefined) },
|
||||
wss: { close: (cb: () => void) => cb() } as never,
|
||||
httpServer: {
|
||||
|
||||
@@ -276,6 +276,7 @@ export function resolveChannelPluginIds(params: {
|
||||
|
||||
export function resolveConfiguredChannelPluginIds(params: {
|
||||
config: OpenClawConfig;
|
||||
activationSourceConfig?: OpenClawConfig;
|
||||
workspaceDir?: string;
|
||||
env: NodeJS.ProcessEnv;
|
||||
}): string[] {
|
||||
|
||||
Reference in New Issue
Block a user