openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
23 lines (22 loc) • 848 B
JavaScript
import { C as settleSqliteSnapshotRequest, c as captureSqliteReadOnlyWorkerLaunch, t as captureSqliteSnapshotStagingOwner } from "./sqlite-snapshot-staging-owner-fZYx7l2t.mjs";
import path from "node:path";
//#region src/infra/sqlite-snapshot-staging-allocation.ts
async function allocateWorkerOwnedSqliteSnapshotDirectory(inputRoot, allowLegacyWorker, signal) {
const root = path.resolve(inputRoot);
const { env, cwd } = captureSqliteReadOnlyWorkerLaunch();
const owner = captureSqliteSnapshotStagingOwner();
const request = owner.start({
type: "allocate",
root,
allowLegacyWorker,
launch: {
env,
cwd,
transport: { kind: "native" }
}
}, signal);
const reply = await settleSqliteSnapshotRequest(request);
return owner.retainDirectory(reply.directory);
}
//#endregion
export { allocateWorkerOwnedSqliteSnapshotDirectory };