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

Method LoadInfo

pkg/store/json.go:279–290  ·  view source on GitHub ↗

LoadInfo 加载Agent元信息

(ctx context.Context, agentID string)

Source from the content-addressed store, hash-verified

277
278// LoadInfo 加载Agent元信息
279func (js *JSONStore) LoadInfo(ctx context.Context, agentID string) (*types.AgentInfo, error) {
280 js.mu.RLock()
281 defer js.mu.RUnlock()
282
283 var info types.AgentInfo
284 path := filepath.Join(js.agentDir(agentID), "info.json")
285 if err := js.loadJSON(path, &info); err != nil {
286 return nil, err
287 }
288
289 return &info, nil
290}
291
292// SaveTodos 保存Todo列表
293func (js *JSONStore) SaveTodos(ctx context.Context, agentID string, todos any) error {

Callers

nothing calls this directly

Calls 3

agentDirMethod · 0.95
loadJSONMethod · 0.95
JoinMethod · 0.45

Tested by

no test coverage detected