Skip to content

Commit eb9318e

Browse files
committed
chore(deadcode): remove stale agent helper reexports
1 parent f80f4a8 commit eb9318e

8 files changed

Lines changed: 7 additions & 13 deletions

src/agents/agent-tools.policy.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import type { OpenClawConfig } from "../config/config.js";
1111
import { createWarnLogCapture } from "../logging/test-helpers/warn-log-capture.js";
1212
import {
1313
filterToolsByPolicy,
14-
isToolAllowedByPolicyName,
1514
resolveEffectiveToolPolicy,
1615
resolveGroupToolPolicy,
1716
resolveInheritedToolPolicyForSession,
1817
resolveSubagentToolPolicyForSession,
1918
resolveTrustedGroupId,
2019
} from "./agent-tools.policy.js";
2120
import { createStubTool } from "./test-helpers/agent-tool-stubs.js";
21+
import { isToolAllowedByPolicyName } from "./tool-policy-match.js";
2222

2323
vi.mock("../channels/plugins/session-conversation.js", () => ({
2424
resolveSessionConversation: ({ rawId }: { rawId: string }) => ({

src/agents/agent-tools.policy.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,5 +570,3 @@ export function resolveGroupToolPolicy(params: {
570570
});
571571
return pickSandboxToolPolicy(configTools);
572572
}
573-
574-
export { isToolAllowedByPolicies, isToolAllowedByPolicyName } from "./tool-policy-match.js";

src/agents/agent-tools.schema.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ import { runAgentLoop, type AgentEvent, type StreamFn } from "openclaw/plugin-sd
77
import { createAssistantMessageEventStream, validateToolArguments } from "openclaw/plugin-sdk/llm";
88
import { Type, type TSchema } from "typebox";
99
import { describe, expect, it, vi } from "vitest";
10+
import { normalizeToolParameterSchema } from "./agent-tools-parameter-schema.js";
1011
import {
1112
isToolWrappedWithBeforeToolCallHook,
1213
testing as beforeToolCallTesting,
1314
wrapToolWithBeforeToolCallHook,
1415
} from "./agent-tools.before-tool-call.js";
15-
import {
16-
normalizeToolParameterSchema,
17-
normalizeToolParameters,
18-
} from "./agent-tools.schema.js";
16+
import { normalizeToolParameters } from "./agent-tools.schema.js";
1917
import type { AnyAgentTool } from "./agent-tools.types.js";
2018

2119
const TEST_USAGE = {

src/agents/agent-tools.schema.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import type { AnyAgentTool } from "./agent-tools.types.js";
1313
import { copyChannelAgentToolMeta } from "./channel-tools.js";
1414
import { copyToolTerminalPresentation } from "./tool-terminal-presentation.js";
1515

16-
export { normalizeToolParameterSchema };
17-
1816
function isObjectSchemaWithNoRequiredParams(schema: unknown): boolean {
1917
if (!schema || typeof schema !== "object" || Array.isArray(schema)) {
2018
return false;

src/agents/agent-tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import {
3939
import { applyDeferredFollowupToolDescriptions } from "./agent-tools.deferred-followup.js";
4040
import { filterToolsByMessageProvider } from "./agent-tools.message-provider-policy.js";
4141
import {
42-
isToolAllowedByPolicies,
4342
resolveEffectiveToolPolicy,
4443
resolveGroupToolPolicy,
4544
resolveInheritedToolPolicyForSession,
@@ -93,6 +92,7 @@ import {
9392
import { createToolFsPolicy, resolveToolFsConfig } from "./tool-fs-policy.js";
9493
import { resolveToolLoopDetectionConfig } from "./tool-loop-detection-config.js";
9594
import { buildDeclaredToolAllowlistContext } from "./tool-policy-declared-context.js";
95+
import { isToolAllowedByPolicies } from "./tool-policy-match.js";
9696
import {
9797
applyToolPolicyPipeline,
9898
buildDefaultToolPolicyPipelineSteps,

src/agents/tools/cron-tool.schema.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// validation compatibility for cron jobs.
33
import { Value } from "typebox/value";
44
import { describe, expect, it } from "vitest";
5-
import { normalizeToolParameterSchema } from "../agent-tools.schema.js";
5+
import { normalizeToolParameterSchema } from "../agent-tools-parameter-schema.js";
66
import { createCronToolSchema } from "./cron-tool.js";
77

88
/** Walk a TypeBox schema by dot-separated property path and return sorted keys. */

src/agents/web-search-tool-policy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { OpenClawConfig } from "../config/types.openclaw.js";
22
import {
3-
isToolAllowedByPolicies,
43
resolveEffectiveToolPolicy,
54
resolveGroupToolPolicy,
65
resolveInheritedToolPolicyForSession,
@@ -12,6 +11,7 @@ import {
1211
isSubagentEnvelopeSession,
1312
resolveSubagentCapabilityStore,
1413
} from "./subagent-capabilities.js";
14+
import { isToolAllowedByPolicies } from "./tool-policy-match.js";
1515
import { mergeAlsoAllowPolicy, resolveToolProfilePolicy } from "./tool-policy.js";
1616

1717
export type WebSearchToolPolicyParams = {

src/auto-reply/reply/dispatch-from-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
resolveSessionAgentId,
1818
} from "../../agents/agent-scope.js";
1919
import {
20-
isToolAllowedByPolicies,
2120
resolveEffectiveToolPolicy,
2221
resolveGroupToolPolicy,
2322
resolveInheritedToolPolicyForSession,
@@ -35,6 +34,7 @@ import {
3534
isSubagentEnvelopeSession,
3635
resolveSubagentCapabilityStore,
3736
} from "../../agents/subagent-capabilities.js";
37+
import { isToolAllowedByPolicies } from "../../agents/tool-policy-match.js";
3838
import { mergeAlsoAllowPolicy, resolveToolProfilePolicy } from "../../agents/tool-policy.js";
3939
import {
4040
resolveConversationBindingRecord,

0 commit comments

Comments
 (0)