@@ -43,7 +43,10 @@ import {
4343 wrapToolParamNormalization ,
4444} from "./pi-tools.read.js" ;
4545import { cleanToolSchemaForGemini , normalizeToolParameters } from "./pi-tools.schema.js" ;
46- import { applyToolPolicyPipeline } from "./tool-policy-pipeline.js" ;
46+ import {
47+ applyToolPolicyPipeline ,
48+ buildDefaultToolPolicyPipelineSteps ,
49+ } from "./tool-policy-pipeline.js" ;
4750import {
4851 applyOwnerOnlyToolPolicy ,
4952 collectExplicitAllowlist ,
@@ -389,37 +392,18 @@ export function createOpenClawCodingTools(options?: {
389392 toolMeta : ( tool ) => getPluginToolMeta ( tool ) ,
390393 warn : logWarn ,
391394 steps : [
392- {
393- policy : profilePolicyWithAlsoAllow ,
394- label : profile ? `tools.profile (${ profile } )` : "tools.profile" ,
395- stripPluginOnlyAllowlist : true ,
396- } ,
397- {
398- policy : providerProfilePolicyWithAlsoAllow ,
399- label : providerProfile
400- ? `tools.byProvider.profile (${ providerProfile } )`
401- : "tools.byProvider.profile" ,
402- stripPluginOnlyAllowlist : true ,
403- } ,
404- { policy : globalPolicy , label : "tools.allow" , stripPluginOnlyAllowlist : true } ,
405- {
406- policy : globalProviderPolicy ,
407- label : "tools.byProvider.allow" ,
408- stripPluginOnlyAllowlist : true ,
409- } ,
410- {
411- policy : agentPolicy ,
412- label : agentId ? `agents.${ agentId } .tools.allow` : "agent tools.allow" ,
413- stripPluginOnlyAllowlist : true ,
414- } ,
415- {
416- policy : agentProviderPolicy ,
417- label : agentId
418- ? `agents.${ agentId } .tools.byProvider.allow`
419- : "agent tools.byProvider.allow" ,
420- stripPluginOnlyAllowlist : true ,
421- } ,
422- { policy : groupPolicy , label : "group tools.allow" , stripPluginOnlyAllowlist : true } ,
395+ ...buildDefaultToolPolicyPipelineSteps ( {
396+ profilePolicy : profilePolicyWithAlsoAllow ,
397+ profile,
398+ providerProfilePolicy : providerProfilePolicyWithAlsoAllow ,
399+ providerProfile,
400+ globalPolicy,
401+ globalProviderPolicy,
402+ agentPolicy,
403+ agentProviderPolicy,
404+ groupPolicy,
405+ agentId,
406+ } ) ,
423407 { policy : sandbox ?. tools , label : "sandbox tools.allow" } ,
424408 { policy : subagentPolicy , label : "subagent tools.allow" } ,
425409 ] ,
0 commit comments