Files
openclaw/extensions/codex/src/command-presentation.ts
Peter Steinberger d641126c1d feat(plugin-sdk): add typed presentation command actions (#88721)
* 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
2026-05-31 18:48:45 +01:00

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 },
})),
},
],
};
}