MemoryStoreFilesystem
public final class MemoryStoreFilesystem implements AbstractFilesystem
io/agentscope/builder/web/managed/MemoryStoreFilesystem.java:55–421记忆存储文件系统,承载智能体的部署、调度与服务化运行。位于 io.agentscope.builder.web.managed 包,实现 AbstractFilesystem。核心成员包括 storeId、storeName、accessMode、isReadOnly、routePrefix、ls。
AbstractFilesystem view over a single MemoryStoreService store, mounted under
memory-stores/{storeName}/ via io.agentscope.harness.agent.HarnessAgent.Builder#filesystemRoute.
Paths are relative to the store root (e.g. notes.md or /notes.md both
address the same memory document). Writes/edits create a new versioned MemoryVersionEntity via MemoryStoreService#putMemory; reads/listing go against the
live JPA-backed documents.
This is a pragmatic, flat-namespace implementation: the store has no real subdirectories, so
ls/grep/glob operate over the full set of memory paths rather than
honoring hierarchical directory semantics. Upload/download of binary content is not supported
— memory documents are plain-text only.
构造器摘要Constructor Summary
方法摘要Method Summary
构造器详情Constructor Detail
MemoryStoreFilesystem
public MemoryStoreFilesystem(MemoryStoreService memoryStoreService, String ownerId, String storeId, String storeName)
初始化 MemoryStoreFilesystem 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
memoryStoreService | MemoryStoreService | 记忆存储服务(类型 `MemoryStoreService`)。The memory store service. |
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
storeId | String | 存储标识(类型 `String`)。The store id. |
storeName | String | 存储名称(类型 `String`)。The store name. |
io/agentscope/builder/web/managed/MemoryStoreFilesystem.java:62–68MemoryStoreFilesystem
public MemoryStoreFilesystem(MemoryStoreService memoryStoreService, String ownerId, String storeId, String storeName, String accessMode)
初始化 MemoryStoreFilesystem 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
memoryStoreService | MemoryStoreService | 记忆存储服务(类型 `MemoryStoreService`)。The memory store service. |
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
storeId | String | 存储标识(类型 `String`)。The store id. |
storeName | String | 存储名称(类型 `String`)。The store name. |
accessMode | String | 访问模式(类型 `String`)。The access mode. |
io/agentscope/builder/web/managed/MemoryStoreFilesystem.java:70–102MemoryStoreFilesystem
public MemoryStoreFilesystem(MemoryDocumentStore documents, String ownerId, String storeId, String storeName, String accessMode)
初始化 MemoryStoreFilesystem 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
documents | MemoryDocumentStore | 文档列表(类型 `MemoryDocumentStore`)。The documents. |
ownerId | String | 所有者标识(类型 `String`)。The owner id. |
storeId | String | 存储标识(类型 `String`)。The store id. |
storeName | String | 存储名称(类型 `String`)。The store name. |
accessMode | String | 访问模式(类型 `String`)。The access mode. |
io/agentscope/builder/web/managed/MemoryStoreFilesystem.java:104–118方法详情Method Detail
storeId
public String storeId()
返回存储标识。
Returns the store id.
Stringio/agentscope/builder/web/managed/MemoryStoreFilesystem.java:122–124storeName
public String storeName()
返回存储名称。
Returns the store name.
Stringio/agentscope/builder/web/managed/MemoryStoreFilesystem.java:126–128accessMode
public String accessMode()
返回访问模式。
Returns the access mode.
Stringio/agentscope/builder/web/managed/MemoryStoreFilesystem.java:130–132isReadOnly
public boolean isReadOnly()
判断是否 isReadOnly。
Returns whether the read only.
booleanio/agentscope/builder/web/managed/MemoryStoreFilesystem.java:134–136routePrefix
public static String routePrefix(String storeName)
设置该参数。
Route prefix under which a memory store filesystem should be mounted.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
storeName | String | 存储名称(类型 `String`)。The store name. |
Stringio/agentscope/builder/web/managed/MemoryStoreFilesystem.java:139–141ls
public LsResult ls(RuntimeContext runtimeContext, String path)
执行 ls 方法。
Performs the ls operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The runtime context. |
path | String | 路径(类型 `String`)。The path. |
LsResultio/agentscope/builder/web/managed/MemoryStoreFilesystem.java:161–172read
public ReadResult read(RuntimeContext runtimeContext, String filePath, int offset, int limit)
执行读取相关操作。
Performs the read operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The runtime context. |
filePath | String | 文件路径(类型 `String`)。The file path. |
offset | int | 偏移量(类型 `int`)。The offset. |
limit | int | 数量上限(类型 `int`)。The limit. |
ReadResultio/agentscope/builder/web/managed/MemoryStoreFilesystem.java:174–195write
public WriteResult write(RuntimeContext runtimeContext, String filePath, String content)
执行写入相关操作。
Performs the write operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The runtime context. |
filePath | String | 文件路径(类型 `String`)。The file path. |
content | String | 内容(类型 `String`)。The content. |
WriteResultio/agentscope/builder/web/managed/MemoryStoreFilesystem.java:207–230edit
public EditResult edit(RuntimeContext runtimeContext, String filePath, String oldString, String newString, boolean replaceAll)
执行 edit 方法。
Performs the edit operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The runtime context. |
filePath | String | 文件路径(类型 `String`)。The file path. |
oldString | String | 旧的 String(类型 `String`)。The old string. |
newString | String | 新建 String(类型 `String`)。The new string. |
replaceAll | boolean | replace 所有(类型 `boolean`)。The replace all. |
EditResultio/agentscope/builder/web/managed/MemoryStoreFilesystem.java:232–273grep
public GrepResult grep(RuntimeContext runtimeContext, String pattern, String path, String glob)
执行 grep 方法。
Performs the grep operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The runtime context. |
pattern | String | pattern(类型 `String`)。The pattern. |
path | String | 路径(类型 `String`)。The path. |
glob | String | glob(类型 `String`)。The glob. |
GrepResultio/agentscope/builder/web/managed/MemoryStoreFilesystem.java:288–310glob
public GlobResult glob(RuntimeContext runtimeContext, String pattern, String path)
执行 glob 方法。
Performs the glob operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The runtime context. |
pattern | String | pattern(类型 `String`)。The pattern. |
path | String | 路径(类型 `String`)。The path. |
GlobResultio/agentscope/builder/web/managed/MemoryStoreFilesystem.java:312–326uploadFiles
public List<FileUploadResponse> uploadFiles(RuntimeContext runtimeContext, List<Map.Entry<String, byte[]>> files)
执行上传文件相关操作。
Performs the upload files operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The runtime context. |
files | List<Map.Entry<String, byte[]>> | 文件(类型 `List >`)。The files. |
List<FileUploadResponse>io/agentscope/builder/web/managed/MemoryStoreFilesystem.java:340–351downloadFiles
public List<FileDownloadResponse> downloadFiles(RuntimeContext runtimeContext, List<String> paths)
执行下载文件相关操作。
Performs the download files operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The runtime context. |
paths | List<String> | paths(类型 `List`)。The paths. |
List<FileDownloadResponse>io/agentscope/builder/web/managed/MemoryStoreFilesystem.java:353–363delete
public WriteResult delete(RuntimeContext runtimeContext, String path)
删除数据。
Performs the delete operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The runtime context. |
path | String | 路径(类型 `String`)。The path. |
WriteResultio/agentscope/builder/web/managed/MemoryStoreFilesystem.java:365–381move
public WriteResult move(RuntimeContext runtimeContext, String fromPath, String toPath)
执行 move 方法。
Performs the move operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The runtime context. |
fromPath | String | 来自路径(类型 `String`)。The from path. |
toPath | String | 到路径(类型 `String`)。The to path. |
WriteResultio/agentscope/builder/web/managed/MemoryStoreFilesystem.java:383–400exists
public boolean exists(RuntimeContext runtimeContext, String path)
判断数据是否存在。
Performs the exists operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。The runtime context. |
path | String | 路径(类型 `String`)。The path. |
booleanio/agentscope/builder/web/managed/MemoryStoreFilesystem.java:402–406