WorkspaceSkillRepository
@SuppressWarnings("deprecation") public class WorkspaceSkillRepository implements RuntimeContextSkillRepository, LazyResourceCapable
io/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:66–679工作区技能仓库,负责持久化与读取数据。位于 io.agentscope.harness.agent.skill 包,实现 RuntimeContextSkillRepository、LazyResourceCapable。核心成员包括 getSkill、getAllSkillNames、getAllSkills、skillExists、getRepositoryInfo、getSource。
AgentSkillRepository backed by an AbstractFilesystem, with lazy resource
access via LazyResourceCapable. Supersedes the legacy
FilesystemBackedSkillRepository + WritableFilesystemSkillRepository pair:
writability is now a constructor parameter rather than a subclass.
Skills are discovered by globbing SKILL.md under skillsRelativeDir. Only
the SKILL.md text is read at registration time; resources (references, scripts, assets) are
fetched on demand through #resourcesFor(String, RuntimeContext) and consumed by the
harness skill runtime when load_skill_through_path misses the in-memory map.
Per-user namespacing and sandbox routing are honored transparently because every
filesystem call passes the explicitly supplied RuntimeContext. Context-less operations
use the default namespace and never infer a user from another active agent call.
Deletes are non-destructive: skill directories are moved under
.archive/<name>-<ts>/ rather than removed, matching the curator's never-delete
invariant.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public WorkspaceSkillRepository(AbstractFilesystem filesystem, String skillsRelativeDir) | 初始化 `WorkspaceSkillRepository` 实例。 Creates a read-only repository scoped to the default namespace; context-less operations
resolve to `RuntimeContext#empty()` unless a request context is passed explicitly. |
public WorkspaceSkillRepository(AbstractFilesystem filesystem, String skillsRelativeDir, String source) | 初始化 `WorkspaceSkillRepository` 实例。 Creates a writable repository (matches the legacy
`WritableFilesystemSkillRepository` default), scoped to the default namespace. |
public WorkspaceSkillRepository(AbstractFilesystem filesystem, String skillsRelativeDir, String source, boolean writable) | 初始化 `WorkspaceSkillRepository` 实例。 Creates a repository with explicit source and writability, scoped to the default namespace. |
方法摘要Method Summary
构造器详情Constructor Detail
WorkspaceSkillRepository
public WorkspaceSkillRepository(AbstractFilesystem filesystem, String skillsRelativeDir)
初始化 WorkspaceSkillRepository 实例。
Creates a read-only repository scoped to the default namespace; context-less operations resolve to RuntimeContext#empty() unless a request context is passed explicitly.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
filesystem | AbstractFilesystem | 文件系统(类型 `AbstractFilesystem`)。The filesystem. |
skillsRelativeDir | String | 技能 Relative 目录(类型 `String`)。The skills relative dir. |
io/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:87–89WorkspaceSkillRepository
public WorkspaceSkillRepository(AbstractFilesystem filesystem, String skillsRelativeDir, String source)
初始化 WorkspaceSkillRepository 实例。
Creates a writable repository (matches the legacy WritableFilesystemSkillRepository default), scoped to the default namespace.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
filesystem | AbstractFilesystem | 文件系统(类型 `AbstractFilesystem`)。The filesystem. |
skillsRelativeDir | String | 技能 Relative 目录(类型 `String`)。The skills relative dir. |
source | String | 来源(类型 `String`)。The source. |
io/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:95–98WorkspaceSkillRepository
public WorkspaceSkillRepository(AbstractFilesystem filesystem, String skillsRelativeDir, String source, boolean writable)
初始化 WorkspaceSkillRepository 实例。
Creates a repository with explicit source and writability, scoped to the default namespace.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
filesystem | AbstractFilesystem | 文件系统(类型 `AbstractFilesystem`)。The filesystem. |
skillsRelativeDir | String | 技能 Relative 目录(类型 `String`)。The skills relative dir. |
source | String | 来源(类型 `String`)。The source. |
writable | boolean | writable(类型 `boolean`)。The writable. |
io/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:103–112方法详情Method Detail
getSkill
public AgentSkill getSkill(String name)
获取技能。
Returns the skill.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
AgentSkillio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:118–129getAllSkillNames
public List<String> getAllSkillNames()
获取 getAllSkillNames。
Returns the all skill names.
List<String>io/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:131–139getAllSkills
public List<AgentSkill> getAllSkills()
获取所有技能。
Returns the all skills.
List<AgentSkill>io/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:141–144getAllSkills
public List<AgentSkill> getAllSkills(RuntimeContext context)
获取所有技能。
Lists skills using the caller's request-scoped context.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
context | RuntimeContext | 上下文(类型 `RuntimeContext`)。The context. |
List<AgentSkill>io/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:149–186skillExists
public boolean skillExists(String skillName)
设置该参数。
Performs the skill exists operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillName | String | 技能名称(类型 `String`)。The skill name. |
booleanio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:188–191skillExists
public boolean skillExists(String skillName, RuntimeContext context)
执行 skillExists 方法。
Variant of #skillExists(String) scoped to the supplied request context; null uses the default namespace.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillName | String | 技能名称(类型 `String`)。The skill name. |
context | RuntimeContext | 上下文(类型 `RuntimeContext`)。The context. |
booleanio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:194–196getRepositoryInfo
public AgentSkillRepositoryInfo getRepositoryInfo()
获取仓库信息。
Returns the repository info.
AgentSkillRepositoryInfoio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:198–201getSource
public String getSource()
获取来源。
Returns the source.
Stringio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:203–206isWriteable
public boolean isWriteable()
判断是否 isWriteable。
Returns whether the writeable.
booleanio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:208–211setWriteable
public void setWriteable(boolean writeable)
设置 setWriteable。
Sets the writeable.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
writeable | boolean | writeable(类型 `boolean`)。The writeable. |
io/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:213–216resourcesFor
public SkillResources resourcesFor(String skillName, RuntimeContext ctx)
执行 resourcesFor 方法。
Performs the resources for operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillName | String | 技能名称(类型 `String`)。The skill name. |
ctx | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The ctx. |
SkillResourcesio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:222–229save
public boolean save(List<AgentSkill> skills, boolean force)
保存数据到持久化存储。
Performs the save operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skills | List<AgentSkill> | 技能(类型 `List`)。The skills. |
force | boolean | force(类型 `boolean`)。The force. |
booleanio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:235–238save
public boolean save(List<AgentSkill> skills, boolean force, RuntimeContext context)
保存数据到持久化存储。
Variant of #save(List, boolean) scoped to the supplied request context; null uses the default namespace.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skills | List<AgentSkill> | 技能(类型 `List`)。The skills. |
force | boolean | force(类型 `boolean`)。The force. |
context | RuntimeContext | 上下文(类型 `RuntimeContext`)。The context. |
booleanio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:241–269delete
public boolean delete(String skillName)
删除数据。
Performs the delete operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillName | String | 技能名称(类型 `String`)。The skill name. |
booleanio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:271–274delete
public boolean delete(String skillName, RuntimeContext context)
删除数据。
Variant of #delete(String) scoped to the supplied request context; null uses the default namespace.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillName | String | 技能名称(类型 `String`)。The skill name. |
context | RuntimeContext | 上下文(类型 `RuntimeContext`)。The context. |
booleanio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:277–308readSkillFile
public String readSkillFile(String skillName, String relPath)
执行读取技能文件相关操作。
Reads a single raw file under / /.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillName | String | 技能名称(类型 `String`)。The skill name. |
relPath | String | rel 路径(类型 `String`)。The rel path. |
Stringio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:318–320readSkillFile
public String readSkillFile(String skillName, String relPath, RuntimeContext context)
执行读取技能文件相关操作。
Variant of #readSkillFile(String, String) scoped to the supplied request context; null uses the default namespace.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillName | String | 技能名称(类型 `String`)。The skill name. |
relPath | String | rel 路径(类型 `String`)。The rel path. |
context | RuntimeContext | 上下文(类型 `RuntimeContext`)。The context. |
Stringio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:323–338writeSkillFile
public boolean writeSkillFile(String skillName, String relPath, String content)
执行写入技能文件相关操作。
Writes (or overwrites) a single raw file under / /.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillName | String | 技能名称(类型 `String`)。The skill name. |
relPath | String | rel 路径(类型 `String`)。The rel path. |
content | String | 内容(类型 `String`)。The content. |
booleanio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:345–347writeSkillFile
public boolean writeSkillFile(String skillName, String relPath, String content, RuntimeContext context)
执行写入技能文件相关操作。
Variant of #writeSkillFile(String, String, String) scoped to the supplied request context; null uses the default namespace.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillName | String | 技能名称(类型 `String`)。The skill name. |
relPath | String | rel 路径(类型 `String`)。The rel path. |
content | String | 内容(类型 `String`)。The content. |
context | RuntimeContext | 上下文(类型 `RuntimeContext`)。The context. |
booleanio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:350–374deleteSkillFile
public boolean deleteSkillFile(String skillName, String relPath)
删除技能文件。
Deletes a single raw file under / /.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillName | String | 技能名称(类型 `String`)。The skill name. |
relPath | String | rel 路径(类型 `String`)。The rel path. |
booleanio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:380–382deleteSkillFile
public boolean deleteSkillFile(String skillName, String relPath, RuntimeContext context)
删除技能文件。
Variant of #deleteSkillFile(String, String) scoped to the supplied request context; null uses the default namespace.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillName | String | 技能名称(类型 `String`)。The skill name. |
relPath | String | rel 路径(类型 `String`)。The rel path. |
context | RuntimeContext | 上下文(类型 `RuntimeContext`)。The context. |
booleanio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:385–401resolveSkillRoot
public String resolveSkillRoot(String skillName)
解析技能根。
Returns the relative skill root path for callers building sub-paths.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
skillName | String | 技能名称(类型 `String`)。The skill name. |
Stringio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:404–406filesystem
public AbstractFilesystem filesystem()
返回文件系统。
Returns the filesystem.
AbstractFilesystemio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:412–414skillsRelativeDir
public String skillsRelativeDir()
返回 skillsRelativeDir 结果。
Returns the skills relative dir.
Stringio/agentscope/harness/agent/skill/WorkspaceSkillRepository.java:416–418