(
agent: &mut AgentDefinition,
tools: &[String],
disallowed_tools: &[String],
)
| 721 | } |
| 722 | |
| 723 | fn apply_claude_style_tools_to_agent( |
| 724 | agent: &mut AgentDefinition, |
| 725 | tools: &[String], |
| 726 | disallowed_tools: &[String], |
| 727 | ) { |
| 728 | if !tools.is_empty() { |
| 729 | agent.permissions = allow_only_permission_policy(tools); |
| 730 | } |
| 731 | if !disallowed_tools.is_empty() { |
| 732 | let base = std::mem::take(&mut agent.permissions); |
| 733 | agent.permissions = add_denied_tools(base, disallowed_tools); |
| 734 | } |
| 735 | if (!tools.is_empty() || !disallowed_tools.is_empty()) |
| 736 | && agent.confirmation_inheritance.is_none() |
| 737 | { |
| 738 | agent.confirmation_inheritance = Some(ConfirmationInheritance::AutoApprove); |
| 739 | } |
| 740 | } |
| 741 | |
| 742 | fn apply_claude_style_tools_to_spec( |
| 743 | spec: &mut WorkerAgentSpec, |
no test coverage detected