UNPKG

@botpress/adk-cli

Version:

Command-line interface for the Botpress Agent Development Kit (ADK)

27 lines (24 loc) 1.23 kB
// @bun import { exports_exports, isPlainObject_default, isString_default } from "./chunk-54qt5g7m.js"; // ../../node_modules/.bun/llmz@0.0.79+b49d396f5ed96e7f/node_modules/llmz/dist/chunk-UOPTKXLE.js function isAnyJsxComponent(component) { return typeof component === "object" && component !== null && "__jsx" in component && component.__jsx === true && typeof component.type === "string"; } function isJsxComponent(type, component) { return typeof component === "object" && component !== null && "__jsx" in component && component.__jsx === true && typeof component.type === "string" && typeof type === "string" && component.type.toUpperCase().trim() === type.toUpperCase().trim(); } var createJsxComponent = (props) => ({ __jsx: true, type: isString_default(props.type) ? props.type.toUpperCase() : "__unknown__", children: Array.isArray(props.children) ? props.children : props.children ? [props.children] : [], props: isPlainObject_default(props.props) ? props.props : {} }); var Jsx = exports_exports.custom((value) => isAnyJsxComponent(value), (value) => ({ params: { value }, message: `Invalid JSX component: ${value}` })); export { isAnyJsxComponent, isJsxComponent, createJsxComponent, Jsx };