refactor: drive verify script from patch contract / 讓 verify script 讀 patch contract
This commit is contained in:
26
scripts/render-openclaw-verify-targets.mjs
Normal file
26
scripts/render-openclaw-verify-targets.mjs
Normal 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`)
|
||||
Reference in New Issue
Block a user