captureSnapshot stats each path and returns the current snapshot map.
(paths []string)
| 712 | // captureSnapshot stats each path and returns the current |
| 713 | // snapshot map. |
| 714 | func 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. |
| 732 | func (m *Manager) cachedTools() []workspacesdk.MCPToolInfo { |