UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

25 lines (24 loc) • 1.17 kB
import { b as extractSqliteTableSchema } from "./sqlite-schema-facts-BVf0E_0z.mjs"; import { a as runSqliteImmediateTransactionSync } from "./sqlite-transaction-DBRLvCDM.mjs"; import { t as OPENCLAW_AGENT_SCHEMA_SQL } from "./openclaw-agent-schema-V6rru8Sr.mjs"; //#region src/state/openclaw-agent-message-tool-outcome-schema.ts const MESSAGE_TOOL_RUN_OUTCOMES_TABLE = "message_tool_run_outcomes"; const ENSURED_DATABASES = /* @__PURE__ */ new WeakSet(); /** Lazily installs the additive outcome table on first use. */ function ensureMessageToolRunOutcomeSchema(db, admit) { if (ENSURED_DATABASES.has(db)) return; runSqliteImmediateTransactionSync(db, () => { admit?.("transaction"); db.exec(extractSqliteTableSchema(OPENCLAW_AGENT_SCHEMA_SQL, MESSAGE_TOOL_RUN_OUTCOMES_TABLE, { endMarker: "CREATE TABLE IF NOT EXISTS session_goal_operations (", includeEndMarker: false, errorMessage: "OpenClaw message-tool run outcome schema markers are missing." })); }, { withCommit(commit) { admit?.("commit"); commit(); } }); ENSURED_DATABASES.add(db); } //#endregion export { ensureMessageToolRunOutcomeSchema as n, MESSAGE_TOOL_RUN_OUTCOMES_TABLE as t };