mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 04:42:54 +00:00
* feat(plugin-sdk): add typed presentation command actions * test: use shared env helper in telegram bot tests * test: expect typed approval actions * test: expect typed sdk approval actions
24 lines
595 B
TypeScript
24 lines
595 B
TypeScript
import type { MessagePresentation } from "openclaw/plugin-sdk/interactive-runtime";
|
|
|
|
export type CodexCommandPickerButton = { label: string; command: string };
|
|
|
|
export function buildCodexCommandPickerPresentation(
|
|
title: string,
|
|
prompt: string,
|
|
buttons: CodexCommandPickerButton[],
|
|
): MessagePresentation {
|
|
return {
|
|
title,
|
|
blocks: [
|
|
{ type: "text", text: prompt },
|
|
{
|
|
type: "buttons",
|
|
buttons: buttons.map((button) => ({
|
|
label: button.label,
|
|
action: { type: "command", command: button.command },
|
|
})),
|
|
},
|
|
],
|
|
};
|
|
}
|