RemoteFilesystemSpec
public class RemoteFilesystemSpec
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
RemoteFilesysteminstances 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→ segmentroot -
memory/→ segmentmemory -
skills/→ segmentskills -
subagents/→ segmentsubagents -
knowledge/→ segmentknowledge -
plans/→ segmentplans -
agents/<agentId>/sessions/→ segmentsessions -
agents/<agentId>/tasks/→ segmenttasks
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
构造器详情Constructor Detail
RemoteFilesystemSpec
public RemoteFilesystemSpec()
初始化 RemoteFilesystemSpec 实例。
Creates a remote filesystem spec that defers store resolution to io.agentscope.harness.agent.DistributedStore#baseStore().
io/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:92–94RemoteFilesystemSpec
public RemoteFilesystemSpec(BaseStore store)
初始化 RemoteFilesystemSpec 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
store | BaseStore | 存储实例(类型 `BaseStore`)。The store. |
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).
booleanio/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:106–108store
public BaseStore store()
返回存储。
Returns the configured BaseStore, or null if not yet set.
BaseStoreio/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:116–118injectStoreIfAbsent
public void injectStoreIfAbsent(BaseStore store)
设置该参数。
Injects the store if not already set.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
store | BaseStore | 存储实例(类型 `BaseStore`)。The store. |
io/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:123–127anonymousUserId
public RemoteFilesystemSpec anonymousUserId(String userId)
设置该参数。
Sets the fallback user identifier when runtime userId is absent/blank.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
RemoteFilesystemSpecio/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:144–150isolationScope
public RemoteFilesystemSpec isolationScope(IsolationScope scope)
执行隔离范围相关操作。
Sets the isolation scope that controls the store namespace for shared files.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
scope | IsolationScope | 范围(类型 `IsolationScope`)。isolation scope |
RemoteFilesystemSpecio/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:161–167getIsolationScope
public IsolationScope getIsolationScope()
获取隔离范围。
Returns the isolation scope.
IsolationScopeio/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:169–171workspaceIndex
public RemoteFilesystemSpec workspaceIndex(WorkspaceIndex index)
设置工作区索引。
Sets the workspace index for accelerating remote filesystem reads (ls/glob/exists/grep).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
index | WorkspaceIndex | 索引(类型 `WorkspaceIndex`)。The index. |
RemoteFilesystemSpecio/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:177–180toFilesystem
public AbstractFilesystem toFilesystem(Path workspace, String agentId, NamespaceFactory localNamespaceFactory)
执行到文件系统相关操作。
Builds the composite filesystem described by this spec.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
workspace | Path | 工作区(类型 `Path`)。The workspace. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
localNamespaceFactory | NamespaceFactory | 本地命名空间工厂(类型 `NamespaceFactory`)。The local namespace factory. |
AbstractFilesystemio/agentscope/harness/agent/filesystem/spec/RemoteFilesystemSpec.java:234–286