SessionResourceMountService
@Service public class SessionResourceMountService
io/agentscope/builder/web/managed/SessionResourceMountService.java:47–346会话资源 Mount 服务,承载智能体的部署、调度与服务化运行。位于 io.agentscope.builder.web.managed 包。核心成员包括 apply、mirrorFileResourcesToDefinitionStore、restageFromDefinitionStore、RESOURCES_ROOT。
Mounts session-level resources[] entries (see ManagedSessionService.CreateSessionRequest#resources) into a managed session's workspace at
agent-build time.
Supported resource type values:
-
github_repository— shallow-clones the repository intoresources/{slug}/via a hostgitprocess. RequiresgitonPATH; failures are logged as warnings and do not fail agent construction. -
file— reserved forfile_id-backed mounts (uploaded workspace files). Not yet implemented; writes a placeholder note so operators can see the mount was requested.
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
RESOURCES_ROOTstaticfinal | String | RESOURCES 根字段。 Directory (relative to the agent workspace) under which resources are mounted. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void apply(Path workspace, List<Map<String, Object>> resources) | 执行 `apply` 方法。 Applies each resource descriptor onto the workspace ahead of `builder.build()`. |
public void mirrorFileResourcesToDefinitionStore(io.agentscope.builder.web.catalog.DefinitionStore store, String ownerId, String agentId, List<Map<String, Object>> resources) | 执行 `mirrorFileResourcesToDefinitionStore` 方法。 Mirrors `type=file` resource payloads into the control-plane `io.agentscope.builder.web.catalog.DefinitionStore` so replicas can restage Hands workspace
content without depending on node-local clones. |
public void restageFromDefinitionStore(io.agentscope.builder.web.catalog.DefinitionStore store, String ownerId, String agentId, Path workspace) | 执行 `restageFromDefinitionStore` 方法。 Restages definition-store `resources/**` files onto the Hands workspace Path so a
replica without prior local clones can still see inline file resources. |
字段详情Field Detail
RESOURCES_ROOT
public static final String RESOURCES_ROOT
RESOURCES 根字段。声明为 public static final String RESOURCES_ROOT。
Directory (relative to the agent workspace) under which resources are mounted.
io/agentscope/builder/web/managed/SessionResourceMountService.java:53方法详情Method Detail
apply
public void apply(Path workspace, List<Map<String, Object>> resources)
执行 apply 方法。
Applies each resource descriptor onto the workspace ahead of builder.build().
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspace | Path | 工作区(类型 `Path`)。The workspace. |
resources | List<Map<String, Object>> | resources(类型 `List >`)。The resources. |
io/agentscope/builder/web/managed/SessionResourceMountService.java:62–86mirrorFileResourcesToDefinitionStore
public void mirrorFileResourcesToDefinitionStore(io.agentscope.builder.web.catalog.DefinitionStore store, String ownerId, String agentId, List<Map<String, Object>> resources)
执行 mirrorFileResourcesToDefinitionStore 方法。
Mirrors type=file resource payloads into the control-plane io.agentscope.builder.web.catalog.DefinitionStore so replicas can restage Hands workspace content without depending on node-local clones.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
store | io.agentscope.builder.web.catalog.DefinitionStore | 存储实例(类型 `io.agentscope.builder.web.catalog.DefinitionStore`)。The store. |
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
resources | List<Map<String, Object>> | resources(类型 `List >`)。The resources. |
io/agentscope/builder/web/managed/SessionResourceMountService.java:190–228restageFromDefinitionStore
public void restageFromDefinitionStore(io.agentscope.builder.web.catalog.DefinitionStore store, String ownerId, String agentId, Path workspace)
执行 restageFromDefinitionStore 方法。
Restages definition-store resources/** files onto the Hands workspace Path so a replica without prior local clones can still see inline file resources.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
store | io.agentscope.builder.web.catalog.DefinitionStore | 存储实例(类型 `io.agentscope.builder.web.catalog.DefinitionStore`)。The store. |
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
workspace | Path | 工作区(类型 `Path`)。The workspace. |
io/agentscope/builder/web/managed/SessionResourceMountService.java:234–284