mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-23 15:11:42 +00:00
Plugin SDK: move generic message tool schemas out of core
This commit is contained in:
@@ -34,7 +34,7 @@ export type * from "../channels/plugins/types.js";
|
||||
export * from "../channels/plugins/config-writes.js";
|
||||
export * from "../channels/plugins/directory-adapters.js";
|
||||
export * from "../channels/plugins/media-payload.js";
|
||||
export * from "../channels/plugins/message-tool-schema.js";
|
||||
export * from "./message-tool-schema.js";
|
||||
export * from "../channels/plugins/normalize/signal.js";
|
||||
export * from "../channels/plugins/normalize/whatsapp.js";
|
||||
export * from "../channels/plugins/outbound/direct-text-media.js";
|
||||
|
||||
28
src/plugin-sdk/message-tool-schema.ts
Normal file
28
src/plugin-sdk/message-tool-schema.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Type } from "@sinclair/typebox";
|
||||
import type { TSchema } from "@sinclair/typebox";
|
||||
import { stringEnum } from "../agents/schema/typebox.js";
|
||||
|
||||
export function createMessageToolButtonsSchema(): TSchema {
|
||||
return Type.Array(
|
||||
Type.Array(
|
||||
Type.Object({
|
||||
text: Type.String(),
|
||||
callback_data: Type.String(),
|
||||
style: Type.Optional(stringEnum(["danger", "success", "primary"])),
|
||||
}),
|
||||
),
|
||||
{
|
||||
description: "Button rows for channels that support button-style actions.",
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function createMessageToolCardSchema(): TSchema {
|
||||
return Type.Object(
|
||||
{},
|
||||
{
|
||||
additionalProperties: true,
|
||||
description: "Structured card payload for channels that support card-style messages.",
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user