mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
* fix(ci): route messaging temp files through openclaw tmp dir * fix(ci): clear qa-lab follow-up guardrails * fix(ci): own-check ACP fallback resolvers * fix(ci): preserve memory-core write error causes * fix(ci): narrow qa-channel boundary alias * fix(test): type memory-core dreaming api stubs
31 lines
827 B
TypeScript
31 lines
827 B
TypeScript
import fs from "node:fs/promises";
|
|
import path from "node:path";
|
|
import { resolvePreferredOpenClawTmpDir } from "../api.js";
|
|
import { DiffArtifactStore } from "./store.js";
|
|
|
|
export async function createTempDiffRoot(prefix: string): Promise<{
|
|
rootDir: string;
|
|
cleanup: () => Promise<void>;
|
|
}> {
|
|
const rootDir = await fs.mkdtemp(path.join(resolvePreferredOpenClawTmpDir(), prefix));
|
|
return {
|
|
rootDir,
|
|
cleanup: async () => {
|
|
await fs.rm(rootDir, { recursive: true, force: true });
|
|
},
|
|
};
|
|
}
|
|
|
|
export async function createDiffStoreHarness(prefix: string): Promise<{
|
|
rootDir: string;
|
|
store: DiffArtifactStore;
|
|
cleanup: () => Promise<void>;
|
|
}> {
|
|
const { rootDir, cleanup } = await createTempDiffRoot(prefix);
|
|
return {
|
|
rootDir,
|
|
store: new DiffArtifactStore({ rootDir }),
|
|
cleanup,
|
|
};
|
|
}
|