forked from kimhyungsik/ax_hub_mcp_tool
feat: add requiresApproval flag to support HITL workflows
This commit is contained in:
@@ -19,4 +19,7 @@ public @interface McpFunction {
|
||||
|
||||
// 추가: 툴 목록 노출 여부 제어 (false 시 라우팅은 되나 목록에서 숨김)
|
||||
boolean visible() default true;
|
||||
|
||||
// 추가: HITL 승인 체계 지원 (실행 전 사용자 승인 필요 여부)
|
||||
boolean requiresApproval() default false;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,9 @@ public class ToolMetadata {
|
||||
@Builder.Default
|
||||
private Boolean isRegistered = true;
|
||||
|
||||
@Builder.Default
|
||||
private Boolean requiresApproval = false;
|
||||
|
||||
public boolean isVisible() {
|
||||
return visible != null ? visible : true;
|
||||
}
|
||||
@@ -57,4 +60,8 @@ public class ToolMetadata {
|
||||
this.isRegistered = isRegistered;
|
||||
}
|
||||
|
||||
public boolean isRequiresApproval() {
|
||||
return requiresApproval != null ? requiresApproval : false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -101,6 +101,7 @@ public class ToolRegistryHeartbeatSender {
|
||||
boolean isVisible = functionAnnotation.visible();
|
||||
meta.setVisible(isVisible);
|
||||
meta.setRegistered(isRegister);
|
||||
meta.setRequiresApproval(functionAnnotation.requiresApproval());
|
||||
|
||||
Map<String, String> prompts = new HashMap<>();
|
||||
String promptText = functionAnnotation.prompt();
|
||||
|
||||
Reference in New Issue
Block a user