mirror of https://github.com/openclaw/openclaw.git
refactor: narrow cron delivery target session imports
This commit is contained in:
parent
cef0f36931
commit
883a35a38c
|
|
@ -4,12 +4,18 @@ import type { OpenClawConfig } from "../../config/config.js";
|
|||
import { resetPluginRuntimeStateForTest, setActivePluginRegistry } from "../../plugins/runtime.js";
|
||||
import { createOutboundTestPlugin, createTestRegistry } from "../../test-utils/channel-plugins.js";
|
||||
|
||||
vi.mock("../../config/sessions.js", () => ({
|
||||
loadSessionStore: vi.fn().mockReturnValue({}),
|
||||
vi.mock("../../config/sessions/main-session.js", () => ({
|
||||
resolveAgentMainSessionKey: vi.fn().mockReturnValue("agent:test:main"),
|
||||
}));
|
||||
|
||||
vi.mock("../../config/sessions/paths.js", () => ({
|
||||
resolveStorePath: vi.fn().mockReturnValue("/tmp/test-store.json"),
|
||||
}));
|
||||
|
||||
vi.mock("../../config/sessions/store.js", () => ({
|
||||
loadSessionStore: vi.fn().mockReturnValue({}),
|
||||
}));
|
||||
|
||||
vi.mock("../../infra/outbound/channel-selection.js", () => ({
|
||||
resolveMessageChannelSelection: vi
|
||||
.fn()
|
||||
|
|
@ -25,13 +31,15 @@ vi.mock("../../pairing/pairing-store.js", () => ({
|
|||
}));
|
||||
|
||||
const mockedModuleIds = [
|
||||
"../../config/sessions.js",
|
||||
"../../config/sessions/main-session.js",
|
||||
"../../config/sessions/paths.js",
|
||||
"../../config/sessions/store.js",
|
||||
"../../infra/outbound/channel-selection.js",
|
||||
"../../infra/outbound/target-resolver.js",
|
||||
"../../pairing/pairing-store.js",
|
||||
];
|
||||
|
||||
import { loadSessionStore } from "../../config/sessions.js";
|
||||
import { loadSessionStore } from "../../config/sessions/store.js";
|
||||
import { resolveMessageChannelSelection } from "../../infra/outbound/channel-selection.js";
|
||||
import { maybeResolveIdLikeTarget } from "../../infra/outbound/target-resolver.js";
|
||||
import { readChannelAllowFromStoreSync } from "../../pairing/pairing-store.js";
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
import { getChannelPlugin } from "../../channels/plugins/index.js";
|
||||
import type { ChannelId } from "../../channels/plugins/types.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import {
|
||||
loadSessionStore,
|
||||
resolveAgentMainSessionKey,
|
||||
resolveStorePath,
|
||||
} from "../../config/sessions.js";
|
||||
import { resolveAgentMainSessionKey } from "../../config/sessions/main-session.js";
|
||||
import { resolveStorePath } from "../../config/sessions/paths.js";
|
||||
import { loadSessionStore } from "../../config/sessions/store.js";
|
||||
import { resolveMessageChannelSelection } from "../../infra/outbound/channel-selection.js";
|
||||
import { maybeResolveIdLikeTarget } from "../../infra/outbound/target-resolver.js";
|
||||
import type { OutboundChannel } from "../../infra/outbound/targets.js";
|
||||
|
|
|
|||
Loading…
Reference in New Issue