refactor(extensions): remove unused helper exports · openclaw/openclaw@58b77e7
vincentkoc
·
2026-06-18
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,6 @@ import "./test-runtime-mocks.js";
|
4 | 4 | |
5 | 5 | // Avoid exporting vitest mock types (TS2742 under pnpm + d.ts emit). |
6 | 6 | type EmbedBatchMock = Mock<(texts: string[]) => Promise<number[][]>>; |
7 | | -type EmbedQueryMock = Mock<() => Promise<number[]>>; |
8 | 7 | |
9 | 8 | const hoisted = vi.hoisted(() => ({ |
10 | 9 | embedBatch: vi.fn(async (texts: string[]) => texts.map(() => [0, 1, 0])), |
@@ -15,10 +14,6 @@ export function getEmbedBatchMock(): EmbedBatchMock {
|
15 | 14 | return hoisted.embedBatch; |
16 | 15 | } |
17 | 16 | |
18 | | -export function getEmbedQueryMock(): EmbedQueryMock { |
19 | | -return hoisted.embedQuery; |
20 | | -} |
21 | | - |
22 | 17 | export function resetEmbeddingMocks(): void { |
23 | 18 | hoisted.embedBatch.mockReset(); |
24 | 19 | hoisted.embedQuery.mockReset(); |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | // Memory Core plugin module implements manager sync control behavior. |
2 | 2 | import type { DatabaseSync } from "node:sqlite"; |
3 | 3 | import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime"; |
4 | | -import { |
5 | | -createSubsystemLogger, |
6 | | -type OpenClawConfig, |
7 | | -} from "openclaw/plugin-sdk/memory-core-host-engine-foundation"; |
| 4 | +import { createSubsystemLogger } from "openclaw/plugin-sdk/memory-core-host-engine-foundation"; |
8 | 5 | import type { MemorySyncProgressUpdate } from "openclaw/plugin-sdk/memory-core-host-engine-storage"; |
9 | 6 | |
10 | 7 | const log = createSubsystemLogger("memory"); |
@@ -166,25 +163,3 @@ export function enqueueMemoryTargetedSessionSync(
|
166 | 163 | } |
167 | 164 | return state.getQueuedSessionSync() ?? Promise.resolve(); |
168 | 165 | } |
169 | | - |
170 | | -export function createMemorySyncControlConfigForTests( |
171 | | -workspaceDir: string, |
172 | | -indexPath: string, |
173 | | -): OpenClawConfig { |
174 | | -return { |
175 | | -agents: { |
176 | | -defaults: { |
177 | | -workspace: workspaceDir, |
178 | | -memorySearch: { |
179 | | -provider: "openai", |
180 | | -model: "mock-embed", |
181 | | -store: { path: indexPath, vector: { enabled: false } }, |
182 | | -cache: { enabled: false }, |
183 | | -query: { minScore: 0, hybrid: { enabled: false } }, |
184 | | -sync: { watch: false, onSessionStart: false, onSearch: false }, |
185 | | -}, |
186 | | -}, |
187 | | -list: [{ id: "main", default: true }], |
188 | | -}, |
189 | | -} as OpenClawConfig; |
190 | | -} |
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | // Msteams plugin module implements bot framework service url behavior. |
2 | 2 | import { |
3 | | -buildHostnameAllowlistPolicyFromSuffixAllowlist, |
4 | 3 | isHttpsUrlAllowedByHostnameSuffixAllowlist, |
5 | 4 | normalizeHostnameSuffixAllowlist, |
6 | | -type SsrFPolicy, |
7 | 5 | } from "openclaw/plugin-sdk/ssrf-policy"; |
8 | 6 | |
9 | 7 | const DEFAULT_BOT_FRAMEWORK_SERVICE_URL_HOST_ALLOWLIST = [ |
@@ -22,16 +20,6 @@ export const BOT_FRAMEWORK_SERVICE_URL_HOST_ALLOWLIST = normalizeHostnameSuffixA
|
22 | 20 | DEFAULT_BOT_FRAMEWORK_SERVICE_URL_HOST_ALLOWLIST, |
23 | 21 | ); |
24 | 22 | |
25 | | -const serviceUrlSsrfPolicy = buildHostnameAllowlistPolicyFromSuffixAllowlist( |
26 | | -BOT_FRAMEWORK_SERVICE_URL_HOST_ALLOWLIST, |
27 | | -); |
28 | | - |
29 | | -if (!serviceUrlSsrfPolicy) { |
30 | | -throw new Error("Microsoft Teams Bot Framework serviceUrl allowlist is empty"); |
31 | | -} |
32 | | - |
33 | | -export const BOT_FRAMEWORK_SERVICE_URL_SSRF_POLICY: SsrFPolicy = serviceUrlSsrfPolicy; |
34 | | - |
35 | 23 | export function describeBotFrameworkServiceUrlHost(serviceUrl: string): string { |
36 | 24 | try { |
37 | 25 | const parsed = new URL(serviceUrl.trim()); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -132,18 +132,6 @@ function getOpenClawMediaDir(): string {
|
132 | 132 | return path.join(resolveOpenClawHome(), ".openclaw", "media"); |
133 | 133 | } |
134 | 134 | |
135 | | -// ---- Basic platform information ---- |
136 | | - |
137 | | -type PlatformType = "darwin" | "linux" | "win32" | "other"; |
138 | | - |
139 | | -export function getPlatform(): PlatformType { |
140 | | -const p = process.platform; |
141 | | -if (p === "darwin" || p === "linux" || p === "win32") { |
142 | | -return p; |
143 | | -} |
144 | | -return "other"; |
145 | | -} |
146 | | - |
147 | 135 | export function isWindows(): boolean { |
148 | 136 | return process.platform === "win32"; |
149 | 137 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。