openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
21 lines (20 loc) • 1.16 kB
JavaScript
import { s as requestSqliteWorkerOperationAdmission } from "./sqlite-worker-operation-admission-C5lBzzTk.mjs";
import { b as requireOpenClawStateDatabaseIdentity } from "./openclaw-state-db-cache-CmYLFRSt.mjs";
import { l as runOpenClawStateWriteTransaction } from "./openclaw-state-db-DJZ7EKoI.mjs";
import { h as releaseExitedOpenClawAgentDatabaseLeaseInDatabase } from "./openclaw-agent-db-lease-zP0JO4hP.mjs";
//#region src/state/openclaw-agent-execution-cleanup.worker.ts
function executeAgentDatabaseCleanupCommand(command, database, env) {
runOpenClawStateWriteTransaction((current) => {
if (current.path !== command.input.sharedStatePath || requireOpenClawStateDatabaseIdentity(current).key !== command.input.sharedStateIdentity) throw new Error("Retired agent cleanup cannot adopt a replacement shared database");
releaseExitedOpenClawAgentDatabaseLeaseInDatabase(current.db, command.input, command.input.outcome, () => requestSqliteWorkerOperationAdmission({
stage: "prepare",
facts: "agent-integrity-invalidated"
}));
}, {
database,
path: database.path,
env
});
}
//#endregion
export { executeAgentDatabaseCleanupCommand };