@ai.ntellect/core 0.7.5 → 0.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/types/index.ts CHANGED
@@ -81,17 +81,14 @@ export type GraphContext<T> = SchemaType<T>;
81
81
  export interface Node<T extends ZodSchema, I = any> {
82
82
  /** Name of the node */
83
83
  name: string;
84
+ /** Description of the node */
85
+ description?: string;
84
86
  /** Schema for node inputs */
85
- inputs?: I extends void ? never : ZodSchema<I>;
86
- /** Schema for node outputs */
87
- outputs?: ZodSchema;
87
+ params?: I extends void ? never : ZodSchema<I>;
88
88
  /** Execute function for the node */
89
- execute: (
90
- context: GraphContext<T>,
91
- inputs: I extends void ? never : I
92
- ) => Promise<void>;
89
+ execute: (context: GraphContext<T>, params?: I) => Promise<void>;
93
90
  /** Optional condition for node execution */
94
- condition?: (context: GraphContext<T>) => boolean;
91
+ condition?: (context: GraphContext<T>, params?: I) => boolean;
95
92
  /** Array of next node names */
96
93
  next?: string[] | ((context: GraphContext<T>) => string[]);
97
94
  /** Array of event names that trigger this node */
@@ -5,8 +5,8 @@ export const generateActionSchema = (graphs: GraphFlow<any>[]) => {
5
5
  return graphs
6
6
  .map((graph) => {
7
7
  const rootNode = Array.from(graph.nodes.values())[0];
8
- const schemaStr = rootNode.inputs
9
- ? getSchemaString(rootNode.inputs)
8
+ const schemaStr = rootNode.params
9
+ ? getSchemaString(rootNode.params)
10
10
  : "No parameters";
11
11
  return `Workflow: ${graph.name}\nParameters: ${schemaStr}`;
12
12
  })