refactor: drive verify script from patch contract / 讓 verify script 讀 patch contract

This commit is contained in:
Alice (OpenClaw)
2026-05-14 10:00:03 +08:00
parent 9cb368bbd2
commit 6e726a641e
2 changed files with 35 additions and 12 deletions

View File

@@ -0,0 +1,26 @@
import fs from "node:fs"
import path from "node:path"
const contractPath = path.join(import.meta.dirname, "..", "generated", "openclaw-telegram-patch-contract.json")
const contract = JSON.parse(fs.readFileSync(contractPath, "utf-8"))
const targets = {
send: {
defaultButtonsInjected: "buildInlineKeyboard(opts.buttons ??",
continueCallback: contract.defaultButtons[0][0].callback_data,
stopCallback: contract.defaultButtons[0][1].callback_data,
continueLabel: contract.defaultButtons[0][0].text,
stopLabel: contract.defaultButtons[0][1].text,
},
bot: {
stateFilePath: "reply-end-controls.json",
debugLogPath: "reply-end-debug.log",
continueAck: contract.resolved.continue.acknowledgement,
stopAck: contract.resolved.stop.acknowledgement,
stopPolicy: contract.stopPolicyText,
resolvedContinueLabel: contract.resolved.continue.buttons[0][0].text,
resolvedStopLabel: contract.resolved.stop.buttons[0][1].text,
},
}
process.stdout.write(`${JSON.stringify(targets, null, 2)}\n`)