MCPcopy Create free account
hub / github.com/coder/coder / captureSnapshot

Function captureSnapshot

agent/x/agentmcp/manager.go:714–729  ·  view source on GitHub ↗

captureSnapshot stats each path and returns the current snapshot map.

(paths []string)

Source from the content-addressed store, hash-verified

712// captureSnapshot stats each path and returns the current
713// snapshot map.
714func captureSnapshot(paths []string) map[string]fileSnapshot {
715 snap := make(map[string]fileSnapshot, len(paths))
716 for _, p := range paths {
717 info, err := os.Stat(p)
718 if err != nil {
719 snap[p] = fileSnapshot{exists: false}
720 continue
721 }
722 snap[p] = fileSnapshot{
723 exists: true,
724 modTime: info.ModTime(),
725 size: info.Size(),
726 }
727 }
728 return snap
729}
730
731// cachedTools returns the cached tool list. Thread-safe.
732func (m *Manager) cachedTools() []workspacesdk.MCPToolInfo {

Callers 1

parseAndDedupMethod · 0.85

Calls 1

SizeMethod · 0.80

Tested by

no test coverage detected