Plugin SDK: move generic message tool schemas out of core

This commit is contained in:
Gustavo Madeira Santana
2026-03-19 01:06:22 -04:00
parent b48194a07e
commit eaee01042b
3 changed files with 3 additions and 3 deletions

View File

@@ -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";

View 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.",
},
);
}