MCPcopy Create free account
hub / github.com/astercloud/aster / resolvePath

Method resolvePath

pkg/memory/working.go:285–305  ·  view source on GitHub ↗

resolvePath 根据 scope 解析存储路径

(threadID, resourceID string)

Source from the content-addressed store, hash-verified

283
284// resolvePath 根据 scope 解析存储路径
285func (wm *WorkingMemoryManager) resolvePath(threadID, resourceID string) string {
286 var filename string
287
288 switch wm.scope {
289 case ScopeThread:
290 if threadID == "" {
291 // 如果没有 threadID,使用 resourceID 作为后备
292 threadID = resourceID
293 }
294 filename = filepath.ToSlash(filepath.Join(wm.basePath, "threads", threadID+".json"))
295
296 case ScopeResource:
297 if resourceID == "" {
298 // 如果没有 resourceID,使用 threadID 作为后备
299 resourceID = threadID
300 }
301 filename = filepath.ToSlash(filepath.Join(wm.basePath, "resources", resourceID+".json"))
302 }
303
304 return filename
305}

Callers 3

GetMethod · 0.95
UpdateMethod · 0.95
DeleteMethod · 0.95

Calls 1

JoinMethod · 0.45

Tested by

no test coverage detected