AS AgentScopeAPI 手册 / API Reference

UserAgentDefinitionStore

public interface UserAgentDefinitionStore
源码Source 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.

参数Parameters
名称Name类型Type说明Description
userIdString用户标识(类型 `String`)。The user id.
返回Returns List<StoredEntry>
返回列出。Returns list.
源码Source io/agentscope/builder/web/catalog/UserAgentDefinitionStore.java:50

findById

public Optional<StoredEntry> findById(String userId, String agentId)

查找通过标识。

Finds a single agent definition by id for the given user.

参数Parameters
名称Name类型Type说明Description
userIdString用户标识(类型 `String`)。The user id.
agentIdString智能体标识(类型 `String`)。The agent id.
返回Returns Optional<StoredEntry>
返回可选。Returns optional.
源码Source io/agentscope/builder/web/catalog/UserAgentDefinitionStore.java:53

save

public StoredEntry save(String userId, StoredEntry entry)

保存数据到持久化存储。

Saves (creates or updates) an agent definition for the given user.

参数Parameters
名称Name类型Type说明Description
userIdString用户标识(类型 `String`)。The user id.
entryStoredEntry条目(类型 `StoredEntry`)。The entry.
返回Returns StoredEntry
返回StoredEntry。Returns stored entry.
源码Source io/agentscope/builder/web/catalog/UserAgentDefinitionStore.java:59

delete

public boolean delete(String userId, String agentId)

删除数据。

Deletes an agent definition.

参数Parameters
名称Name类型Type说明Description
userIdString用户标识(类型 `String`)。The user id.
agentIdString智能体标识(类型 `String`)。The agent id.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/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.

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