refactor(plugins): remove unused session helpers · openclaw/openclaw@d1169c3
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,8 +7,6 @@ import {
|
7 | 7 | type ConfigMutationCommit, |
8 | 8 | type ConfigReplaceResult, |
9 | 9 | type ConfigMutationResult, |
10 | | -type ConfigMutationContext, |
11 | | -type ConfigTransformResult, |
12 | 10 | type TransformConfigFileWithRetryParams, |
13 | 11 | } from "../config/config.js"; |
14 | 12 | import type { ConfigWriteOptions } from "../config/io.js"; |
@@ -254,19 +252,3 @@ export async function transformConfigWithPendingPluginInstalls<T = void>(
|
254 | 252 | commit, |
255 | 253 | }); |
256 | 254 | } |
257 | | - |
258 | | -/** Mutating-draft adapter for config transforms that may contain pending plugin installs. */ |
259 | | -export async function mutateConfigWithPendingPluginInstalls<T = void>( |
260 | | -params: Omit<TransformConfigFileWithRetryParams<T>, "commit" | "transform"> & { |
261 | | -mutate: (draft: OpenClawConfig, context: ConfigMutationContext) => Promise<T | void> | T | void; |
262 | | -}, |
263 | | -): Promise<ConfigMutationResult<T>> { |
264 | | -return await transformConfigWithPendingPluginInstalls<T>({ |
265 | | - ...params, |
266 | | -transform: async (currentConfig, context): Promise<ConfigTransformResult<T>> => { |
267 | | -const draft = structuredClone(currentConfig); |
268 | | -const result = (await params.mutate(draft, context)) as T | undefined; |
269 | | -return { nextConfig: draft, result }; |
270 | | -}, |
271 | | -}); |
272 | | -} |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -398,26 +398,6 @@ export async function drainPluginNextTurnInjectionContext(params: {
|
398 | 398 | }; |
399 | 399 | } |
400 | 400 | |
401 | | -// oxlint-disable-next-line typescript/no-unnecessary-type-parameters -- Session-extension JSON reads are caller-typed by namespace. |
402 | | -export function getPluginSessionExtensionSync<T extends PluginJsonValue = PluginJsonValue>(params: { |
403 | | -cfg: OpenClawConfig; |
404 | | -pluginId: string; |
405 | | -sessionKey?: string; |
406 | | -namespace: string; |
407 | | -}): T | undefined { |
408 | | -const pluginId = params.pluginId.trim(); |
409 | | -const sessionKey = normalizeOptionalString(params.sessionKey); |
410 | | -const namespace = normalizeNamespace(params.namespace); |
411 | | -if (!pluginId || !sessionKey || !namespace) { |
412 | | -return undefined; |
413 | | -} |
414 | | -const loaded = loadPluginHostHookSessionEntry({ cfg: params.cfg, sessionKey }); |
415 | | -const value = loaded.entry?.pluginExtensions?.[pluginId]?.[namespace] as |
416 | | -| PluginJsonValue |
417 | | -| undefined; |
418 | | -return value as T | undefined; |
419 | | -} |
420 | | - |
421 | 401 | export function getPluginSessionExtensionStateSync(params: { |
422 | 402 | cfg: OpenClawConfig; |
423 | 403 | pluginId: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -215,7 +215,6 @@ describe("production lint suppressions", () => {
|
215 | 215 | "src/plugin-sdk/test-helpers/public-surface-loader.ts|typescript/no-unnecessary-type-parameters|1", |
216 | 216 | "src/plugin-sdk/test-helpers/subagent-hooks.ts|typescript/no-unnecessary-type-parameters|1", |
217 | 217 | "src/plugins/hooks.ts|typescript/no-unnecessary-type-parameters|1", |
218 | | -"src/plugins/host-hook-state.ts|typescript/no-unnecessary-type-parameters|1", |
219 | 218 | "src/plugins/host-hooks.ts|typescript/no-unnecessary-type-parameters|1", |
220 | 219 | "src/plugins/lazy-service-module.ts|typescript/no-unnecessary-type-parameters|1", |
221 | 220 | "src/plugins/public-surface-loader.ts|typescript/no-unnecessary-type-parameters|1", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。