MCPcopy
hub / github.com/coder/mux / RestrictedTestRuntime

Class RestrictedTestRuntime

src/node/services/streamContextBuilder.test.ts:245–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243});
244
245class RestrictedTestRuntime extends TestRuntime {
246 constructor(
247 projectPath: string,
248 muxHomePath: string,
249 private readonly readableRoot: string
250 ) {
251 super(projectPath, muxHomePath);
252 }
253
254 override readFile(filePath: string, abortSignal?: AbortSignal): ReadableStream<Uint8Array> {
255 const root = path.resolve(this.readableRoot);
256 const target = path.resolve(filePath);
257 if (target !== root && !target.startsWith(`${root}${path.sep}`)) {
258 throw new Error(`RestrictedTestRuntime cannot read outside ${root}: ${target}`);
259 }
260 return super.readFile(filePath, abortSignal);
261 }
262}
263
264describe("buildStreamSystemContext", () => {
265 test("includes proactive memory guidance only when the memory tool is available", async () => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected