Refactor pipeline policies, MCP registry, and unified config/runtime
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
||||
import { mkdir, readFile } from "node:fs/promises";
|
||||
import { dirname, resolve } from "node:path";
|
||||
import { writeUtf8FileAtomic } from "./file-persistence.js";
|
||||
import { deepCloneJson, isRecord, type JsonObject, type JsonValue } from "./types.js";
|
||||
|
||||
export type SessionHistoryEntry = {
|
||||
@@ -200,7 +201,7 @@ export class FileSystemStateContextManager {
|
||||
async writeState(sessionId: string, state: StoredSessionState): Promise<void> {
|
||||
const path = toStatePath(this.rootDirectory, sessionId);
|
||||
await mkdir(dirname(path), { recursive: true });
|
||||
await writeFile(path, `${JSON.stringify(state, null, 2)}\n`, "utf8");
|
||||
await writeUtf8FileAtomic(path, `${JSON.stringify(state, null, 2)}\n`);
|
||||
}
|
||||
|
||||
async patchState(
|
||||
@@ -248,7 +249,7 @@ export class FileSystemStateContextManager {
|
||||
|
||||
const path = toHandoffPath(this.rootDirectory, sessionId, handoff.nodeId);
|
||||
await mkdir(dirname(path), { recursive: true });
|
||||
await writeFile(path, `${JSON.stringify(nodeHandoff, null, 2)}\n`, "utf8");
|
||||
await writeUtf8FileAtomic(path, `${JSON.stringify(nodeHandoff, null, 2)}\n`);
|
||||
return nodeHandoff;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user