import type { ZodType } from "zod"; import type { TypeToken } from "../di"; import type { Item, Items, NodeExecutionContext, RunnableNodeConfig } from "../types"; import { ItemHarnessNode } from "./ItemHarnessNode"; export class ItemHarnessNodeConfig implements RunnableNodeConfig { readonly kind = "node" as const; readonly type: TypeToken = ItemHarnessNode; constructor( public readonly name: string, public readonly inputSchema: ZodType, public readonly runOne: (args: { input: TIn; item: Item; itemIndex: number; items: Items; ctx: NodeExecutionContext>; }) => TOut | Promise, public readonly opts: Readonly<{ id?: string; }> = {}, ) {} get id(): string | undefined { return this.opts.id; } }