/** * @module CogniNode * * @CogniNode() class decorator that attaches type and version metadata to a * BaseNode subclass. Validates both fields at decoration time (module load), * so a misconfigured node fails immediately at process start instead of * silently at first workflow execution. */ import type { BaseNode } from '../BaseNode.js'; /** * Options for the @CogniNode() class decorator. * Both fields are validated at decoration time — errors throw immediately * on module import, not at first execution. */ export interface CogniNodeOptions { /** * The node's unique type identifier. * Must be a non-empty string matching the node's npm package name. * E.g. '@cognipipe/node-http', '@myorg/node-sendgrid'. * NodeRegistry matches steps to nodes by comparing this value to `step.uses`. */ type: string; /** * Semantic version of the node package. * Must satisfy /^\d+\.\d+\.\d+$/ — no 'v' prefix, no pre-release tags. * Must match the `version` field in the node's package.json. * E.g. '1.0.0', '2.3.1'. */ version: string; } /** * Class decorator that attaches type and version metadata to a BaseNode subclass. * Required on every node class — NodeRegistry uses this to identify and instantiate nodes. * * Validates both options at decoration time (module load), so misconfigured nodes * fail immediately rather than silently at workflow execution. * * @throws {CogniPipeError} NODE_INSTANTIATION_FAILED if `type` is empty or * `version` does not match strict semver format. * * @example * ```typescript * @CogniNode({ type: '@cognipipe/node-http', version: '1.0.0' }) * export class HttpNode extends BaseNode { * async execute(config, ctx) { ... } * } * * HttpNode.cogniNodeMeta; // → { type: '@cognipipe/node-http', version: '1.0.0' } * ``` */ export declare function CogniNode(options: CogniNodeOptions): (target: T, context: ClassDecoratorContext) => void; //# sourceMappingURL=CogniNode.d.ts.map