AS AgentScopeAPI 手册 / API Reference

SkillCurator

public class SkillCurator
源码Source io/agentscope/harness/agent/skill/curator/SkillCurator.java:59–364

技能 Curator,让智能体以受控方式调用外部能力。位于 io.agentscope.harness.agent.skill.curator 包。核心成员包括 config、loadState、saveState、isPaused、setPaused、shouldRunNow。

Background skill maintenance orchestrator. Mirrors hermes-agent's agent/curator.py lifecycle:

  • Pure-function applyAutomaticTransitions: walk every agent-tracked skill, transition ACTIVE → STALE → ARCHIVED based on the latest activity timestamp from the sidecar. Pinned + DRAFT skills are skipped.

  • LLM umbrella pass: produces a markdown report of consolidation candidates; in DRY_RUN_ONLY mode (default) it does not call skill_manage, just writes the report. Live consolidation (actually invoking skill_manage) is not implemented yet.

Strict invariants:

  • Only touches sidecar entries with createdBy != null (agent-authored skills).

  • Pinned skills bypass every auto-transition.

  • Never deletes — only archives.

  • DRAFT state is owned by the promotion gate, not the curator.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
TransitionCounts记录record
承载 Transition Counts数据的记录类型。
A record in io.agentscope.harness.agent.skill.curator that carries data used when components lets agents invoke external capabilities under control.
CuratorRunReport记录record
承载 Curator 运行报告数据的记录类型。
A record in io.agentscope.harness.agent.skill.curator that carries data used when components lets agents invoke external capabilities under control.

字段摘要Field Summary

字段Field类型Type说明Description
STATE_PATH
staticfinal
String
状态路径字段。
The STATE PATH field.
REPORTS_DIR
staticfinal
String
REPORTS 目录字段。
The REPORTS DIR field.

构造器摘要Constructor Summary

构造器Constructor说明Description
public SkillCurator(AbstractFilesystem filesystem, SkillUsageStore usageStore, WorkspaceSkillRepository mainRepo, SkillCuratorConfig config)
初始化 `SkillCurator` 实例。
Creates a new instance.
public SkillCurator(AbstractFilesystem filesystem, SkillUsageStore usageStore, WorkspaceSkillRepository mainRepo, SkillCuratorConfig config, PeriodicGate periodicGate)
初始化 `SkillCurator` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public SkillCuratorConfig config()
返回配置。
Returns the config.
public SkillCuratorState loadState()
加载状态。
Loads the state.
public void saveState(SkillCuratorState state)
保存状态。
Saves the state.
public boolean isPaused()
判断是否 `isPaused`。
Returns whether the paused.
public void setPaused(boolean paused)
设置 `setPaused`。
Sets the paused.
public boolean shouldRunNow(Instant now)
设置应当运行当前时间。
Interval + periodic-gate.
public TransitionCounts applyAutomaticTransitions(Instant now)
应用 `applyAutomaticTransitions`。
Performs the apply automatic transitions operation.
public String runUmbrellaDryRunReport(Instant now)
运行 `runUmbrellaDryRunReport`。
Generate a human-readable markdown report listing every agent-created skill grouped by common name prefix.
public CuratorRunReport runOnce(Instant now)
运行 `runOnce`。
Run a full curator pass: phase-1 transitions + phase-2 (dry-run) report.

字段详情Field Detail

STATE_PATH

public static final String STATE_PATH
staticfinal

状态路径字段。声明为 public static final String STATE_PATH。

The STATE PATH field.

源码Source io/agentscope/harness/agent/skill/curator/SkillCurator.java:63

REPORTS_DIR

public static final String REPORTS_DIR
staticfinal

REPORTS 目录字段。声明为 public static final String REPORTS_DIR。

The REPORTS DIR field.

源码Source io/agentscope/harness/agent/skill/curator/SkillCurator.java:64

构造器详情Constructor Detail

SkillCurator

public SkillCurator(AbstractFilesystem filesystem, SkillUsageStore usageStore, WorkspaceSkillRepository mainRepo, SkillCuratorConfig config)

初始化 SkillCurator 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
filesystemAbstractFilesystem文件系统(类型 `AbstractFilesystem`)。The filesystem.
usageStoreSkillUsageStore用量存储(类型 `SkillUsageStore`)。The usage store.
mainRepoWorkspaceSkillRepository主仓库(类型 `WorkspaceSkillRepository`)。The main repo.
configSkillCuratorConfig配置对象(类型 `SkillCuratorConfig`)。The config.
源码Source io/agentscope/harness/agent/skill/curator/SkillCurator.java:79–85

SkillCurator

public SkillCurator(AbstractFilesystem filesystem, SkillUsageStore usageStore, WorkspaceSkillRepository mainRepo, SkillCuratorConfig config, PeriodicGate periodicGate)

初始化 SkillCurator 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
filesystemAbstractFilesystem文件系统(类型 `AbstractFilesystem`)。The filesystem.
usageStoreSkillUsageStore用量存储(类型 `SkillUsageStore`)。The usage store.
mainRepoWorkspaceSkillRepository主仓库(类型 `WorkspaceSkillRepository`)。The main repo.
configSkillCuratorConfig配置对象(类型 `SkillCuratorConfig`)。The config.
periodicGatePeriodicGateperiodic Gate(类型 `PeriodicGate`)。The periodic gate.
源码Source io/agentscope/harness/agent/skill/curator/SkillCurator.java:87–98

方法详情Method Detail

config

public SkillCuratorConfig config()

返回配置。

Returns the config.

返回Returns SkillCuratorConfig
返回SkillCuratorConfig。Returns skill curator config.
源码Source io/agentscope/harness/agent/skill/curator/SkillCurator.java:100–102

loadState

public SkillCuratorState loadState()

加载状态。

Loads the state.

返回Returns SkillCuratorState
返回SkillCuratorState。Returns skill curator state.
源码Source io/agentscope/harness/agent/skill/curator/SkillCurator.java:108–121

saveState

public void saveState(SkillCuratorState state)

保存状态。

Saves the state.

参数Parameters
名称Name类型Type说明Description
stateSkillCuratorState状态对象(类型 `SkillCuratorState`)。The state.
源码Source io/agentscope/harness/agent/skill/curator/SkillCurator.java:123–134

isPaused

public boolean isPaused()

判断是否 isPaused。

Returns whether the paused.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/harness/agent/skill/curator/SkillCurator.java:136–138

setPaused

public void setPaused(boolean paused)

设置 setPaused。

Sets the paused.

参数Parameters
名称Name类型Type说明Description
pausedbooleanpaused(类型 `boolean`)。The paused.
源码Source io/agentscope/harness/agent/skill/curator/SkillCurator.java:140–150

shouldRunNow

public boolean shouldRunNow(Instant now)

设置应当运行当前时间。

Interval + periodic-gate.

参数Parameters
名称Name类型Type说明Description
nowInstant当前时间(类型 `Instant`)。The now.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/harness/agent/skill/curator/SkillCurator.java:159–185

applyAutomaticTransitions

public TransitionCounts applyAutomaticTransitions(Instant now)

应用 applyAutomaticTransitions。

Performs the apply automatic transitions operation.

参数Parameters
名称Name类型Type说明Description
nowInstant当前时间(类型 `Instant`)。The now.
返回Returns TransitionCounts
返回TransitionCounts。Returns transition counts.
源码Source io/agentscope/harness/agent/skill/curator/SkillCurator.java:193–242

runUmbrellaDryRunReport

public String runUmbrellaDryRunReport(Instant now)

运行 runUmbrellaDryRunReport。

Generate a human-readable markdown report listing every agent-created skill grouped by common name prefix.

参数Parameters
名称Name类型Type说明Description
nowInstant当前时间(类型 `Instant`)。The now.
返回Returns String
返回字符串结果。path of the report relative to the workspace, or `null` when disabled
源码Source io/agentscope/harness/agent/skill/curator/SkillCurator.java:258–324

runOnce

public CuratorRunReport runOnce(Instant now)

运行 runOnce。

Run a full curator pass: phase-1 transitions + phase-2 (dry-run) report.

参数Parameters
名称Name类型Type说明Description
nowInstant当前时间(类型 `Instant`)。The now.
返回Returns CuratorRunReport
返回CuratorRunReport。Returns curator run report.
源码Source io/agentscope/harness/agent/skill/curator/SkillCurator.java:337–363

嵌套类详情Nested Class Detail

TransitionCounts

public record TransitionCounts(int checked, int markedStale, int archived, int reactivated)

承载 Transition Counts数据的记录类型。位于 io.agentscope.harness.agent.skill.curator 包。核心成员包括 checked、markedStale、archived、reactivated。

A record in io.agentscope.harness.agent.skill.curator that carries data used when components lets agents invoke external capabilities under control. Declared in io.agentscope.harness.agent.skill.curator.

CuratorRunReport

public record CuratorRunReport( TransitionCounts transitions, String dryRunReportPath, Instant ranAt, long durationMs)

承载 Curator 运行报告数据的记录类型。位于 io.agentscope.harness.agent.skill.curator 包。核心成员包括 transitions、dryRunReportPath、ranAt、durationMs。

A record in io.agentscope.harness.agent.skill.curator that carries data used when components lets agents invoke external capabilities under control. Declared in io.agentscope.harness.agent.skill.curator.

基于官方固定版本源码静态生成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.