MCPcopy Index your code
hub / github.com/cobusgreyling/loop-engineering / loadState

Function loadState

tools/mcp-server/src/resolver.ts:137–146  ·  view source on GitHub ↗
(root: string, stateFile?: string)

Source from the content-addressed store, hash-verified

135}
136
137export async function loadState(root: string, stateFile?: string): Promise<string | null> {
138 const target = stateFile ?? 'STATE.md';
139 try {
140 assertSafeSegment(target, 'stateFile');
141 } catch {
142 return null;
143 }
144 if (!(STATE_FILE_CANDIDATES as readonly string[]).includes(target)) return null;
145 return readFileIfExists(path.join(root, target));
146}
147
148export async function listStateFiles(root: string): Promise<string[]> {
149 const found: string[] = [];

Callers 2

server.test.mjsFile · 0.85
index.tsFile · 0.85

Calls 2

assertSafeSegmentFunction · 0.85
readFileIfExistsFunction · 0.85

Tested by

no test coverage detected