Files
Termind/Frameworks/TermindApplication/Agent/MCPToolApprovalPolicy.swift
T
2026-09-15 00:34:48 +08:00

11 lines
458 B
Swift

import AgentKit
nonisolated extension MCPTool {
/// The local policy assigned when Termind discovers a genuinely new MCP tool.
/// Contradictory read-only and destructive hints fail closed to asking, but
/// users may explicitly approve the tool afterward.
public var termindDefaultApprovalPolicy: AgentToolDescriptor.ApprovalPolicy {
annotations.readOnlyHint == true && annotations.destructiveHint != true ? .approve : .ask
}
}