AS AgentScopeAPI 手册 / API Reference

SkillManageTool

public class SkillManageTool implements AgentTool
源码Source 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-new SKILL.md (frontmatter required)

  • edit — full-rewrite the SKILL.md of an existing skill

  • patch — targeted find-and-replace within SKILL.md or a support file

  • write_file — add/overwrite a single file under references/ / 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
NAME
staticfinal
String
名称字段。
The NAME field.

构造器摘要Constructor Summary

构造器Constructor说明Description
public SkillManageTool(WorkspaceSkillRepository mainRepo, WorkspaceSkillRepository draftsRepo, SkillManageConfig config)
初始化 `SkillManageTool` 实例。
Creates a new instance.
public SkillManageTool(WorkspaceSkillRepository mainRepo, WorkspaceSkillRepository draftsRepo, SkillManageConfig config, SkillUsageStore usageStore)
初始化 `SkillManageTool` 实例。
Creates a new instance.
public SkillManageTool(WorkspaceSkillRepository mainRepo, WorkspaceSkillRepository draftsRepo, SkillManageConfig config, SkillUsageStore usageStore, SkillAuditLog auditLog)
初始化 `SkillManageTool` 实例。
Creates a new instance.

方法摘要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
staticfinal

名称字段。声明为 public static final String NAME。

The NAME field.

源码Source io/agentscope/harness/agent/tool/SkillManageTool.java:64

构造器详情Constructor Detail

SkillManageTool

public SkillManageTool(WorkspaceSkillRepository mainRepo, WorkspaceSkillRepository draftsRepo, SkillManageConfig config)

初始化 SkillManageTool 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
mainRepoWorkspaceSkillRepository主仓库(类型 `WorkspaceSkillRepository`)。The main repo.
draftsRepoWorkspaceSkillRepositorydrafts 仓库(类型 `WorkspaceSkillRepository`)。The drafts repo.
configSkillManageConfig配置对象(类型 `SkillManageConfig`)。The config.
源码Source io/agentscope/harness/agent/tool/SkillManageTool.java:89–94

SkillManageTool

public SkillManageTool(WorkspaceSkillRepository mainRepo, WorkspaceSkillRepository draftsRepo, SkillManageConfig config, SkillUsageStore usageStore)

初始化 SkillManageTool 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
mainRepoWorkspaceSkillRepository主仓库(类型 `WorkspaceSkillRepository`)。The main repo.
draftsRepoWorkspaceSkillRepositorydrafts 仓库(类型 `WorkspaceSkillRepository`)。The drafts repo.
configSkillManageConfig配置对象(类型 `SkillManageConfig`)。The config.
usageStoreSkillUsageStore用量存储(类型 `SkillUsageStore`)。The usage store.
源码Source io/agentscope/harness/agent/tool/SkillManageTool.java:96–102

SkillManageTool

public SkillManageTool(WorkspaceSkillRepository mainRepo, WorkspaceSkillRepository draftsRepo, SkillManageConfig config, SkillUsageStore usageStore, SkillAuditLog auditLog)

初始化 SkillManageTool 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
mainRepoWorkspaceSkillRepository主仓库(类型 `WorkspaceSkillRepository`)。The main repo.
draftsRepoWorkspaceSkillRepositorydrafts 仓库(类型 `WorkspaceSkillRepository`)。The drafts repo.
configSkillManageConfig配置对象(类型 `SkillManageConfig`)。The config.
usageStoreSkillUsageStore用量存储(类型 `SkillUsageStore`)。The usage store.
auditLogSkillAuditLogaudit 日志(类型 `SkillAuditLog`)。The audit log.
源码Source io/agentscope/harness/agent/tool/SkillManageTool.java:104–115

方法详情Method Detail

getName

public String getName()

获取名称。

Returns the name.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/agent/tool/SkillManageTool.java:117–120

getDescription

public String getDescription()

获取 getDescription。

Returns the description.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/agent/tool/SkillManageTool.java:122–141

getParameters

public Map<String, Object> getParameters()

获取参数。

Returns the parameters.

返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/harness/agent/tool/SkillManageTool.java:143–225

callAsync

public Mono<ToolResultBlock> callAsync(ToolCallParam param)

调用异步。

Calls the async.

参数Parameters
名称Name类型Type说明Description
paramToolCallParam参数(类型 `ToolCallParam`)。The param.
返回Returns Mono<ToolResultBlock>
返回Mono。Returns mono.
源码Source io/agentscope/harness/agent/tool/SkillManageTool.java:227–238

继承成员Inherited Members

继承自Methods inherited from AgentTool
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.