chore(deadcode): remove stale agent helper reexports · openclaw/openclaw@eb9318e
vincentkoc
·
2026-06-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -11,14 +11,14 @@ import type { OpenClawConfig } from "../config/config.js";
|
11 | 11 | import { createWarnLogCapture } from "../logging/test-helpers/warn-log-capture.js"; |
12 | 12 | import { |
13 | 13 | filterToolsByPolicy, |
14 | | -isToolAllowedByPolicyName, |
15 | 14 | resolveEffectiveToolPolicy, |
16 | 15 | resolveGroupToolPolicy, |
17 | 16 | resolveInheritedToolPolicyForSession, |
18 | 17 | resolveSubagentToolPolicyForSession, |
19 | 18 | resolveTrustedGroupId, |
20 | 19 | } from "./agent-tools.policy.js"; |
21 | 20 | import { createStubTool } from "./test-helpers/agent-tool-stubs.js"; |
| 21 | +import { isToolAllowedByPolicyName } from "./tool-policy-match.js"; |
22 | 22 | |
23 | 23 | vi.mock("../channels/plugins/session-conversation.js", () => ({ |
24 | 24 | resolveSessionConversation: ({ rawId }: { rawId: string }) => ({ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -570,5 +570,3 @@ export function resolveGroupToolPolicy(params: {
|
570 | 570 | }); |
571 | 571 | return pickSandboxToolPolicy(configTools); |
572 | 572 | } |
573 | | - |
574 | | -export { isToolAllowedByPolicies, isToolAllowedByPolicyName } from "./tool-policy-match.js"; |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,15 +7,13 @@ import { runAgentLoop, type AgentEvent, type StreamFn } from "openclaw/plugin-sd
|
7 | 7 | import { createAssistantMessageEventStream, validateToolArguments } from "openclaw/plugin-sdk/llm"; |
8 | 8 | import { Type, type TSchema } from "typebox"; |
9 | 9 | import { describe, expect, it, vi } from "vitest"; |
| 10 | +import { normalizeToolParameterSchema } from "./agent-tools-parameter-schema.js"; |
10 | 11 | import { |
11 | 12 | isToolWrappedWithBeforeToolCallHook, |
12 | 13 | testing as beforeToolCallTesting, |
13 | 14 | wrapToolWithBeforeToolCallHook, |
14 | 15 | } 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"; |
19 | 17 | import type { AnyAgentTool } from "./agent-tools.types.js"; |
20 | 18 | |
21 | 19 | const TEST_USAGE = { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -13,8 +13,6 @@ import type { AnyAgentTool } from "./agent-tools.types.js";
|
13 | 13 | import { copyChannelAgentToolMeta } from "./channel-tools.js"; |
14 | 14 | import { copyToolTerminalPresentation } from "./tool-terminal-presentation.js"; |
15 | 15 | |
16 | | -export { normalizeToolParameterSchema }; |
17 | | - |
18 | 16 | function isObjectSchemaWithNoRequiredParams(schema: unknown): boolean { |
19 | 17 | if (!schema || typeof schema !== "object" || Array.isArray(schema)) { |
20 | 18 | return false; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -39,7 +39,6 @@ import {
|
39 | 39 | import { applyDeferredFollowupToolDescriptions } from "./agent-tools.deferred-followup.js"; |
40 | 40 | import { filterToolsByMessageProvider } from "./agent-tools.message-provider-policy.js"; |
41 | 41 | import { |
42 | | -isToolAllowedByPolicies, |
43 | 42 | resolveEffectiveToolPolicy, |
44 | 43 | resolveGroupToolPolicy, |
45 | 44 | resolveInheritedToolPolicyForSession, |
@@ -93,6 +92,7 @@ import {
|
93 | 92 | import { createToolFsPolicy, resolveToolFsConfig } from "./tool-fs-policy.js"; |
94 | 93 | import { resolveToolLoopDetectionConfig } from "./tool-loop-detection-config.js"; |
95 | 94 | import { buildDeclaredToolAllowlistContext } from "./tool-policy-declared-context.js"; |
| 95 | +import { isToolAllowedByPolicies } from "./tool-policy-match.js"; |
96 | 96 | import { |
97 | 97 | applyToolPolicyPipeline, |
98 | 98 | buildDefaultToolPolicyPipelineSteps, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,7 +2,7 @@
|
2 | 2 | // validation compatibility for cron jobs. |
3 | 3 | import { Value } from "typebox/value"; |
4 | 4 | import { describe, expect, it } from "vitest"; |
5 | | -import { normalizeToolParameterSchema } from "../agent-tools.schema.js"; |
| 5 | +import { normalizeToolParameterSchema } from "../agent-tools-parameter-schema.js"; |
6 | 6 | import { createCronToolSchema } from "./cron-tool.js"; |
7 | 7 | |
8 | 8 | /** Walk a TypeBox schema by dot-separated property path and return sorted keys. */ |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import type { OpenClawConfig } from "../config/types.openclaw.js"; |
2 | 2 | import { |
3 | | -isToolAllowedByPolicies, |
4 | 3 | resolveEffectiveToolPolicy, |
5 | 4 | resolveGroupToolPolicy, |
6 | 5 | resolveInheritedToolPolicyForSession, |
@@ -12,6 +11,7 @@ import {
|
12 | 11 | isSubagentEnvelopeSession, |
13 | 12 | resolveSubagentCapabilityStore, |
14 | 13 | } from "./subagent-capabilities.js"; |
| 14 | +import { isToolAllowedByPolicies } from "./tool-policy-match.js"; |
15 | 15 | import { mergeAlsoAllowPolicy, resolveToolProfilePolicy } from "./tool-policy.js"; |
16 | 16 | |
17 | 17 | export type WebSearchToolPolicyParams = { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,7 +17,6 @@ import {
|
17 | 17 | resolveSessionAgentId, |
18 | 18 | } from "../../agents/agent-scope.js"; |
19 | 19 | import { |
20 | | -isToolAllowedByPolicies, |
21 | 20 | resolveEffectiveToolPolicy, |
22 | 21 | resolveGroupToolPolicy, |
23 | 22 | resolveInheritedToolPolicyForSession, |
@@ -35,6 +34,7 @@ import {
|
35 | 34 | isSubagentEnvelopeSession, |
36 | 35 | resolveSubagentCapabilityStore, |
37 | 36 | } from "../../agents/subagent-capabilities.js"; |
| 37 | +import { isToolAllowedByPolicies } from "../../agents/tool-policy-match.js"; |
38 | 38 | import { mergeAlsoAllowPolicy, resolveToolProfilePolicy } from "../../agents/tool-policy.js"; |
39 | 39 | import { |
40 | 40 | resolveConversationBindingRecord, |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。