SkillManageTool
public class SkillManageTool implements AgentTool
io/agentscope/harness/agent/tool/SkillManageTool.java:60–754技能 Manage 工具,封装可被智能体调用的能力。位于 io.agentscope.harness.agent.tool 包,实现 AgentTool。核心成员包括 getName、getDescription、getParameters、callAsync、SkillManageTool、NAME。
Agent-callable tool that lets a ReActAgent create, edit, patch, and archive skills in
its workspace. Ported from the hermes-agent skill_manage tool surface so existing skill
authoring prompts stay portable.
Six actions, dispatched on the action parameter:
-
create— write a brand-newSKILL.md(frontmatter required) -
edit— full-rewrite theSKILL.mdof an existing skill -
patch— targeted find-and-replace withinSKILL.mdor a support file -
write_file— add/overwrite a single file underreferences//templates//scripts//assets/ -
remove_file— delete a single support file -
delete— archive the entire skill directory (non-destructive)
Staging: by default (SkillManageConfig#autoPromote() = false), create
writes to skills/_drafts/<name>/; edit/patch/write_file/remove_file/delete resolve the skill by name across both draft and main directories
(drafts win on collision). Set autoPromote=true to write straight to skills/.
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
NAMEstaticfinal | String | 名称字段。 The NAME field. |
构造器摘要Constructor Summary
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String getName() | 获取名称。 Returns the name. |
public String getDescription() | 获取 `getDescription`。 Returns the description. |
public Map<String, Object> getParameters() | 获取参数。 Returns the parameters. |
public Mono<ToolResultBlock> callAsync(ToolCallParam param) | 调用异步。 Calls the async. |
字段详情Field Detail
NAME
public static final String NAME
名称字段。声明为 public static final String NAME。
The NAME field.
io/agentscope/harness/agent/tool/SkillManageTool.java:64构造器详情Constructor Detail
SkillManageTool
public SkillManageTool(WorkspaceSkillRepository mainRepo, WorkspaceSkillRepository draftsRepo, SkillManageConfig config)
初始化 SkillManageTool 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
mainRepo | WorkspaceSkillRepository | 主仓库(类型 `WorkspaceSkillRepository`)。The main repo. |
draftsRepo | WorkspaceSkillRepository | drafts 仓库(类型 `WorkspaceSkillRepository`)。The drafts repo. |
config | SkillManageConfig | 配置对象(类型 `SkillManageConfig`)。The config. |
io/agentscope/harness/agent/tool/SkillManageTool.java:89–94SkillManageTool
public SkillManageTool(WorkspaceSkillRepository mainRepo, WorkspaceSkillRepository draftsRepo, SkillManageConfig config, SkillUsageStore usageStore)
初始化 SkillManageTool 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
mainRepo | WorkspaceSkillRepository | 主仓库(类型 `WorkspaceSkillRepository`)。The main repo. |
draftsRepo | WorkspaceSkillRepository | drafts 仓库(类型 `WorkspaceSkillRepository`)。The drafts repo. |
config | SkillManageConfig | 配置对象(类型 `SkillManageConfig`)。The config. |
usageStore | SkillUsageStore | 用量存储(类型 `SkillUsageStore`)。The usage store. |
io/agentscope/harness/agent/tool/SkillManageTool.java:96–102SkillManageTool
public SkillManageTool(WorkspaceSkillRepository mainRepo, WorkspaceSkillRepository draftsRepo, SkillManageConfig config, SkillUsageStore usageStore, SkillAuditLog auditLog)
初始化 SkillManageTool 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
mainRepo | WorkspaceSkillRepository | 主仓库(类型 `WorkspaceSkillRepository`)。The main repo. |
draftsRepo | WorkspaceSkillRepository | drafts 仓库(类型 `WorkspaceSkillRepository`)。The drafts repo. |
config | SkillManageConfig | 配置对象(类型 `SkillManageConfig`)。The config. |
usageStore | SkillUsageStore | 用量存储(类型 `SkillUsageStore`)。The usage store. |
auditLog | SkillAuditLog | audit 日志(类型 `SkillAuditLog`)。The audit log. |
io/agentscope/harness/agent/tool/SkillManageTool.java:104–115方法详情Method Detail
getName
public String getName()
获取名称。
Returns the name.
Stringio/agentscope/harness/agent/tool/SkillManageTool.java:117–120getDescription
public String getDescription()
获取 getDescription。
Returns the description.
Stringio/agentscope/harness/agent/tool/SkillManageTool.java:122–141getParameters
public Map<String, Object> getParameters()
获取参数。
Returns the parameters.
Map<String, Object>io/agentscope/harness/agent/tool/SkillManageTool.java:143–225callAsync
public Mono<ToolResultBlock> callAsync(ToolCallParam param)
调用异步。
Calls the async.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
param | ToolCallParam | 参数(类型 `ToolCallParam`)。The param. |
Mono<ToolResultBlock>io/agentscope/harness/agent/tool/SkillManageTool.java:227–238