feat: add requiresApproval flag to support HITL workflows

This commit is contained in:
jade
2026-07-10 11:44:38 +09:00
parent 79ce26fafc
commit 749d942049
8 changed files with 47 additions and 3 deletions

View File

@@ -19,4 +19,7 @@ public @interface McpFunction {
// 추가: 툴 목록 노출 여부 제어 (false 시 라우팅은 되나 목록에서 숨김)
boolean visible() default true;
// 추가: HITL 승인 체계 지원 (실행 전 사용자 승인 필요 여부)
boolean requiresApproval() default false;
}

View File

@@ -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;
}
}

View File

@@ -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();