Record Class SkillUsageRecord
java.lang.Object
java.lang.Record
io.agentscope.harness.agent.skill.curator.SkillUsageRecord
public record SkillUsageRecord(String createdBy, long useCount, long viewCount, long patchCount, Instant lastUsedAt, Instant lastViewedAt, Instant lastPatchedAt, Instant createdAt, SkillUsageRecord.State state, boolean pinned, Instant archivedAt, Instant promotedAt, String promotedBy, String sourceSessionId, List<String> environments)
extends Record
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 viaskill_managebut not yet promoted"agent"— agent-created skill that has been promoted to the live skills root
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionSkillUsageRecord(String createdBy, long useCount, long viewCount, long patchCount, Instant lastUsedAt, Instant lastViewedAt, Instant lastPatchedAt, Instant createdAt, SkillUsageRecord.State state, boolean pinned, Instant archivedAt, Instant promotedAt, String promotedBy, String sourceSessionId, List<String> environments) Creates an instance of aSkillUsageRecordrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongSum ofuse_count,view_count,patch_count.Returns the value of thearchivedAtrecord component.Returns the value of thecreatedAtrecord component.Returns the value of thecreatedByrecord component.static SkillUsageRecorddefaults()Default record for a newly-tracked skill (just appeared on disk).Returns the value of theenvironmentsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanWhether this skill is eligible for curator auto-management / canary visibility filtering.Returns the value of thelastPatchedAtrecord component.Returns the value of thelastUsedAtrecord component.Returns the value of thelastViewedAtrecord component.Latest oflast_used_at,last_viewed_at,last_patched_at.static SkillUsageRecordnewAgentDraft(String sessionId) Default record for a freshly created agent draft.static SkillUsageRecordofJson(String createdBy, Long useCount, Long viewCount, Long patchCount, Instant lastUsedAt, Instant lastViewedAt, Instant lastPatchedAt, Instant createdAt, SkillUsageRecord.State state, Boolean pinned, Instant archivedAt, Instant promotedAt, String promotedBy, String sourceSessionId, List<String> environments) Jackson constructor for tolerant decoding (missing fields default to null/0/false).longReturns the value of thepatchCountrecord component.booleanpinned()Returns the value of thepinnedrecord component.Returns the value of thepromotedAtrecord component.Returns the value of thepromotedByrecord component.Returns the value of thesourceSessionIdrecord component.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.longuseCount()Returns the value of theuseCountrecord component.longReturns the value of theviewCountrecord component.
-
Constructor Details
-
SkillUsageRecord
public SkillUsageRecord(String createdBy, long useCount, long viewCount, long patchCount, Instant lastUsedAt, Instant lastViewedAt, Instant lastPatchedAt, Instant createdAt, SkillUsageRecord.State state, boolean pinned, Instant archivedAt, Instant promotedAt, String promotedBy, String sourceSessionId, List<String> environments) Creates an instance of aSkillUsageRecordrecord class.- Parameters:
createdBy- the value for thecreatedByrecord componentuseCount- the value for theuseCountrecord componentviewCount- the value for theviewCountrecord componentpatchCount- the value for thepatchCountrecord componentlastUsedAt- the value for thelastUsedAtrecord componentlastViewedAt- the value for thelastViewedAtrecord componentlastPatchedAt- the value for thelastPatchedAtrecord componentcreatedAt- the value for thecreatedAtrecord componentstate- the value for thestaterecord componentpinned- the value for thepinnedrecord componentarchivedAt- the value for thearchivedAtrecord componentpromotedAt- the value for thepromotedAtrecord componentpromotedBy- the value for thepromotedByrecord componentsourceSessionId- the value for thesourceSessionIdrecord componentenvironments- the value for theenvironmentsrecord component
-
-
Method Details
-
defaults
Default record for a newly-tracked skill (just appeared on disk). -
newAgentDraft
Default record for a freshly created agent draft. -
ofJson
public static SkillUsageRecord ofJson(String createdBy, Long useCount, Long viewCount, Long patchCount, Instant lastUsedAt, Instant lastViewedAt, Instant lastPatchedAt, Instant createdAt, SkillUsageRecord.State state, Boolean pinned, Instant archivedAt, Instant promotedAt, String promotedBy, String sourceSessionId, List<String> environments) Jackson constructor for tolerant decoding (missing fields default to null/0/false). -
latestActivityAt
Latest oflast_used_at,last_viewed_at,last_patched_at. -
activityCount
public long activityCount()Sum ofuse_count,view_count,patch_count. -
isAgentCreated
public boolean isAgentCreated()Whether this skill is eligible for curator auto-management / canary visibility filtering. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
createdBy
Returns the value of thecreatedByrecord component.- Returns:
- the value of the
createdByrecord component
-
useCount
public long useCount()Returns the value of theuseCountrecord component.- Returns:
- the value of the
useCountrecord component
-
viewCount
public long viewCount()Returns the value of theviewCountrecord component.- Returns:
- the value of the
viewCountrecord component
-
patchCount
public long patchCount()Returns the value of thepatchCountrecord component.- Returns:
- the value of the
patchCountrecord component
-
lastUsedAt
Returns the value of thelastUsedAtrecord component.- Returns:
- the value of the
lastUsedAtrecord component
-
lastViewedAt
Returns the value of thelastViewedAtrecord component.- Returns:
- the value of the
lastViewedAtrecord component
-
lastPatchedAt
Returns the value of thelastPatchedAtrecord component.- Returns:
- the value of the
lastPatchedAtrecord component
-
createdAt
Returns the value of thecreatedAtrecord component.- Returns:
- the value of the
createdAtrecord component
-
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
pinned
public boolean pinned()Returns the value of thepinnedrecord component.- Returns:
- the value of the
pinnedrecord component
-
archivedAt
Returns the value of thearchivedAtrecord component.- Returns:
- the value of the
archivedAtrecord component
-
promotedAt
Returns the value of thepromotedAtrecord component.- Returns:
- the value of the
promotedAtrecord component
-
promotedBy
Returns the value of thepromotedByrecord component.- Returns:
- the value of the
promotedByrecord component
-
sourceSessionId
Returns the value of thesourceSessionIdrecord component.- Returns:
- the value of the
sourceSessionIdrecord component
-
environments
Returns the value of theenvironmentsrecord component.- Returns:
- the value of the
environmentsrecord component
-