AS AgentScopeAPI 手册 / API Reference

SkillUsageRecord

@JsonInclude(JsonInclude.Include.NON_NULL) public record SkillUsageRecord( @JsonProperty("created_by") String createdBy, @JsonProperty("use_count") long useCount, @JsonProperty("view_count") long viewCount, @JsonProperty("patch_count") long patchCount, @JsonProperty("last_used_at") Instant lastUsedAt, @JsonProperty("last_viewed_at") Instant lastViewedAt, @JsonProperty("last_patched_at") Instant lastPatchedAt, @JsonProperty("created_at") Instant createdAt, @JsonProperty("state") State state, @JsonProperty("pinned") boolean pinned, @JsonProperty("archived_at") Instant archivedAt, @JsonProperty("promoted_at") Instant promotedAt, @JsonProperty("promoted_by") String promotedBy, @JsonProperty("source_session_id") String sourceSessionId, @JsonProperty("environments") List<String> environments)
源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

承载技能用量记录数据的记录类型。位于 io.agentscope.harness.agent.skill.curator 包。核心成员包括 createdBy、useCount、viewCount、patchCount、lastUsedAt、lastViewedAt。

Per-skill operational telemetry plus enterprise-staging audit fields. Persisted as a single JSON object inside the workspace sidecar skills/.usage.json (one record per skill, keyed by skill name).

Field naming intentionally mirrors hermes-agent's tools/skill_usage.py sidecar shape (snake_case via JsonProperty) so the two ecosystems can share telemetry files if a user copies skills between them.

createdBy provenance values:

  • null — user-authored / hub-installed / pre-existing skill (NOT eligible for curator auto-management or canary gating)

  • "agent-draft" — agent created via skill_manage but not yet promoted

  • "agent" — agent-created skill that has been promoted to the live skills root

记录组件摘要Record Component Summary

组件Component类型Type说明Description
createdByString
执行已创建通过相关操作。
Performs the created by operation.
useCountlong
执行使用数量相关操作。
Performs the use count operation.
viewCountlong
执行 `viewCount` 方法。
Performs the view count operation.
patchCountlong
执行 `patchCount` 方法。
Performs the patch count operation.
lastUsedAtInstant
执行 `lastUsedAt` 方法。
Performs the last used at operation.
lastViewedAtInstant
执行 `lastViewedAt` 方法。
Performs the last viewed at operation.
lastPatchedAtInstant
执行 `lastPatchedAt` 方法。
Performs the last patched at operation.
createdAtInstant
执行已创建 At相关操作。
Performs the created at operation.
stateState
执行状态相关操作。
Performs the state operation.
pinnedboolean
执行 `pinned` 方法。
Performs the pinned operation.
archivedAtInstant
执行 `archivedAt` 方法。
Performs the archived at operation.
promotedAtInstant
执行 `promotedAt` 方法。
Performs the promoted at operation.
promotedByString
执行 `promotedBy` 方法。
Performs the promoted by operation.
sourceSessionIdString
执行来源会话标识相关操作。
Performs the source session id operation.
environmentsList<String>
执行环境相关操作。
Performs the environments operation.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
State枚举enum
定义状态的枚举。
A enum in io.agentscope.harness.agent.skill.curator that defines enum values used when components lets agents invoke external capabilities under control.

方法摘要Method Summary

方法Method说明Description
public static SkillUsageRecord defaults()
static
返回 `defaults` 结果。
Default record for a newly-tracked skill (just appeared on disk).
public static SkillUsageRecord newAgentDraft(String sessionId)
static
创建 `newAgentDraft`。
Default record for a freshly created agent draft.
public static SkillUsageRecord ofJson(String createdBy, Long useCount, Long viewCount, Long patchCount, Instant lastUsedAt, Instant lastViewedAt, Instant lastPatchedAt, Instant createdAt, State state, Boolean pinned, Instant archivedAt, Instant promotedAt, String promotedBy, String sourceSessionId, List<String> environments)
static
执行的 JSON相关操作。
Jackson constructor for tolerant decoding (missing fields default to null/0/false).
public Instant latestActivityAt()
返回 `latestActivityAt` 结果。
Latest of `last_used_at`, `last_viewed_at`, `last_patched_at`.
public long activityCount()
返回 `activityCount` 结果。
Sum of `use_count`, `view_count`, `patch_count`.
public boolean isAgentCreated()
判断是否智能体已创建。
Whether this skill is eligible for curator auto-management / canary visibility filtering.

记录组件详情Record Component Detail

createdBy

String createdBy

执行已创建通过相关操作。

Performs the created by operation.

源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

useCount

long useCount

执行使用数量相关操作。

Performs the use count operation.

源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

viewCount

long viewCount

执行 viewCount 方法。

Performs the view count operation.

源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

patchCount

long patchCount

执行 patchCount 方法。

Performs the patch count operation.

源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

lastUsedAt

Instant lastUsedAt

执行 lastUsedAt 方法。

Performs the last used at operation.

源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

lastViewedAt

Instant lastViewedAt

执行 lastViewedAt 方法。

Performs the last viewed at operation.

源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

lastPatchedAt

Instant lastPatchedAt

执行 lastPatchedAt 方法。

Performs the last patched at operation.

源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

createdAt

Instant createdAt

执行已创建 At相关操作。

Performs the created at operation.

源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

state

State state

执行状态相关操作。

Performs the state operation.

源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

pinned

boolean pinned

执行 pinned 方法。

Performs the pinned operation.

源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

archivedAt

Instant archivedAt

执行 archivedAt 方法。

Performs the archived at operation.

源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

promotedAt

Instant promotedAt

执行 promotedAt 方法。

Performs the promoted at operation.

源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

promotedBy

String promotedBy

执行 promotedBy 方法。

Performs the promoted by operation.

源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

sourceSessionId

String sourceSessionId

执行来源会话标识相关操作。

Performs the source session id operation.

源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

environments

List<String> environments

执行环境相关操作。

Performs the environments operation.

源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:42–170

方法详情Method Detail

defaults

public static SkillUsageRecord defaults()
static

返回 defaults 结果。

Default record for a newly-tracked skill (just appeared on disk).

返回Returns SkillUsageRecord
返回SkillUsageRecord。Returns skill usage record.
源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:72–89

newAgentDraft

public static SkillUsageRecord newAgentDraft(String sessionId)
static

创建 newAgentDraft。

Default record for a freshly created agent draft.

参数Parameters
名称Name类型Type说明Description
sessionIdString会话标识(类型 `String`)。The session id.
返回Returns SkillUsageRecord
返回SkillUsageRecord。Returns skill usage record.
源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:92–109

ofJson

public static SkillUsageRecord ofJson(String createdBy, Long useCount, Long viewCount, Long patchCount, Instant lastUsedAt, Instant lastViewedAt, Instant lastPatchedAt, Instant createdAt, State state, Boolean pinned, Instant archivedAt, Instant promotedAt, String promotedBy, String sourceSessionId, List<String> environments)
static

执行的 JSON相关操作。

Jackson constructor for tolerant decoding (missing fields default to null/0/false).

参数Parameters
名称Name类型Type说明Description
createdByString已创建通过(类型 `String`)。The created by.
useCountLong使用数量(类型 `Long`)。The use count.
viewCountLongview 数量(类型 `Long`)。The view count.
patchCountLongpatch 数量(类型 `Long`)。The patch count.
lastUsedAtInstant最后 Used At(类型 `Instant`)。The last used at.
lastViewedAtInstant最后 Viewed At(类型 `Instant`)。The last viewed at.
lastPatchedAtInstant最后 Patched At(类型 `Instant`)。The last patched at.
createdAtInstant已创建 At(类型 `Instant`)。The created at.
stateState状态对象(类型 `State`)。The state.
pinnedBooleanpinned(类型 `Boolean`)。The pinned.
archivedAtInstantarchived At(类型 `Instant`)。The archived at.
promotedAtInstantpromoted At(类型 `Instant`)。The promoted at.
promotedByStringpromoted 通过(类型 `String`)。The promoted by.
sourceSessionIdString来源会话标识(类型 `String`)。The source session id.
environmentsList<String>环境(类型 `List`)。The environments.
返回Returns SkillUsageRecord
返回SkillUsageRecord。Returns skill usage record.
源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:112–145

latestActivityAt

public Instant latestActivityAt()

返回 latestActivityAt 结果。

Latest of last_used_at, last_viewed_at, last_patched_at.

返回Returns Instant
返回Instant。Returns instant.
源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:148–157

activityCount

public long activityCount()

返回 activityCount 结果。

Sum of use_count, view_count, patch_count.

返回Returns long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/harness/agent/skill/curator/SkillUsageRecord.java:160–163

isAgentCreated

public boolean isAgentCreated()

判断是否智能体已创建。

Whether this skill is eligible for curator auto-management / canary visibility filtering.

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

嵌套类详情Nested Class Detail

State

public enum State

定义状态的枚举。位于 io.agentscope.harness.agent.skill.curator 包。核心成员包括 DRAFT、ACTIVE、STALE、ARCHIVED。

A enum in io.agentscope.harness.agent.skill.curator that defines enum values 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.