AS AgentScopeAPI 手册 / API Reference

SessionResourceMountService

@Service public class SessionResourceMountService
源码Source 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 into resources/{slug}/ via a host git process. Requires git on PATH; failures are logged as warnings and do not fail agent construction.

  • file — reserved for file_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_ROOT
staticfinal
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
staticfinal

RESOURCES 根字段。声明为 public static final String RESOURCES_ROOT。

Directory (relative to the agent workspace) under which resources are mounted.

源码Source 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().

参数Parameters
名称Name类型Type说明Description
workspacePath工作区(类型 `Path`)。The workspace.
resourcesList<Map<String, Object>>resources(类型 `List >`)。The resources.
源码Source io/agentscope/builder/web/managed/SessionResourceMountService.java:62–86

mirrorFileResourcesToDefinitionStore

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.

参数Parameters
名称Name类型Type说明Description
storeio.agentscope.builder.web.catalog.DefinitionStore存储实例(类型 `io.agentscope.builder.web.catalog.DefinitionStore`)。The store.
ownerIdString所有者标识(类型 `String`)。The owner id.
agentIdString智能体标识(类型 `String`)。The agent id.
resourcesList<Map<String, Object>>resources(类型 `List >`)。The resources.
源码Source io/agentscope/builder/web/managed/SessionResourceMountService.java:190–228

restageFromDefinitionStore

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.

参数Parameters
名称Name类型Type说明Description
storeio.agentscope.builder.web.catalog.DefinitionStore存储实例(类型 `io.agentscope.builder.web.catalog.DefinitionStore`)。The store.
ownerIdString所有者标识(类型 `String`)。The owner id.
agentIdString智能体标识(类型 `String`)。The agent id.
workspacePath工作区(类型 `Path`)。The workspace.
源码Source io/agentscope/builder/web/managed/SessionResourceMountService.java:234–284
基于官方固定版本源码静态生成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.