@datatechsolutions/ui 2.11.62 → 2.11.63

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.
@@ -22,10 +22,33 @@ type IfElseNodeConfig = {
22
22
  }>;
23
23
  logicalOperator: 'and' | 'or';
24
24
  };
25
+ type CodeOperation = 'passthrough' | 'return' | 'merge' | 'pick' | 'parse_json' | 'regex_extract' | 'xml_titles';
25
26
  type CodeNodeConfig = {
26
27
  type: 'code';
27
28
  language: 'javascript' | 'python' | 'typescript';
28
29
  code: string;
30
+ } | {
31
+ type: 'code';
32
+ operation: CodeOperation;
33
+ /** Dotted ref into the variable pool (`nodeId.path`) for ops that
34
+ * read a specific upstream value. Leave empty for `passthrough`
35
+ * which reads the sole incoming edge automatically. */
36
+ from?: string;
37
+ /** `return` — the literal JSON value to emit. */
38
+ value?: unknown;
39
+ /** `pick` — whitelist of keys to project off `incoming`. */
40
+ fields?: string[];
41
+ /** `regex_extract` — regex pattern and flags (`i m s x U R`;
42
+ * `g` is implicit). `group` defaults to 1 (first capture group). */
43
+ pattern?: string;
44
+ flags?: string;
45
+ group?: number;
46
+ /** `regex_extract` / `xml_titles` — key name to expose matches
47
+ * under in the node's output object (default: `matches` / `titles`). */
48
+ output?: string;
49
+ /** `xml_titles` — by default drops the channel/feed title; set
50
+ * `true` to keep it in the result array. */
51
+ keepChannel?: boolean;
29
52
  };
30
53
  type HttpRequestNodeConfig = {
31
54
  type: 'http_request';
@@ -140,23 +163,63 @@ type EntityNodeConfig = {
140
163
  outputVariable: string;
141
164
  limit: number;
142
165
  };
166
+ type DatasourceFilterOp = 'eq' | 'neq' | 'lt' | 'lte' | 'gt' | 'gte' | 'like' | 'in';
167
+ type DatasourceFilter = {
168
+ /** Column identifier — must match `[a-zA-Z0-9_]+` (validator enforces). */
169
+ column: string;
170
+ /** Comparison operator; defaults to `eq` when omitted. */
171
+ op?: DatasourceFilterOp;
172
+ /** Scalar (string / number / bool) or array (required when op = `in`).
173
+ * Strings may reference pool variables via `{{ nodeId.path }}` /
174
+ * `{{ inputs.field }}` — the engine renders them before binding. */
175
+ value?: string | number | boolean | Array<string | number | boolean> | null;
176
+ };
143
177
  type DatasourceNodeConfig = {
144
178
  type: 'datasource';
145
179
  datasourceId: string;
146
180
  dialect: string;
147
181
  table: string;
148
182
  selectedColumns: string[];
149
- filterVariables: Record<string, string>;
183
+ /** Preferred shape: full filter array with per-row operator. */
184
+ filters?: DatasourceFilter[];
185
+ /** Legacy: variable-name → column-name map (implicit `eq`). Kept so
186
+ * older graphs still load; new UI writes `filters` instead. */
187
+ filterVariables?: Record<string, string>;
150
188
  outputVariable: string;
151
189
  limit: number;
152
190
  };
153
191
  type RuleNodeConfig = {
154
192
  type: 'rule';
193
+ /** Slug / id of the rule row in `astrlabe.agent_rules`. Required for
194
+ * the rule executor to resolve a definition at run-time. */
195
+ ruleId?: string;
196
+ /** Execution priority when several rules feed into the same branch. */
197
+ priority?: number;
198
+ /** Master switch. Disabled rules are skipped at run-time. */
199
+ enabled?: boolean;
155
200
  entityId?: string;
156
201
  outputVariable?: string;
157
202
  priceVariable?: string;
158
203
  contextVariables?: Record<string, string>;
159
204
  };
205
+ type AgentNodeConfig = {
206
+ type: 'agent';
207
+ /** `astrlabe.agents.id` — identifies which agent config to run. */
208
+ agentId?: string;
209
+ /** Preferred path: references `astrlabe.model_provider_connections.id`. */
210
+ connectionId?: string;
211
+ /** Escape hatch: inline provider + model when no connection row exists. */
212
+ provider?: ModelProviderType;
213
+ model?: string;
214
+ /** Optional override of the agent's stored model id. */
215
+ modelId?: string;
216
+ /** System + user prompts rendered through the template engine
217
+ * (`{{ nodeId.path }}` / `{{ inputs.x }}`). */
218
+ systemPrompt?: string;
219
+ userPrompt?: string;
220
+ maxTokens?: number;
221
+ temperature?: number;
222
+ };
160
223
  type ModelProviderType = 'aws_bedrock' | 'openai_api' | 'google_vertex' | 'azure_openai' | 'anthropic_api' | 'groq' | 'mistral' | 'huggingface' | 'ollama' | 'custom';
161
224
  type ModelProviderNodeConfig = {
162
225
  type: 'model_provider';
@@ -184,7 +247,7 @@ type DashboardOutputNodeConfig = {
184
247
  /** Reference to an upstream node's value (`"nodeId"` or `"nodeId.path"`) that already conforms to DashboardSpec. */
185
248
  dashboardFrom?: string;
186
249
  };
187
- type LogicNodeConfig = StartNodeConfig | EndNodeConfig | IfElseNodeConfig | CodeNodeConfig | HttpRequestNodeConfig | TemplateTransformNodeConfig | IterationNodeConfig | KnowledgeBaseNodeConfig | AnswerNodeConfig | QuestionClassifierNodeConfig | ParameterExtractorNodeConfig | VariableAssignerNodeConfig | VariableAggregatorNodeConfig | DocumentExtractorNodeConfig | ListOperatorNodeConfig | IterationStartNodeConfig | NoteNodeConfig | GroupNodeConfig | EntityNodeConfig | DatasourceNodeConfig | RuleNodeConfig | ModelProviderNodeConfig | DashboardOutputNodeConfig;
250
+ type LogicNodeConfig = StartNodeConfig | EndNodeConfig | IfElseNodeConfig | CodeNodeConfig | HttpRequestNodeConfig | TemplateTransformNodeConfig | IterationNodeConfig | KnowledgeBaseNodeConfig | AnswerNodeConfig | QuestionClassifierNodeConfig | ParameterExtractorNodeConfig | VariableAssignerNodeConfig | VariableAggregatorNodeConfig | DocumentExtractorNodeConfig | ListOperatorNodeConfig | IterationStartNodeConfig | NoteNodeConfig | GroupNodeConfig | EntityNodeConfig | DatasourceNodeConfig | RuleNodeConfig | AgentNodeConfig | ModelProviderNodeConfig | DashboardOutputNodeConfig;
188
251
  type WorkflowNodeData = {
189
252
  entityId: string;
190
253
  label: string;
@@ -323,4 +386,4 @@ type AgentRule = {
323
386
  [key: string]: unknown;
324
387
  };
325
388
 
326
- export type { AgentConfig, AgentModel, AgentRule, AgentTool, AnswerNodeConfig, CodeNodeConfig, DashboardOutputNodeConfig, DatasourceNodeConfig, DocumentExtractorNodeConfig, EndNodeConfig, EntityNodeConfig, GroupNodeConfig, HttpRequestNodeConfig, IfElseNodeConfig, IterationNodeConfig, IterationStartNodeConfig, KnowledgeBaseNodeConfig, ListOperatorNodeConfig, LogicNodeConfig, ModelProviderNodeConfig, ModelProviderType, NodeExecutionResult, NoteNodeConfig, ParameterExtractorNodeConfig, QuestionClassifierNodeConfig, RuleNodeConfig, StartNodeConfig, TemplateTransformNodeConfig, VariableAggregatorNodeConfig, VariableAssignerNodeConfig, VariableValue, Workflow, WorkflowEdge, WorkflowGraph, WorkflowNode, WorkflowNodeData, WorkflowNodeStatus, WorkflowNodeType, WorkflowRun, WorkflowRunStatus, WorkflowTool, WorkflowViewport };
389
+ export type { AgentConfig, AgentModel, AgentNodeConfig, AgentRule, AgentTool, AnswerNodeConfig, CodeNodeConfig, CodeOperation, DashboardOutputNodeConfig, DatasourceFilter, DatasourceFilterOp, DatasourceNodeConfig, DocumentExtractorNodeConfig, EndNodeConfig, EntityNodeConfig, GroupNodeConfig, HttpRequestNodeConfig, IfElseNodeConfig, IterationNodeConfig, IterationStartNodeConfig, KnowledgeBaseNodeConfig, ListOperatorNodeConfig, LogicNodeConfig, ModelProviderNodeConfig, ModelProviderType, NodeExecutionResult, NoteNodeConfig, ParameterExtractorNodeConfig, QuestionClassifierNodeConfig, RuleNodeConfig, StartNodeConfig, TemplateTransformNodeConfig, VariableAggregatorNodeConfig, VariableAssignerNodeConfig, VariableValue, Workflow, WorkflowEdge, WorkflowGraph, WorkflowNode, WorkflowNodeData, WorkflowNodeStatus, WorkflowNodeType, WorkflowRun, WorkflowRunStatus, WorkflowTool, WorkflowViewport };
@@ -22,10 +22,33 @@ type IfElseNodeConfig = {
22
22
  }>;
23
23
  logicalOperator: 'and' | 'or';
24
24
  };
25
+ type CodeOperation = 'passthrough' | 'return' | 'merge' | 'pick' | 'parse_json' | 'regex_extract' | 'xml_titles';
25
26
  type CodeNodeConfig = {
26
27
  type: 'code';
27
28
  language: 'javascript' | 'python' | 'typescript';
28
29
  code: string;
30
+ } | {
31
+ type: 'code';
32
+ operation: CodeOperation;
33
+ /** Dotted ref into the variable pool (`nodeId.path`) for ops that
34
+ * read a specific upstream value. Leave empty for `passthrough`
35
+ * which reads the sole incoming edge automatically. */
36
+ from?: string;
37
+ /** `return` — the literal JSON value to emit. */
38
+ value?: unknown;
39
+ /** `pick` — whitelist of keys to project off `incoming`. */
40
+ fields?: string[];
41
+ /** `regex_extract` — regex pattern and flags (`i m s x U R`;
42
+ * `g` is implicit). `group` defaults to 1 (first capture group). */
43
+ pattern?: string;
44
+ flags?: string;
45
+ group?: number;
46
+ /** `regex_extract` / `xml_titles` — key name to expose matches
47
+ * under in the node's output object (default: `matches` / `titles`). */
48
+ output?: string;
49
+ /** `xml_titles` — by default drops the channel/feed title; set
50
+ * `true` to keep it in the result array. */
51
+ keepChannel?: boolean;
29
52
  };
30
53
  type HttpRequestNodeConfig = {
31
54
  type: 'http_request';
@@ -140,23 +163,63 @@ type EntityNodeConfig = {
140
163
  outputVariable: string;
141
164
  limit: number;
142
165
  };
166
+ type DatasourceFilterOp = 'eq' | 'neq' | 'lt' | 'lte' | 'gt' | 'gte' | 'like' | 'in';
167
+ type DatasourceFilter = {
168
+ /** Column identifier — must match `[a-zA-Z0-9_]+` (validator enforces). */
169
+ column: string;
170
+ /** Comparison operator; defaults to `eq` when omitted. */
171
+ op?: DatasourceFilterOp;
172
+ /** Scalar (string / number / bool) or array (required when op = `in`).
173
+ * Strings may reference pool variables via `{{ nodeId.path }}` /
174
+ * `{{ inputs.field }}` — the engine renders them before binding. */
175
+ value?: string | number | boolean | Array<string | number | boolean> | null;
176
+ };
143
177
  type DatasourceNodeConfig = {
144
178
  type: 'datasource';
145
179
  datasourceId: string;
146
180
  dialect: string;
147
181
  table: string;
148
182
  selectedColumns: string[];
149
- filterVariables: Record<string, string>;
183
+ /** Preferred shape: full filter array with per-row operator. */
184
+ filters?: DatasourceFilter[];
185
+ /** Legacy: variable-name → column-name map (implicit `eq`). Kept so
186
+ * older graphs still load; new UI writes `filters` instead. */
187
+ filterVariables?: Record<string, string>;
150
188
  outputVariable: string;
151
189
  limit: number;
152
190
  };
153
191
  type RuleNodeConfig = {
154
192
  type: 'rule';
193
+ /** Slug / id of the rule row in `astrlabe.agent_rules`. Required for
194
+ * the rule executor to resolve a definition at run-time. */
195
+ ruleId?: string;
196
+ /** Execution priority when several rules feed into the same branch. */
197
+ priority?: number;
198
+ /** Master switch. Disabled rules are skipped at run-time. */
199
+ enabled?: boolean;
155
200
  entityId?: string;
156
201
  outputVariable?: string;
157
202
  priceVariable?: string;
158
203
  contextVariables?: Record<string, string>;
159
204
  };
205
+ type AgentNodeConfig = {
206
+ type: 'agent';
207
+ /** `astrlabe.agents.id` — identifies which agent config to run. */
208
+ agentId?: string;
209
+ /** Preferred path: references `astrlabe.model_provider_connections.id`. */
210
+ connectionId?: string;
211
+ /** Escape hatch: inline provider + model when no connection row exists. */
212
+ provider?: ModelProviderType;
213
+ model?: string;
214
+ /** Optional override of the agent's stored model id. */
215
+ modelId?: string;
216
+ /** System + user prompts rendered through the template engine
217
+ * (`{{ nodeId.path }}` / `{{ inputs.x }}`). */
218
+ systemPrompt?: string;
219
+ userPrompt?: string;
220
+ maxTokens?: number;
221
+ temperature?: number;
222
+ };
160
223
  type ModelProviderType = 'aws_bedrock' | 'openai_api' | 'google_vertex' | 'azure_openai' | 'anthropic_api' | 'groq' | 'mistral' | 'huggingface' | 'ollama' | 'custom';
161
224
  type ModelProviderNodeConfig = {
162
225
  type: 'model_provider';
@@ -184,7 +247,7 @@ type DashboardOutputNodeConfig = {
184
247
  /** Reference to an upstream node's value (`"nodeId"` or `"nodeId.path"`) that already conforms to DashboardSpec. */
185
248
  dashboardFrom?: string;
186
249
  };
187
- type LogicNodeConfig = StartNodeConfig | EndNodeConfig | IfElseNodeConfig | CodeNodeConfig | HttpRequestNodeConfig | TemplateTransformNodeConfig | IterationNodeConfig | KnowledgeBaseNodeConfig | AnswerNodeConfig | QuestionClassifierNodeConfig | ParameterExtractorNodeConfig | VariableAssignerNodeConfig | VariableAggregatorNodeConfig | DocumentExtractorNodeConfig | ListOperatorNodeConfig | IterationStartNodeConfig | NoteNodeConfig | GroupNodeConfig | EntityNodeConfig | DatasourceNodeConfig | RuleNodeConfig | ModelProviderNodeConfig | DashboardOutputNodeConfig;
250
+ type LogicNodeConfig = StartNodeConfig | EndNodeConfig | IfElseNodeConfig | CodeNodeConfig | HttpRequestNodeConfig | TemplateTransformNodeConfig | IterationNodeConfig | KnowledgeBaseNodeConfig | AnswerNodeConfig | QuestionClassifierNodeConfig | ParameterExtractorNodeConfig | VariableAssignerNodeConfig | VariableAggregatorNodeConfig | DocumentExtractorNodeConfig | ListOperatorNodeConfig | IterationStartNodeConfig | NoteNodeConfig | GroupNodeConfig | EntityNodeConfig | DatasourceNodeConfig | RuleNodeConfig | AgentNodeConfig | ModelProviderNodeConfig | DashboardOutputNodeConfig;
188
251
  type WorkflowNodeData = {
189
252
  entityId: string;
190
253
  label: string;
@@ -323,4 +386,4 @@ type AgentRule = {
323
386
  [key: string]: unknown;
324
387
  };
325
388
 
326
- export type { AgentConfig, AgentModel, AgentRule, AgentTool, AnswerNodeConfig, CodeNodeConfig, DashboardOutputNodeConfig, DatasourceNodeConfig, DocumentExtractorNodeConfig, EndNodeConfig, EntityNodeConfig, GroupNodeConfig, HttpRequestNodeConfig, IfElseNodeConfig, IterationNodeConfig, IterationStartNodeConfig, KnowledgeBaseNodeConfig, ListOperatorNodeConfig, LogicNodeConfig, ModelProviderNodeConfig, ModelProviderType, NodeExecutionResult, NoteNodeConfig, ParameterExtractorNodeConfig, QuestionClassifierNodeConfig, RuleNodeConfig, StartNodeConfig, TemplateTransformNodeConfig, VariableAggregatorNodeConfig, VariableAssignerNodeConfig, VariableValue, Workflow, WorkflowEdge, WorkflowGraph, WorkflowNode, WorkflowNodeData, WorkflowNodeStatus, WorkflowNodeType, WorkflowRun, WorkflowRunStatus, WorkflowTool, WorkflowViewport };
389
+ export type { AgentConfig, AgentModel, AgentNodeConfig, AgentRule, AgentTool, AnswerNodeConfig, CodeNodeConfig, CodeOperation, DashboardOutputNodeConfig, DatasourceFilter, DatasourceFilterOp, DatasourceNodeConfig, DocumentExtractorNodeConfig, EndNodeConfig, EntityNodeConfig, GroupNodeConfig, HttpRequestNodeConfig, IfElseNodeConfig, IterationNodeConfig, IterationStartNodeConfig, KnowledgeBaseNodeConfig, ListOperatorNodeConfig, LogicNodeConfig, ModelProviderNodeConfig, ModelProviderType, NodeExecutionResult, NoteNodeConfig, ParameterExtractorNodeConfig, QuestionClassifierNodeConfig, RuleNodeConfig, StartNodeConfig, TemplateTransformNodeConfig, VariableAggregatorNodeConfig, VariableAssignerNodeConfig, VariableValue, Workflow, WorkflowEdge, WorkflowGraph, WorkflowNode, WorkflowNodeData, WorkflowNodeStatus, WorkflowNodeType, WorkflowRun, WorkflowRunStatus, WorkflowTool, WorkflowViewport };