UserAgentDefinitionStore
public interface UserAgentDefinitionStore
io/agentscope/builder/web/catalog/UserAgentDefinitionStore.java:47–172定义用户智能体定义存储契约的接口。位于 io.agentscope.builder.web.catalog 包。核心成员包括 list、findById、save、delete。
Abstraction over the per-user custom agent definition registry.
Agent definitions carry the user-facing metadata for every custom agent (id, name, description, system prompt, model overrides, tools/mcpServers/skills, identity config, sharing grants, ...). Workspace files (skills, subagents, memory, ...) are stored separately under the agent's namespaced workspace directory; only the lightweight definition lives here.
The only bundled implementation is
io.agentscope.builder.web.persistence.jpa.JpaUserAgentDefinitionStore, which persists
via Spring Data JPA with a soft foreign key to the user table. The default DataSource is the
embedded H2 database at ${user.home}/.agentscope-builder/db; activate the
jdbc Spring profile (or set BUILDER_DB_URL) to point at MySQL / PostgreSQL.
Implementations are expected to be thread-safe.
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
StoredEntry | 记录record | 承载已存储条目数据的记录类型。 JSON-serializable agent definition stored per user. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public List<StoredEntry> list(String userId) | 设置列表。 Returns all agent definitions owned by `userId`. |
public Optional<StoredEntry> findById(String userId, String agentId) | 查找通过标识。 Finds a single agent definition by id for the given user. |
public StoredEntry save(String userId, StoredEntry entry) | 保存数据到持久化存储。 Saves (creates or updates) an agent definition for the given user. |
public boolean delete(String userId, String agentId) | 删除数据。 Deletes an agent definition. |
方法详情Method Detail
list
public List<StoredEntry> list(String userId)
设置列表。
Returns all agent definitions owned by userId.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
List<StoredEntry>io/agentscope/builder/web/catalog/UserAgentDefinitionStore.java:50findById
public Optional<StoredEntry> findById(String userId, String agentId)
查找通过标识。
Finds a single agent definition by id for the given user.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
Optional<StoredEntry>io/agentscope/builder/web/catalog/UserAgentDefinitionStore.java:53save
public StoredEntry save(String userId, StoredEntry entry)
保存数据到持久化存储。
Saves (creates or updates) an agent definition for the given user.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
entry | StoredEntry | 条目(类型 `StoredEntry`)。The entry. |
StoredEntryio/agentscope/builder/web/catalog/UserAgentDefinitionStore.java:59delete
public boolean delete(String userId, String agentId)
删除数据。
Deletes an agent definition.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
booleanio/agentscope/builder/web/catalog/UserAgentDefinitionStore.java:62嵌套类详情Nested Class Detail
StoredEntry
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) record StoredEntry( String id, String name, String description, String system, String model, Integer maxIters, List<AgentToolset> tools, List<McpServerSpec> mcpServers, List<SkillRef> skills, MultiagentSpec multiagent, String identityName, String identityEmoji, List<String> groupChatMentionPatterns, Boolean groupChatRequireMention, long createdAt, long updatedAt, List<AgentShareGrant> shares, String runAs, String forkOf, String workspacePath, List<SkillRepositoryConfigEntry> skillRepositories, String sandboxMode, String sandboxScope, int version, Long archivedAt)承载已存储条目数据的记录类型。位于 io.agentscope.builder.web.catalog 包。核心成员包括 id、name、description、system、model、maxIters。
JSON-serializable agent definition stored per user. All fields are optional except id.