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

Function _readLegacyNodeId

src/proxy/lifecycle/manager.js:132–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

130// resolved location without monkey-patching globals.
131// - The install-root path uses __dirname so it's stable across cwd changes.
132function _readLegacyNodeId() {
133 const candidates = [
134 getEvomapPath('node_id'),
135 path.resolve(__dirname, '..', '..', '..', '.evomap_node_id'),
136 ];
137 for (const file of candidates) {
138 try {
139 if (!fs.existsSync(file)) continue;
140 const raw = fs.readFileSync(file, 'utf8').trim();
141 if (NODE_ID_RE.test(raw)) return raw;
142 } catch {
143 // Unreadable / racing writer — try the next location.
144 }
145 }
146 return null;
147}
148
149// Mirror of src/gep/a2aProtocol.js `_persistNodeId`. Pure-proxy daemons
150// (EVOMAP_PROXY=1, no a2aProtocol heartbeat thread) mint their own

Callers 1

helloMethod · 0.85

Calls 1

getEvomapPathFunction · 0.85

Tested by

no test coverage detected