agents
Version:
A home for your AI agents
31 lines (30 loc) • 981 B
JavaScript
//#region src/channels/tool-schema.ts
const channelMessageJsonSchema = {
type: "object",
properties: {
title: {
type: "string",
description: "Optional title or topic for the message"
},
markdown: {
type: "string",
minLength: 1,
description: "Message content formatted as Markdown"
}
},
required: ["markdown"],
additionalProperties: false
};
function parseChannelMessage(value) {
if (typeof value === "object" && value !== null) {
const candidate = value;
if (typeof candidate.markdown === "string" && candidate.markdown.length > 0 && (candidate.title === void 0 || typeof candidate.title === "string")) return {
...typeof candidate.title === "string" ? { title: candidate.title } : {},
markdown: candidate.markdown
};
}
throw new Error("Expected an optional string title and a non-empty Markdown string");
}
//#endregion
export { parseChannelMessage as n, channelMessageJsonSchema as t };
//# sourceMappingURL=tool-schema-CBjGPrsQ.js.map