refactor(channels): drop unused bootstrap exports · openclaw/openclaw@7cc66b5
vincentkoc
·
2026-06-19
·
via Recent Commits to openclaw:main
File tree
extensions/memory-core/src/memory
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | // Memory Core plugin module implements embedding mocks behavior. |
2 | | -import { vi, type Mock } from "vitest"; |
| 2 | +import { vi } from "vitest"; |
3 | 3 | import "./test-runtime-mocks.js"; |
4 | 4 | |
5 | | -// Avoid exporting vitest mock types (TS2742 under pnpm + d.ts emit). |
6 | | -type EmbedBatchMock = Mock<(texts: string[]) => Promise<number[][]>>; |
7 | | - |
8 | 5 | const hoisted = vi.hoisted(() => ({ |
9 | 6 | embedBatch: vi.fn(async (texts: string[]) => texts.map(() => [0, 1, 0])), |
10 | 7 | embedQuery: vi.fn(async () => [0, 1, 0]), |
11 | 8 | })); |
12 | 9 | |
13 | | -export function getEmbedBatchMock(): EmbedBatchMock { |
14 | | -return hoisted.embedBatch; |
15 | | -} |
16 | | - |
17 | 10 | export function resetEmbeddingMocks(): void { |
18 | 11 | hoisted.embedBatch.mockReset(); |
19 | 12 | hoisted.embedQuery.mockReset(); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -74,18 +74,6 @@ export function listBootstrapChannelPluginIds(): readonly string[] {
|
74 | 74 | return listBundledChannelPluginIdsForRoot(rootScope.cacheKey); |
75 | 75 | } |
76 | 76 | |
77 | | -/** |
78 | | - * Iterates bundled bootstrap channel plugins that can be loaded successfully. |
79 | | - */ |
80 | | -export function* iterateBootstrapChannelPlugins(): IterableIterator<ChannelPlugin> { |
81 | | -for (const id of listBootstrapChannelPluginIds()) { |
82 | | -const plugin = getBootstrapChannelPlugin(id); |
83 | | -if (plugin) { |
84 | | -yield plugin; |
85 | | -} |
86 | | -} |
87 | | -} |
88 | | - |
89 | 77 | /** |
90 | 78 | * Loads a bundled channel plugin for bootstrap, merging runtime and setup artifacts. |
91 | 79 | */ |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。