WorkbenchTools
public class WorkbenchTools
io/agentscope/examples/copilotkit/workbench/WorkbenchTools.java:45–192Workbench 工具,封装可被智能体调用的能力。位于 io.agentscope.examples.copilotkit.workbench 包。核心成员包括 queryServiceMetrics、updateWorkbenchBrief、setPlanGoal、deployRelease、purgeProductionData、renderDashboard。
The workbench tool belt.
Each tool exercises a different AgentScope 2.0 capability and is wired to a matching permission
rule in AgentConfiguration:
-
query_service_metrics— read-only, auto-allowed -
update_workbench_brief— writes shared state, streamed to the browser as STATE_DELTA -
deploy_release— ASK rule, suspends the run into an AG-UI interrupt -
purge_production_data— DENY rule, never reaches this class -
render_dashboard— generative UI through A2UI
AgentState is injected by the framework and carries the AG-UI thread id as its session
id, which is how each tool finds the right WorkbenchState.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public WorkbenchTools(WorkbenchStateRegistry registry, A2uiComposer composer) | 初始化 `WorkbenchTools` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String queryServiceMetrics(String service, String window, AgentState state) | 查询服务指标。 Reads simulated service metrics. |
public String updateWorkbenchBrief(String topic, String priority, String status, AgentState state) | 更新 `updateWorkbenchBrief`。 Updates the shared brief shown in the browser. |
public String setPlanGoal(String goal, AgentState state) | 设置计划目标。 Records the goal the current plan is working towards. |
public String deployRelease(String service, String version, AgentState state) | 执行 `deployRelease` 方法。 Simulates a production release; gated by an `ASK` permission rule. |
public String purgeProductionData(String dataset) | 设置该参数。 Destructive operation kept behind a `DENY` rule so the demo can show a hard block. |
public String renderDashboard(String intent, AgentState state) | 渲染 `renderDashboard`。 Generates an A2UI surface and pushes it to the browser as an `a2ui-surface` activity. |
构造器详情Constructor Detail
WorkbenchTools
public WorkbenchTools(WorkbenchStateRegistry registry, A2uiComposer composer)
初始化 WorkbenchTools 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
registry | WorkbenchStateRegistry | 注册表(类型 `WorkbenchStateRegistry`)。The registry. |
composer | A2uiComposer | composer(类型 `A2uiComposer`)。The composer. |
io/agentscope/examples/copilotkit/workbench/WorkbenchTools.java:50–53方法详情Method Detail
queryServiceMetrics
public String queryServiceMetrics(String service, String window, AgentState state)
查询服务指标。
Reads simulated service metrics.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
service | String | 服务(类型 `String`)。the service to inspect |
window | String | window(类型 `String`)。the time window, e.g. `1h` or `24h` |
state | AgentState | 状态对象(类型 `AgentState`)。injected agent state |
Stringio/agentscope/examples/copilotkit/workbench/WorkbenchTools.java:63–82updateWorkbenchBrief
public String updateWorkbenchBrief(String topic, String priority, String status, AgentState state)
更新 updateWorkbenchBrief。
Updates the shared brief shown in the browser.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
topic | String | 主题(类型 `String`)。new topic, optional |
priority | String | 优先级(类型 `String`)。new priority (低 / 中 / 高), optional |
status | String | 状态(类型 `String`)。new status text, optional |
state | AgentState | 状态对象(类型 `AgentState`)。injected agent state |
Stringio/agentscope/examples/copilotkit/workbench/WorkbenchTools.java:93–104setPlanGoal
public String setPlanGoal(String goal, AgentState state)
设置计划目标。
Records the goal the current plan is working towards.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
goal | String | 计划目标。the plan goal |
state | AgentState | 状态对象(类型 `AgentState`)。injected agent state |
Stringio/agentscope/examples/copilotkit/workbench/WorkbenchTools.java:113–122deployRelease
public String deployRelease(String service, String version, AgentState state)
执行 deployRelease 方法。
Simulates a production release; gated by an ASK permission rule.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
service | String | 服务(类型 `String`)。target service |
version | String | 版本(类型 `String`)。release version |
state | AgentState | 状态对象(类型 `AgentState`)。injected agent state |
Stringio/agentscope/examples/copilotkit/workbench/WorkbenchTools.java:132–143purgeProductionData
public String purgeProductionData(String dataset)
设置该参数。
Destructive operation kept behind a DENY rule so the demo can show a hard block.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
dataset | String | dataset(类型 `String`)。dataset name |
Stringio/agentscope/examples/copilotkit/workbench/WorkbenchTools.java:151–158renderDashboard
public String renderDashboard(String intent, AgentState state)
渲染 renderDashboard。
Generates an A2UI surface and pushes it to the browser as an a2ui-surface activity.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
intent | String | intent(类型 `String`)。what the surface should show |
state | AgentState | 状态对象(类型 `AgentState`)。injected agent state |
Stringio/agentscope/examples/copilotkit/workbench/WorkbenchTools.java:167–191