Skip to content

Commit a15616b

Browse files
committed
refactor: delete dead post-landing plugin/hooks scaffolding
1 parent f1a87bf commit a15616b

7 files changed

Lines changed: 5 additions & 31 deletions

File tree

‎src/cli/hooks-cli.ts‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
type HookStatusReport,
2020
} from "../hooks/hooks-status.js";
2121
import { resolveHookEntries } from "../hooks/policy.js";
22-
import type { HookEntry } from "../hooks/types.js";
2322
import { loadWorkspaceHookEntries } from "../hooks/workspace.js";
2423
import { formatErrorMessage } from "../infra/errors.js";
2524
import { loadGatewayStartupPluginPlanWithMetadata } from "../plugins/channel-plugin-ids.js";
@@ -53,10 +52,6 @@ type HooksUpdateOptions = {
5352

5453
const GATEWAY_HOOKS_STATUS_TIMEOUT_MS = 1_500;
5554

56-
function mergeHookEntries(pluginEntries: HookEntry[], workspaceEntries: HookEntry[]): HookEntry[] {
57-
return resolveHookEntries([...pluginEntries, ...workspaceEntries]);
58-
}
59-
6055
function buildHooksReport(config: OpenClawConfig): HookStatusReport {
6156
// Plugin-managed and workspace hooks share one resolved policy view for status/actions.
6257
const workspaceDir = resolveAgentWorkspaceDir(config, resolveDefaultAgentId(config));
@@ -75,7 +70,7 @@ function buildHooksReport(config: OpenClawConfig): HookStatusReport {
7570
metadataSnapshot: startup.metadataSnapshot,
7671
});
7772
const pluginEntries = pluginReport.hooks.map((hook) => hook.entry);
78-
const entries = mergeHookEntries(pluginEntries, workspaceEntries);
73+
const entries = resolveHookEntries([...pluginEntries, ...workspaceEntries]);
7974
return buildWorkspaceHookStatus(workspaceDir, { config, entries });
8075
}
8176

‎src/plugin-sdk/browser-types.ts‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { SsrFPolicy } from "../infra/net/ssrf.js";
2+
13
/** Browser profile config embedded in resolved browser config. */
24
export type ResolvedBrowserProfileConfig = {
35
cdpPort?: number;
@@ -13,15 +15,7 @@ export type ResolvedBrowserProfileConfig = {
1315
};
1416

1517
/** SSRF policy embedded in resolved browser config. */
16-
export type ResolvedBrowserSsrFPolicy = {
17-
allowPrivateNetwork?: boolean;
18-
dangerouslyAllowPrivateNetwork?: boolean;
19-
allowRfc2544BenchmarkRange?: boolean;
20-
allowIpv6UniqueLocalRange?: boolean;
21-
allowedHostnames?: string[];
22-
allowedOrigins?: string[];
23-
hostnameAllowlist?: string[];
24-
};
18+
export type ResolvedBrowserSsrFPolicy = SsrFPolicy;
2519

2620
/** Resolved browser tab cleanup settings after defaults and config are applied. */
2721
export type ResolvedBrowserTabCleanupConfig = {

‎src/plugins/channel-plugin-ids.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ function createStartupConfig(params: {
498498
return config as OpenClawConfig;
499499
}
500500

501-
describe("resolveGatewayStartupPluginIds", () => {
501+
describe("resolveGatewayStartupPluginIdsFromRegistry", () => {
502502
beforeEach(() => {
503503
listPotentialConfiguredChannelIds.mockReset().mockImplementation((config: OpenClawConfig) => {
504504
if (Object.hasOwn(config, "channels")) {

‎src/plugins/channel-plugin-ids.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export {
2828
resolveGatewayStartupMetadataPluginIds,
2929
loadGatewayStartupPluginPlan,
3030
loadGatewayStartupPluginPlanWithMetadata,
31-
resolveGatewayStartupPluginIds,
3231
resolveGatewayStartupPluginPlanFromRegistry,
3332
resolveGatewayStartupPluginIdsFromRegistry,
3433
type GatewayStartupPluginPlan,

‎src/plugins/gateway-startup-plugin-ids.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ export {
2121
loadGatewayStartupPluginPlan,
2222
loadGatewayStartupPluginPlanWithMetadata,
2323
resolveChannelPluginIds,
24-
resolveGatewayStartupPluginIds,
2524
resolveGatewayStartupPluginIdsFromRegistry,
2625
} from "./gateway-startup-plugin-loader.js";

‎src/plugins/gateway-startup-plugin-loader.ts‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,3 @@ export function loadGatewayStartupPluginPlan(
107107
): GatewayStartupPluginPlan {
108108
return loadGatewayStartupPluginPlanWithMetadata(params).plan;
109109
}
110-
111-
export function resolveGatewayStartupPluginIds(params: {
112-
config: OpenClawConfig;
113-
activationSourceConfig?: OpenClawConfig;
114-
workspaceDir?: string;
115-
env: NodeJS.ProcessEnv;
116-
workerProviderIds?: readonly string[];
117-
platform?: NodeJS.Platform;
118-
ambientEnvTriggers?: AmbientEnvTriggerPolicy;
119-
}): string[] {
120-
return [...loadGatewayStartupPluginPlan(params).pluginIds];
121-
}

‎src/plugins/status.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ type PluginReportParams = {
208208
env?: NodeJS.ProcessEnv;
209209
logger?: PluginLogger;
210210
metadataSnapshot?: PluginMetadataSnapshot;
211-
resolvedConfig?: OpenClawConfig;
212211
};
213212

214213
function buildPluginReport(

0 commit comments

Comments
 (0)