LocalApprovalGate
public class LocalApprovalGate implements SkillPromotionGate
io/agentscope/harness/agent/skill/curator/LocalApprovalGate.java:38–131本地 Approval Gate,让智能体以受控方式调用外部能力。位于 io.agentscope.harness.agent.skill.curator 包,实现 SkillPromotionGate。核心成员包括 review、defaultPrompter、stdinPrompter、getTargetEnvironments、LocalApprovalGate。
Single-replica HITL gate. Calls a user-supplied prompter function that returns approve / reject from human input (terminal, CLI, IDE prompt, …). Defers if the prompter times out.
The default constructor wires a no-op prompter that always defers. Real deployments
should supply a prompter that bridges to whatever HITL surface is available — typically
via RequestStopEvent so the agent's outer loop can pause for the prompt.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
Prompter | 接口interface | 定义 Prompter契约的接口。 An interface in io.agentscope.harness.agent.skill.curator that defines the contract for components that lets agents invoke external capabilities under control. |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public LocalApprovalGate() | 初始化 `LocalApprovalGate` 实例。 Creates a new instance. |
public LocalApprovalGate(Duration timeout) | 初始化 `LocalApprovalGate` 实例。 Creates a new instance. |
public LocalApprovalGate(Duration timeout, Prompter prompter, List<String> targetEnvironments) | 初始化 `LocalApprovalGate` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Mono<PromotionDecision> review(SkillCandidate candidate, RuntimeContext ctx) | 执行 `review` 方法。 Performs the review operation. |
public static Prompter defaultPrompter()static | 返回 `defaultPrompter` 结果。 Default prompter: never approves. |
public static Prompter stdinPrompter(java.io.InputStream in, java.io.PrintStream out)static | 执行 `stdinPrompter` 方法。 Sample prompter: stdin yes/no. |
public List<String> getTargetEnvironments() | 获取目标环境。 Returns the target environments. |
构造器详情Constructor Detail
LocalApprovalGate
public LocalApprovalGate()
初始化 LocalApprovalGate 实例。
Creates a new instance.
io/agentscope/harness/agent/skill/curator/LocalApprovalGate.java:50–52LocalApprovalGate
public LocalApprovalGate(Duration timeout)
初始化 LocalApprovalGate 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
timeout | Duration | 超时时间(类型 `Duration`)。The timeout. |
io/agentscope/harness/agent/skill/curator/LocalApprovalGate.java:54–56LocalApprovalGate
public LocalApprovalGate(Duration timeout, Prompter prompter, List<String> targetEnvironments)
初始化 LocalApprovalGate 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
timeout | Duration | 超时时间(类型 `Duration`)。The timeout. |
prompter | Prompter | prompter(类型 `Prompter`)。The prompter. |
targetEnvironments | List<String> | 目标环境(类型 `List`)。The target environments. |
io/agentscope/harness/agent/skill/curator/LocalApprovalGate.java:58–63方法详情Method Detail
review
public Mono<PromotionDecision> review(SkillCandidate candidate, RuntimeContext ctx)
执行 review 方法。
Performs the review operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
candidate | SkillCandidate | candidate(类型 `SkillCandidate`)。The candidate. |
ctx | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The ctx. |
Mono<PromotionDecision>io/agentscope/harness/agent/skill/curator/LocalApprovalGate.java:65–80defaultPrompter
public static Prompter defaultPrompter()
返回 defaultPrompter 结果。
Default prompter: never approves.
Prompterio/agentscope/harness/agent/skill/curator/LocalApprovalGate.java:83–88stdinPrompter
public static Prompter stdinPrompter(java.io.InputStream in, java.io.PrintStream out)
执行 stdinPrompter 方法。
Sample prompter: stdin yes/no.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
in | java.io.InputStream | in(类型 `java.io.InputStream`)。The in. |
out | java.io.PrintStream | out(类型 `java.io.PrintStream`)。The out. |
Prompterio/agentscope/harness/agent/skill/curator/LocalApprovalGate.java:91–126getTargetEnvironments
public List<String> getTargetEnvironments()
获取目标环境。
Returns the target environments.
List<String>io/agentscope/harness/agent/skill/curator/LocalApprovalGate.java:128–130嵌套类详情Nested Class Detail
Prompter
@FunctionalInterface public interface Prompter extends Function<SkillCandidate, CompletableFuture<PromotionDecision>>定义 Prompter契约的接口。位于 io.agentscope.harness.agent.skill.curator 包,实现 Function<SkillCandidate, CompletableFuture<PromotionDecision>>。
An interface in io.agentscope.harness.agent.skill.curator that defines the contract for components that lets agents invoke external capabilities under control. Declared in io.agentscope.harness.agent.skill.curator. Implements Function<SkillCandidate, CompletableFuture