MCPcopy Create free account
hub / github.com/EvoMap/evolver / codexConfigExpectsProxy

Function codexConfigExpectsProxy

src/ops/lifecycle.js:217–257  ·  view source on GitHub ↗
(env)

Source from the content-addressed store, hash-verified

215}
216
217function codexConfigExpectsProxy(env) {
218 var file = getCodexConfigFile(env);
219 if (!file || !fs.existsSync(file)) return false;
220 var selectedProvider = null;
221 var section = '';
222 var providerUrls = {};
223 try {
224 var content = fs.readFileSync(file, 'utf8');
225 for (var line of content.split(/\r?\n/)) {
226 var clean = stripTomlComment(line);
227 if (!clean) continue;
228 var sectionMatch = clean.match(/^\[([^\]]+)\]$/);
229 if (sectionMatch) {
230 section = sectionMatch[1].trim();
231 continue;
232 }
233 var kv = clean.match(/^([A-Za-z0-9_.-]+)\s*=\s*([\s\S]+)$/);
234 if (!kv) continue;
235 var key = kv[1].trim();
236 var val = readTomlStringValue(kv[2]);
237 if (!section && key === 'model_provider') {
238 selectedProvider = val;
239 continue;
240 }
241 var providerMatch = section.match(/^model_providers\.([A-Za-z0-9_.-]+)$/);
242 if (providerMatch && key === 'base_url') {
243 providerUrls[providerMatch[1]] = val;
244 continue;
245 }
246 if (!section && key === 'base_url' && isLoopbackProxyUrl(val)) {
247 return true;
248 }
249 }
250 } catch (_) {
251 return false;
252 }
253 if (selectedProvider && isLoopbackProxyUrl(providerUrls[selectedProvider])) return true;
254 return Object.keys(providerUrls).some(function(name) {
255 return /(?:evomap|proxy)/i.test(name) && isLoopbackProxyUrl(providerUrls[name]);
256 });
257}
258
259function clientSettingsExpectProxy(env) {
260 var settings = readJsonFile(getClaudeSettingsFile(env));

Callers 1

expectsProxyFunction · 0.85

Calls 4

getCodexConfigFileFunction · 0.85
stripTomlCommentFunction · 0.85
readTomlStringValueFunction · 0.85
isLoopbackProxyUrlFunction · 0.70

Tested by

no test coverage detected