ResolvePath returns the absolute config file path for the given client + scope, honoring ~ and the current working directory.
(scope Scope)
| 75 | // ResolvePath returns the absolute config file path for the given client + |
| 76 | // scope, honoring ~ and the current working directory. |
| 77 | func (c ClientSpec) ResolvePath(scope Scope) string { |
| 78 | switch scope { |
| 79 | case UserScope: |
| 80 | return pathutil.Expand(c.UserPath) |
| 81 | case ProjectScope: |
| 82 | if c.ProjectPath == "" { |
| 83 | return "" |
| 84 | } |
| 85 | if filepath.IsAbs(c.ProjectPath) { |
| 86 | return c.ProjectPath |
| 87 | } |
| 88 | wd, _ := os.Getwd() |
| 89 | return filepath.Join(wd, c.ProjectPath) |
| 90 | } |
| 91 | return "" |
| 92 | } |
| 93 | |
| 94 | // Server is the canonical CAM-side representation of an installed MCP server. |
| 95 | type Server struct { |
no test coverage detected