AS AgentScopeAPI 手册 / API Reference

RemoteFilesystemSpec

public class RemoteFilesystemSpec
源码Source io/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:75–360

远程文件系统规格,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.agent.filesystem.spec 包。核心成员包括 hasStore、store、injectStoreIfAbsent、addSharedPrefix、anonymousUserId、isolationScope。

Specification for the non-sandbox "composite" filesystem mode.

This spec produces a CompositeFilesystem that blends:

  • a plain LocalFilesystem (no shell) for workspace-local, unmanaged files;

  • per-route RemoteFilesystem instances for cross-node paths (memory, skills, subagents, knowledge, sessions, tasks). Each route gets its own store namespace segment to prevent key collisions across routes.

Because the default backend is LocalFilesystem (not LocalFilesystemWithShell), shell execution is intentionally not available in this mode — use a sandbox filesystem spec or LocalFilesystemWithShell if shell is required.

Default shared routes (each gets an isolated store namespace segment):

  • AGENTS.md, MEMORY.md → segment root

  • memory/ → segment memory

  • skills/ → segment skills

  • subagents/ → segment subagents

  • knowledge/ → segment knowledge

  • plans/ → segment plans

  • agents/<agentId>/sessions/ → segment sessions

  • agents/<agentId>/tasks/ → segment tasks

The store namespace for shared files is controlled by #isolationScope(IsolationScope), which mirrors the sandbox isolation semantics:

  • IsolationScope#SESSION — namespace per session

  • IsolationScope#USER (default) — namespace per user, shared across sessions

  • IsolationScope#AGENT — namespace per agent, shared across all users

  • IsolationScope#GLOBAL — single global namespace

构造器摘要Constructor Summary

构造器Constructor说明Description
public RemoteFilesystemSpec()
初始化 `RemoteFilesystemSpec` 实例。
Creates a remote filesystem spec that defers store resolution to `io.agentscope.harness.agent.DistributedStore#baseStore()`.
public RemoteFilesystemSpec(BaseStore store)
初始化 `RemoteFilesystemSpec` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public boolean hasStore()
判断是否具有存储。
Returns whether the store has been set (either via constructor or injection).
public BaseStore store()
返回存储。
Returns the configured `BaseStore`, or `null` if not yet set.
public void injectStoreIfAbsent(BaseStore store)
设置该参数。
Injects the store if not already set.
public RemoteFilesystemSpec addSharedPrefix(String prefix)
添加 `addSharedPrefix`。
Adds an extra workspace-relative prefix routed to the shared store.
public RemoteFilesystemSpec anonymousUserId(String userId)
设置该参数。
Sets the fallback user identifier when runtime `userId` is absent/blank.
public RemoteFilesystemSpec isolationScope(IsolationScope scope)
执行隔离范围相关操作。
Sets the isolation scope that controls the store namespace for shared files.
public IsolationScope getIsolationScope()
获取隔离范围。
Returns the isolation scope.
public RemoteFilesystemSpec workspaceIndex(WorkspaceIndex index)
设置工作区索引。
Sets the workspace index for accelerating remote filesystem reads (ls/glob/exists/grep).
public RemoteFilesystemSpec sharedLocalWorkspace(boolean shared)
设置共享本地工作区。
When `true`, the default backend (everything not routed to a shared prefix) serves the workspace root directly: no per-user namespace prefix and sandboxed path resolution.
public AbstractFilesystem toFilesystem(Path workspace, String agentId, NamespaceFactory localNamespaceFactory)
执行到文件系统相关操作。
Builds the composite filesystem described by this spec.

构造器详情Constructor Detail

RemoteFilesystemSpec

public RemoteFilesystemSpec()

初始化 RemoteFilesystemSpec 实例。

Creates a remote filesystem spec that defers store resolution to io.agentscope.harness.agent.DistributedStore#baseStore().

源码Source io/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:92–94

RemoteFilesystemSpec

public RemoteFilesystemSpec(BaseStore store)

初始化 RemoteFilesystemSpec 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
storeBaseStore存储实例(类型 `BaseStore`)。The store.
源码Source io/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:96–101

方法详情Method Detail

hasStore

public boolean hasStore()

判断是否具有存储。

Returns whether the store has been set (either via constructor or injection).

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:106–108

store

public BaseStore store()

返回存储。

Returns the configured BaseStore, or null if not yet set.

返回Returns BaseStore
返回BaseStore。Returns base store.
源码Source io/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:116–118

injectStoreIfAbsent

public void injectStoreIfAbsent(BaseStore store)

设置该参数。

Injects the store if not already set.

参数Parameters
名称Name类型Type说明Description
storeBaseStore存储实例(类型 `BaseStore`)。The store.
源码Source io/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:123–127

addSharedPrefix

public RemoteFilesystemSpec addSharedPrefix(String prefix)

添加 addSharedPrefix。

Adds an extra workspace-relative prefix routed to the shared store.

参数Parameters
名称Name类型Type说明Description
prefixStringprefix(类型 `String`)。The prefix.
返回Returns RemoteFilesystemSpec
返回RemoteFilesystemSpec。Returns remote filesystem spec.
源码Source io/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:134–139

anonymousUserId

public RemoteFilesystemSpec anonymousUserId(String userId)

设置该参数。

Sets the fallback user identifier when runtime userId is absent/blank.

参数Parameters
名称Name类型Type说明Description
userIdString用户标识(类型 `String`)。The user id.
返回Returns RemoteFilesystemSpec
返回RemoteFilesystemSpec。Returns remote filesystem spec.
源码Source io/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:144–150

isolationScope

public RemoteFilesystemSpec isolationScope(IsolationScope scope)

执行隔离范围相关操作。

Sets the isolation scope that controls the store namespace for shared files.

参数Parameters
名称Name类型Type说明Description
scopeIsolationScope范围(类型 `IsolationScope`)。isolation scope
返回Returns RemoteFilesystemSpec
返回RemoteFilesystemSpec。this spec
源码Source io/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:161–167

getIsolationScope

public IsolationScope getIsolationScope()

获取隔离范围。

Returns the isolation scope.

返回Returns IsolationScope
返回IsolationScope。Returns isolation scope.
源码Source io/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:169–171

workspaceIndex

public RemoteFilesystemSpec workspaceIndex(WorkspaceIndex index)

设置工作区索引。

Sets the workspace index for accelerating remote filesystem reads (ls/glob/exists/grep).

参数Parameters
名称Name类型Type说明Description
indexWorkspaceIndex索引(类型 `WorkspaceIndex`)。The index.
返回Returns RemoteFilesystemSpec
返回RemoteFilesystemSpec。Returns remote filesystem spec.
源码Source io/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:177–180

sharedLocalWorkspace

public RemoteFilesystemSpec sharedLocalWorkspace(boolean shared)

设置共享本地工作区。

When true, the default backend (everything not routed to a shared prefix) serves the workspace root directly: no per-user namespace prefix and sandboxed path resolution.

参数Parameters
名称Name类型Type说明Description
sharedboolean共享(类型 `boolean`)。whether the default backend serves the shared workspace root
返回Returns RemoteFilesystemSpec
返回RemoteFilesystemSpec。this spec
源码Source io/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:205–208

toFilesystem

public AbstractFilesystem toFilesystem(Path workspace, String agentId, NamespaceFactory localNamespaceFactory)

执行到文件系统相关操作。

Builds the composite filesystem described by this spec.

参数Parameters
名称Name类型Type说明Description
workspacePath工作区(类型 `Path`)。The workspace.
agentIdString智能体标识(类型 `String`)。The agent id.
localNamespaceFactoryNamespaceFactory本地命名空间工厂(类型 `NamespaceFactory`)。The local namespace factory.
返回Returns AbstractFilesystem
返回AbstractFilesystem。Returns abstract filesystem.
源码Source io/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:234–286
基于官方固定版本源码静态生成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.