@datatechsolutions/ui 2.11.76 → 2.11.78

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.
@@ -333,15 +333,67 @@ type AgentConfig = {
333
333
  agentId: string;
334
334
  id?: string;
335
335
  name: string;
336
+ /** Human-friendly display name — name is the slug-ish id, displayName
337
+ * is what shows up in admin listings and agent pickers. */
338
+ displayName?: string;
339
+ description?: string;
336
340
  role?: string;
341
+ avatar?: string;
337
342
  modelId?: string;
338
343
  modelProviderId?: string;
344
+ /** Preferred — references `astrlabe.model_provider_connections.id`. */
345
+ connectionId?: string;
346
+ framework?: string;
347
+ instruction?: string;
348
+ /** System prompt; historically some seeds use `systemPrompt`, others
349
+ * `instruction`. UI reads `systemPrompt ?? instruction`. */
350
+ systemPrompt?: string;
339
351
  order?: number;
340
352
  temperature?: number;
341
353
  maxTokens?: number;
354
+ /** Canonical Bedrock-aligned field. Treated as a synonym of
355
+ * `maxTokens` — new UIs write this one. */
356
+ maxOutputTokens?: number;
357
+ topP?: number;
358
+ topK?: number;
359
+ /** ELO score driving the difficulty tier in the canvas. */
360
+ elo?: number;
361
+ difficulty?: 'beginner' | 'intermediate' | 'advanced' | 'expert' | string;
362
+ tags?: string[];
363
+ status?: 'draft' | 'active' | 'archived' | string;
364
+ metadata?: Record<string, unknown>;
365
+ version?: number;
342
366
  enabled?: boolean;
367
+ active?: boolean;
343
368
  [key: string]: unknown;
344
369
  };
370
+ /**
371
+ * Canonical persist payload the `AgentModal` emits via `onPersist`.
372
+ * The receiver translates this to the shape the backend handler
373
+ * (POST /agents/configs or PATCH /agents/configs/{id}) expects.
374
+ */
375
+ type AgentPersistPayload = {
376
+ agentId?: string;
377
+ name: string;
378
+ displayName?: string;
379
+ description?: string;
380
+ role?: string;
381
+ avatar?: string;
382
+ modelId?: string;
383
+ connectionId?: string;
384
+ framework?: string;
385
+ systemPrompt?: string;
386
+ temperature?: number;
387
+ maxOutputTokens?: number;
388
+ topP?: number;
389
+ topK?: number;
390
+ elo?: number;
391
+ difficulty?: string;
392
+ tags?: string[];
393
+ status?: string;
394
+ enabledToolIds?: string[];
395
+ metadata?: Record<string, unknown>;
396
+ };
345
397
  type AgentModel = {
346
398
  id: string;
347
399
  name: string;
@@ -379,11 +431,25 @@ type AgentRule = {
379
431
  name: string;
380
432
  description?: string;
381
433
  enabled: boolean;
434
+ /** Visual order in the admin list. Alias for `priority` kept for
435
+ * legacy clients — new code should read `priority`. */
382
436
  order?: number;
437
+ priority?: number;
438
+ /** Canonical singular — object with an `operator` key that the Rust
439
+ * `RuleExecutor` dispatches on. */
383
440
  condition?: Record<string, unknown>;
441
+ /** Canonical singular — object with `type` + `params`. */
442
+ action?: Record<string, unknown>;
443
+ /** Legacy: older servers returned an array of action entries. Keep
444
+ * for backwards compat so the UI can still render historical
445
+ * payloads. */
384
446
  conditions?: Array<Record<string, unknown>>;
385
447
  actions?: Array<Record<string, unknown>>;
448
+ status?: 'draft' | 'active' | 'archived' | string;
449
+ tags?: string[];
450
+ validFrom?: string | null;
451
+ validUntil?: string | null;
386
452
  [key: string]: unknown;
387
453
  };
388
454
 
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 };
455
+ export type { AgentConfig, AgentModel, AgentNodeConfig, AgentPersistPayload, 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 };
@@ -333,15 +333,67 @@ type AgentConfig = {
333
333
  agentId: string;
334
334
  id?: string;
335
335
  name: string;
336
+ /** Human-friendly display name — name is the slug-ish id, displayName
337
+ * is what shows up in admin listings and agent pickers. */
338
+ displayName?: string;
339
+ description?: string;
336
340
  role?: string;
341
+ avatar?: string;
337
342
  modelId?: string;
338
343
  modelProviderId?: string;
344
+ /** Preferred — references `astrlabe.model_provider_connections.id`. */
345
+ connectionId?: string;
346
+ framework?: string;
347
+ instruction?: string;
348
+ /** System prompt; historically some seeds use `systemPrompt`, others
349
+ * `instruction`. UI reads `systemPrompt ?? instruction`. */
350
+ systemPrompt?: string;
339
351
  order?: number;
340
352
  temperature?: number;
341
353
  maxTokens?: number;
354
+ /** Canonical Bedrock-aligned field. Treated as a synonym of
355
+ * `maxTokens` — new UIs write this one. */
356
+ maxOutputTokens?: number;
357
+ topP?: number;
358
+ topK?: number;
359
+ /** ELO score driving the difficulty tier in the canvas. */
360
+ elo?: number;
361
+ difficulty?: 'beginner' | 'intermediate' | 'advanced' | 'expert' | string;
362
+ tags?: string[];
363
+ status?: 'draft' | 'active' | 'archived' | string;
364
+ metadata?: Record<string, unknown>;
365
+ version?: number;
342
366
  enabled?: boolean;
367
+ active?: boolean;
343
368
  [key: string]: unknown;
344
369
  };
370
+ /**
371
+ * Canonical persist payload the `AgentModal` emits via `onPersist`.
372
+ * The receiver translates this to the shape the backend handler
373
+ * (POST /agents/configs or PATCH /agents/configs/{id}) expects.
374
+ */
375
+ type AgentPersistPayload = {
376
+ agentId?: string;
377
+ name: string;
378
+ displayName?: string;
379
+ description?: string;
380
+ role?: string;
381
+ avatar?: string;
382
+ modelId?: string;
383
+ connectionId?: string;
384
+ framework?: string;
385
+ systemPrompt?: string;
386
+ temperature?: number;
387
+ maxOutputTokens?: number;
388
+ topP?: number;
389
+ topK?: number;
390
+ elo?: number;
391
+ difficulty?: string;
392
+ tags?: string[];
393
+ status?: string;
394
+ enabledToolIds?: string[];
395
+ metadata?: Record<string, unknown>;
396
+ };
345
397
  type AgentModel = {
346
398
  id: string;
347
399
  name: string;
@@ -379,11 +431,25 @@ type AgentRule = {
379
431
  name: string;
380
432
  description?: string;
381
433
  enabled: boolean;
434
+ /** Visual order in the admin list. Alias for `priority` kept for
435
+ * legacy clients — new code should read `priority`. */
382
436
  order?: number;
437
+ priority?: number;
438
+ /** Canonical singular — object with an `operator` key that the Rust
439
+ * `RuleExecutor` dispatches on. */
383
440
  condition?: Record<string, unknown>;
441
+ /** Canonical singular — object with `type` + `params`. */
442
+ action?: Record<string, unknown>;
443
+ /** Legacy: older servers returned an array of action entries. Keep
444
+ * for backwards compat so the UI can still render historical
445
+ * payloads. */
384
446
  conditions?: Array<Record<string, unknown>>;
385
447
  actions?: Array<Record<string, unknown>>;
448
+ status?: 'draft' | 'active' | 'archived' | string;
449
+ tags?: string[];
450
+ validFrom?: string | null;
451
+ validUntil?: string | null;
386
452
  [key: string]: unknown;
387
453
  };
388
454
 
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 };
455
+ export type { AgentConfig, AgentModel, AgentNodeConfig, AgentPersistPayload, 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 };
@@ -1,7 +1,7 @@
1
1
  import { A as AgentWithPrompts, a as AgentNodeData, T as ToolCanvasData, R as RuleNodeData, E as EntityNodeData, M as ModelProviderNodeData, S as StartNodeData, b as EndNodeData, I as IfElseNodeData, C as CodeNodeData, H as HttpRequestNodeData, c as TemplateTransformNodeData, d as IterationNodeData, K as KnowledgeBaseNodeData, e as AnswerNodeData, Q as QuestionClassifierNodeData, P as ParameterExtractorNodeData, V as VariableAssignerNodeData, f as VariableAggregatorNodeData, D as DocumentExtractorNodeData, L as ListOperatorNodeData, g as IterationStartNodeData, N as NoteNodeData, G as GroupNodeData, W as WorkflowEntityDefinition, h as WorkspaceProps } from '../workflow-canvas-D4928AfA.mjs';
2
2
  export { i as AgentNodeTool, j as Workspace } from '../workflow-canvas-D4928AfA.mjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import { Workflow, WorkflowGraph, AgentModel, WorkflowTool, AgentRule, LogicNodeConfig, AgentTool, WorkflowRun } from './contracts.mjs';
4
+ import { Workflow, WorkflowGraph, AgentModel, WorkflowTool, AgentRule, AgentPersistPayload, LogicNodeConfig, AgentTool, WorkflowRun } from './contracts.mjs';
5
5
  export { ModelProviderNodeConfig, ModelProviderType } from './contracts.mjs';
6
6
  import * as React$1 from 'react';
7
7
  import { ReactNode, ComponentProps } from 'react';
@@ -207,8 +207,16 @@ declare const GroupFlowNode: React$1.NamedExoticComponent<{
207
207
 
208
208
  type AgentModalProps = {
209
209
  onSaved?: () => void;
210
+ /**
211
+ * Called when the user clicks Save in the sidebar footer. The modal
212
+ * collects its local editable state (profile + framework + prompt +
213
+ * advanced + tools + connection) into a canonical payload so the
214
+ * parent can decide how to persist (POST for create, PATCH for edit).
215
+ * Returning a rejected promise re-opens the unsaved-changes banner.
216
+ */
217
+ onPersist?: (payload: AgentPersistPayload) => Promise<void>;
210
218
  };
211
- declare function AgentModal({ onSaved }: AgentModalProps): react_jsx_runtime.JSX.Element | null;
219
+ declare function AgentModal({ onSaved, onPersist }: AgentModalProps): react_jsx_runtime.JSX.Element | null;
212
220
 
213
221
  type SubworkflowModalProps = {
214
222
  /** Called when save/create is clicked — receives the merged workflow tool with updated graph */
@@ -241,6 +249,106 @@ type PipelineSettingsModalProps = {
241
249
  };
242
250
  declare function PipelineSettingsModal({ onSave }: PipelineSettingsModalProps): react_jsx_runtime.JSX.Element;
243
251
 
252
+ /**
253
+ * Rule editing types.
254
+ *
255
+ * Mirrors the shape the Rust `RuleExecutor`
256
+ * (`lambda-rs/crates/astrlabe-handlers/src/engine/executors/rule.rs`) reads
257
+ * from `astrlabe.agent_rules.condition` + `action`. The UI builder below
258
+ * writes exactly this shape, so round-tripping through the backend is a
259
+ * no-op.
260
+ */
261
+ type SimpleComparisonOperator = 'truthy' | 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains';
262
+ type RuleConditionOperator = SimpleComparisonOperator | 'regex_match' | 'threshold' | 'time_window' | 'boolean_expression';
263
+ type TimeWindow = {
264
+ startHour: number;
265
+ endHour: number;
266
+ startMinute?: number;
267
+ endMinute?: number;
268
+ /** 0 = Sunday, 6 = Saturday. Omit to match every day. */
269
+ daysOfWeek?: number[];
270
+ };
271
+ /**
272
+ * Canonical rule-condition shape. The executor branches on `operator`,
273
+ * so every form tree ultimately serializes to this.
274
+ */
275
+ type RuleCondition = {
276
+ operator: RuleConditionOperator;
277
+ /** Simple operators + regex_match + threshold + time_window */
278
+ field?: string;
279
+ /** Simple operators + threshold */
280
+ value?: string | number | boolean | null;
281
+ /** regex_match */
282
+ pattern?: string;
283
+ /** threshold — which direction `value` is compared in. */
284
+ comparison?: 'gt' | 'gte' | 'lt' | 'lte';
285
+ /** time_window */
286
+ timezone?: string;
287
+ windows?: TimeWindow[];
288
+ /** boolean_expression */
289
+ combinator?: 'and' | 'or';
290
+ operands?: RuleCondition[];
291
+ };
292
+ type RuleAction = {
293
+ type: string;
294
+ params?: Record<string, unknown>;
295
+ };
296
+ /** `agent_rules.status` free-form string — keep the UI picker aligned
297
+ * with the values the engine / audit trail recognizes today. */
298
+ declare const RULE_STATUS_OPTIONS: readonly ["draft", "active", "archived"];
299
+ type RuleStatus = (typeof RULE_STATUS_OPTIONS)[number];
300
+ declare const TIMEZONE_OPTIONS: readonly ["UTC", "America/Sao_Paulo", "America/New_York", "America/Los_Angeles", "Europe/London", "Europe/Lisbon"];
301
+
302
+ type Props$2 = {
303
+ value: RuleCondition;
304
+ onChange: (next: RuleCondition) => void;
305
+ /** Recursion depth. Boolean_expression is capped at one level to keep
306
+ * the UI legible — deeper trees remain round-trippable via the raw
307
+ * JSON fallback but the visual builder won't surface sub-boolean
308
+ * operands. */
309
+ depth?: number;
310
+ };
311
+ declare function RuleConditionBuilder({ value, onChange, depth }: Props$2): react_jsx_runtime.JSX.Element;
312
+ declare function defaultRuleCondition(): RuleCondition;
313
+
314
+ type Props$1 = {
315
+ value: RuleAction;
316
+ onChange: (next: RuleAction) => void;
317
+ };
318
+ /**
319
+ * Action builder — emits a single `{ type, params }` object matching the
320
+ * executor contract. The `custom` type drops to a raw key/value editor for
321
+ * actions the UI doesn't have a dedicated template for.
322
+ */
323
+ declare function RuleActionBuilder({ value, onChange }: Props$1): react_jsx_runtime.JSX.Element;
324
+ declare function defaultRuleAction(): RuleAction;
325
+
326
+ type RuleFormValue = {
327
+ ruleId?: string;
328
+ name: string;
329
+ description?: string;
330
+ enabled: boolean;
331
+ priority: number;
332
+ status?: RuleStatus;
333
+ validFrom?: string | null;
334
+ validUntil?: string | null;
335
+ tags?: string[];
336
+ condition: RuleCondition;
337
+ action: RuleAction;
338
+ };
339
+ type Props = {
340
+ value: RuleFormValue;
341
+ onChange: (next: RuleFormValue) => void;
342
+ };
343
+ /**
344
+ * Full-field rule editor used inside the create/edit modal. Composes the
345
+ * visual condition + action builders and exposes the schedule / tagging /
346
+ * lifecycle fields that the `agent_rules` entity has but the old JSON-
347
+ * textarea form never surfaced.
348
+ */
349
+ declare function RuleForm({ value, onChange }: Props): react_jsx_runtime.JSX.Element;
350
+ declare function defaultRuleForm(): RuleFormValue;
351
+
244
352
  type ModelProvider = {
245
353
  id: string;
246
354
  name: string;
@@ -730,4 +838,4 @@ declare function getEntityBadgeColor(entityKey: string | undefined): string;
730
838
  declare function getEntityHandleColor(entityKey: string | undefined): string;
731
839
  declare function getEntityMinimapColor(entityKey: string | undefined): string;
732
840
 
733
- export { AgentFlowNode, type AgentFramework, AgentModal, AgentNodeData, AgentToolFlowNode, AgentWithPrompts, AmazonNovaIcon, AnswerFlowNode, AnswerNodeData, AnthropicIcon, AnthropicModelIcon, AutoSaveWorkspace, type AutoSaveWorkspaceProps, CodeFlowNode, CodeNodeData, CrewAIIcon, DocumentExtractorFlowNode, DocumentExtractorNodeData, DslExportModal, DslImportModal, DynamicIslandConfirm, type DynamicIslandConfirmProps, EndFlowNode, EndNodeData, EntityFlowNode, EntityNodeData, FRAMEWORK_META, GoogleADKIcon, GroupFlowNode, GroupNodeData, HttpRequestFlowNode, HttpRequestNodeData, IfElseFlowNode, IfElseNodeData, IterationFlowNode, IterationNodeData, IterationStartFlowNode, IterationStartNodeData, KnowledgeBaseFlowNode, KnowledgeBaseNodeData, LOGIC_ICON_MAP, LOGIC_NODE_BADGE_COLORS, LOGIC_NODE_GRADIENTS, LOGIC_NODE_HANDLE_COLORS, LangChainIcon, LayoutDirection, ListOperatorFlowNode, ListOperatorNodeData, LogicNodeModal, MINIMAP_NODE_COLORS, MetaLlamaIcon, type ModelProvider, ModelProviderFlowNode, ModelProviderNodeData, NODE_EXECUTION_ACCENT_COLORS, NodeCard, NodeContextMenu, NodePalette, type NodeRunResult, NoteFlowNode, NoteNodeData, OpenAIIcon, PanelContextMenu, ParameterExtractorFlowNode, ParameterExtractorNodeData, PipelineSettingsModal, PreviewPanel, type PreviewPanelProps, QuestionClassifierFlowNode, QuestionClassifierNodeData, RuleFlowNode, RuleNodeData, RunInputDialog, type RunInputDialogProps, RunPanel, SaveStatusBadge, type SaveStatusBadgeProps, SelectionContextMenu, StartFlowNode, StartNodeData, StrandsIcon, SubworkflowModal, TemplateTransformFlowNode, TemplateTransformNodeData, ToolCanvasData, ToolFlowNode, VariableAggregatorFlowNode, VariableAggregatorNodeData, VariableAssignerFlowNode, VariableAssignerNodeData, VariableInspector, VersionHistoryPanel, type WorkflowBuilderClient, WorkflowBuilderProvider, type WorkflowBuilderProviderProps, WorkflowEntityDefinition, WorkflowGraph, WorkflowListBar, type WorkflowStore, type WorkspaceBootstrapPayload, WorkspaceProps, getCompatibleModels, getDefaultFrameworkForModel, getEntityBadgeColor, getEntityGradient, getEntityHandleColor, getEntityIcon, getEntityMinimapColor, getFrameworkMeta, getModelIcon, getNodeExecutionAccent, getNodeExecutionAccentRgb, isModelCompatibleWithFramework, useCanRedo, useCanUndo, useCanvasShortcuts, useClipboard, useContextMenu, useEditingNodeId, useHasCopied, useHelpLines, useIsRunning, useModalStore, useNodeResults, useSelectedNodeCount, useSubworkflowStore, useUndoRedo, useWorkflowBuilderClient, useWorkflowBuilderClientOptional, useWorkflowStore };
841
+ export { AgentFlowNode, type AgentFramework, AgentModal, AgentNodeData, AgentToolFlowNode, AgentWithPrompts, AmazonNovaIcon, AnswerFlowNode, AnswerNodeData, AnthropicIcon, AnthropicModelIcon, AutoSaveWorkspace, type AutoSaveWorkspaceProps, CodeFlowNode, CodeNodeData, CrewAIIcon, DocumentExtractorFlowNode, DocumentExtractorNodeData, DslExportModal, DslImportModal, DynamicIslandConfirm, type DynamicIslandConfirmProps, EndFlowNode, EndNodeData, EntityFlowNode, EntityNodeData, FRAMEWORK_META, GoogleADKIcon, GroupFlowNode, GroupNodeData, HttpRequestFlowNode, HttpRequestNodeData, IfElseFlowNode, IfElseNodeData, IterationFlowNode, IterationNodeData, IterationStartFlowNode, IterationStartNodeData, KnowledgeBaseFlowNode, KnowledgeBaseNodeData, LOGIC_ICON_MAP, LOGIC_NODE_BADGE_COLORS, LOGIC_NODE_GRADIENTS, LOGIC_NODE_HANDLE_COLORS, LangChainIcon, LayoutDirection, ListOperatorFlowNode, ListOperatorNodeData, LogicNodeModal, MINIMAP_NODE_COLORS, MetaLlamaIcon, type ModelProvider, ModelProviderFlowNode, ModelProviderNodeData, NODE_EXECUTION_ACCENT_COLORS, NodeCard, NodeContextMenu, NodePalette, type NodeRunResult, NoteFlowNode, NoteNodeData, OpenAIIcon, PanelContextMenu, ParameterExtractorFlowNode, ParameterExtractorNodeData, PipelineSettingsModal, PreviewPanel, type PreviewPanelProps, QuestionClassifierFlowNode, QuestionClassifierNodeData, RULE_STATUS_OPTIONS, type RuleAction, RuleActionBuilder, type RuleCondition, RuleConditionBuilder, type RuleConditionOperator, RuleFlowNode, RuleForm, type RuleFormValue, RuleNodeData, type RuleStatus, RunInputDialog, type RunInputDialogProps, RunPanel, SaveStatusBadge, type SaveStatusBadgeProps, SelectionContextMenu, StartFlowNode, StartNodeData, StrandsIcon, SubworkflowModal, TIMEZONE_OPTIONS, TemplateTransformFlowNode, TemplateTransformNodeData, type TimeWindow, ToolCanvasData, ToolFlowNode, VariableAggregatorFlowNode, VariableAggregatorNodeData, VariableAssignerFlowNode, VariableAssignerNodeData, VariableInspector, VersionHistoryPanel, type WorkflowBuilderClient, WorkflowBuilderProvider, type WorkflowBuilderProviderProps, WorkflowEntityDefinition, WorkflowGraph, WorkflowListBar, type WorkflowStore, type WorkspaceBootstrapPayload, WorkspaceProps, defaultRuleAction, defaultRuleCondition, defaultRuleForm, getCompatibleModels, getDefaultFrameworkForModel, getEntityBadgeColor, getEntityGradient, getEntityHandleColor, getEntityIcon, getEntityMinimapColor, getFrameworkMeta, getModelIcon, getNodeExecutionAccent, getNodeExecutionAccentRgb, isModelCompatibleWithFramework, useCanRedo, useCanUndo, useCanvasShortcuts, useClipboard, useContextMenu, useEditingNodeId, useHasCopied, useHelpLines, useIsRunning, useModalStore, useNodeResults, useSelectedNodeCount, useSubworkflowStore, useUndoRedo, useWorkflowBuilderClient, useWorkflowBuilderClientOptional, useWorkflowStore };
@@ -1,7 +1,7 @@
1
1
  import { A as AgentWithPrompts, a as AgentNodeData, T as ToolCanvasData, R as RuleNodeData, E as EntityNodeData, M as ModelProviderNodeData, S as StartNodeData, b as EndNodeData, I as IfElseNodeData, C as CodeNodeData, H as HttpRequestNodeData, c as TemplateTransformNodeData, d as IterationNodeData, K as KnowledgeBaseNodeData, e as AnswerNodeData, Q as QuestionClassifierNodeData, P as ParameterExtractorNodeData, V as VariableAssignerNodeData, f as VariableAggregatorNodeData, D as DocumentExtractorNodeData, L as ListOperatorNodeData, g as IterationStartNodeData, N as NoteNodeData, G as GroupNodeData, W as WorkflowEntityDefinition, h as WorkspaceProps } from '../workflow-canvas-NSxfr5dy.js';
2
2
  export { i as AgentNodeTool, j as Workspace } from '../workflow-canvas-NSxfr5dy.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import { Workflow, WorkflowGraph, AgentModel, WorkflowTool, AgentRule, LogicNodeConfig, AgentTool, WorkflowRun } from './contracts.js';
4
+ import { Workflow, WorkflowGraph, AgentModel, WorkflowTool, AgentRule, AgentPersistPayload, LogicNodeConfig, AgentTool, WorkflowRun } from './contracts.js';
5
5
  export { ModelProviderNodeConfig, ModelProviderType } from './contracts.js';
6
6
  import * as React$1 from 'react';
7
7
  import { ReactNode, ComponentProps } from 'react';
@@ -207,8 +207,16 @@ declare const GroupFlowNode: React$1.NamedExoticComponent<{
207
207
 
208
208
  type AgentModalProps = {
209
209
  onSaved?: () => void;
210
+ /**
211
+ * Called when the user clicks Save in the sidebar footer. The modal
212
+ * collects its local editable state (profile + framework + prompt +
213
+ * advanced + tools + connection) into a canonical payload so the
214
+ * parent can decide how to persist (POST for create, PATCH for edit).
215
+ * Returning a rejected promise re-opens the unsaved-changes banner.
216
+ */
217
+ onPersist?: (payload: AgentPersistPayload) => Promise<void>;
210
218
  };
211
- declare function AgentModal({ onSaved }: AgentModalProps): react_jsx_runtime.JSX.Element | null;
219
+ declare function AgentModal({ onSaved, onPersist }: AgentModalProps): react_jsx_runtime.JSX.Element | null;
212
220
 
213
221
  type SubworkflowModalProps = {
214
222
  /** Called when save/create is clicked — receives the merged workflow tool with updated graph */
@@ -241,6 +249,106 @@ type PipelineSettingsModalProps = {
241
249
  };
242
250
  declare function PipelineSettingsModal({ onSave }: PipelineSettingsModalProps): react_jsx_runtime.JSX.Element;
243
251
 
252
+ /**
253
+ * Rule editing types.
254
+ *
255
+ * Mirrors the shape the Rust `RuleExecutor`
256
+ * (`lambda-rs/crates/astrlabe-handlers/src/engine/executors/rule.rs`) reads
257
+ * from `astrlabe.agent_rules.condition` + `action`. The UI builder below
258
+ * writes exactly this shape, so round-tripping through the backend is a
259
+ * no-op.
260
+ */
261
+ type SimpleComparisonOperator = 'truthy' | 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains';
262
+ type RuleConditionOperator = SimpleComparisonOperator | 'regex_match' | 'threshold' | 'time_window' | 'boolean_expression';
263
+ type TimeWindow = {
264
+ startHour: number;
265
+ endHour: number;
266
+ startMinute?: number;
267
+ endMinute?: number;
268
+ /** 0 = Sunday, 6 = Saturday. Omit to match every day. */
269
+ daysOfWeek?: number[];
270
+ };
271
+ /**
272
+ * Canonical rule-condition shape. The executor branches on `operator`,
273
+ * so every form tree ultimately serializes to this.
274
+ */
275
+ type RuleCondition = {
276
+ operator: RuleConditionOperator;
277
+ /** Simple operators + regex_match + threshold + time_window */
278
+ field?: string;
279
+ /** Simple operators + threshold */
280
+ value?: string | number | boolean | null;
281
+ /** regex_match */
282
+ pattern?: string;
283
+ /** threshold — which direction `value` is compared in. */
284
+ comparison?: 'gt' | 'gte' | 'lt' | 'lte';
285
+ /** time_window */
286
+ timezone?: string;
287
+ windows?: TimeWindow[];
288
+ /** boolean_expression */
289
+ combinator?: 'and' | 'or';
290
+ operands?: RuleCondition[];
291
+ };
292
+ type RuleAction = {
293
+ type: string;
294
+ params?: Record<string, unknown>;
295
+ };
296
+ /** `agent_rules.status` free-form string — keep the UI picker aligned
297
+ * with the values the engine / audit trail recognizes today. */
298
+ declare const RULE_STATUS_OPTIONS: readonly ["draft", "active", "archived"];
299
+ type RuleStatus = (typeof RULE_STATUS_OPTIONS)[number];
300
+ declare const TIMEZONE_OPTIONS: readonly ["UTC", "America/Sao_Paulo", "America/New_York", "America/Los_Angeles", "Europe/London", "Europe/Lisbon"];
301
+
302
+ type Props$2 = {
303
+ value: RuleCondition;
304
+ onChange: (next: RuleCondition) => void;
305
+ /** Recursion depth. Boolean_expression is capped at one level to keep
306
+ * the UI legible — deeper trees remain round-trippable via the raw
307
+ * JSON fallback but the visual builder won't surface sub-boolean
308
+ * operands. */
309
+ depth?: number;
310
+ };
311
+ declare function RuleConditionBuilder({ value, onChange, depth }: Props$2): react_jsx_runtime.JSX.Element;
312
+ declare function defaultRuleCondition(): RuleCondition;
313
+
314
+ type Props$1 = {
315
+ value: RuleAction;
316
+ onChange: (next: RuleAction) => void;
317
+ };
318
+ /**
319
+ * Action builder — emits a single `{ type, params }` object matching the
320
+ * executor contract. The `custom` type drops to a raw key/value editor for
321
+ * actions the UI doesn't have a dedicated template for.
322
+ */
323
+ declare function RuleActionBuilder({ value, onChange }: Props$1): react_jsx_runtime.JSX.Element;
324
+ declare function defaultRuleAction(): RuleAction;
325
+
326
+ type RuleFormValue = {
327
+ ruleId?: string;
328
+ name: string;
329
+ description?: string;
330
+ enabled: boolean;
331
+ priority: number;
332
+ status?: RuleStatus;
333
+ validFrom?: string | null;
334
+ validUntil?: string | null;
335
+ tags?: string[];
336
+ condition: RuleCondition;
337
+ action: RuleAction;
338
+ };
339
+ type Props = {
340
+ value: RuleFormValue;
341
+ onChange: (next: RuleFormValue) => void;
342
+ };
343
+ /**
344
+ * Full-field rule editor used inside the create/edit modal. Composes the
345
+ * visual condition + action builders and exposes the schedule / tagging /
346
+ * lifecycle fields that the `agent_rules` entity has but the old JSON-
347
+ * textarea form never surfaced.
348
+ */
349
+ declare function RuleForm({ value, onChange }: Props): react_jsx_runtime.JSX.Element;
350
+ declare function defaultRuleForm(): RuleFormValue;
351
+
244
352
  type ModelProvider = {
245
353
  id: string;
246
354
  name: string;
@@ -730,4 +838,4 @@ declare function getEntityBadgeColor(entityKey: string | undefined): string;
730
838
  declare function getEntityHandleColor(entityKey: string | undefined): string;
731
839
  declare function getEntityMinimapColor(entityKey: string | undefined): string;
732
840
 
733
- export { AgentFlowNode, type AgentFramework, AgentModal, AgentNodeData, AgentToolFlowNode, AgentWithPrompts, AmazonNovaIcon, AnswerFlowNode, AnswerNodeData, AnthropicIcon, AnthropicModelIcon, AutoSaveWorkspace, type AutoSaveWorkspaceProps, CodeFlowNode, CodeNodeData, CrewAIIcon, DocumentExtractorFlowNode, DocumentExtractorNodeData, DslExportModal, DslImportModal, DynamicIslandConfirm, type DynamicIslandConfirmProps, EndFlowNode, EndNodeData, EntityFlowNode, EntityNodeData, FRAMEWORK_META, GoogleADKIcon, GroupFlowNode, GroupNodeData, HttpRequestFlowNode, HttpRequestNodeData, IfElseFlowNode, IfElseNodeData, IterationFlowNode, IterationNodeData, IterationStartFlowNode, IterationStartNodeData, KnowledgeBaseFlowNode, KnowledgeBaseNodeData, LOGIC_ICON_MAP, LOGIC_NODE_BADGE_COLORS, LOGIC_NODE_GRADIENTS, LOGIC_NODE_HANDLE_COLORS, LangChainIcon, LayoutDirection, ListOperatorFlowNode, ListOperatorNodeData, LogicNodeModal, MINIMAP_NODE_COLORS, MetaLlamaIcon, type ModelProvider, ModelProviderFlowNode, ModelProviderNodeData, NODE_EXECUTION_ACCENT_COLORS, NodeCard, NodeContextMenu, NodePalette, type NodeRunResult, NoteFlowNode, NoteNodeData, OpenAIIcon, PanelContextMenu, ParameterExtractorFlowNode, ParameterExtractorNodeData, PipelineSettingsModal, PreviewPanel, type PreviewPanelProps, QuestionClassifierFlowNode, QuestionClassifierNodeData, RuleFlowNode, RuleNodeData, RunInputDialog, type RunInputDialogProps, RunPanel, SaveStatusBadge, type SaveStatusBadgeProps, SelectionContextMenu, StartFlowNode, StartNodeData, StrandsIcon, SubworkflowModal, TemplateTransformFlowNode, TemplateTransformNodeData, ToolCanvasData, ToolFlowNode, VariableAggregatorFlowNode, VariableAggregatorNodeData, VariableAssignerFlowNode, VariableAssignerNodeData, VariableInspector, VersionHistoryPanel, type WorkflowBuilderClient, WorkflowBuilderProvider, type WorkflowBuilderProviderProps, WorkflowEntityDefinition, WorkflowGraph, WorkflowListBar, type WorkflowStore, type WorkspaceBootstrapPayload, WorkspaceProps, getCompatibleModels, getDefaultFrameworkForModel, getEntityBadgeColor, getEntityGradient, getEntityHandleColor, getEntityIcon, getEntityMinimapColor, getFrameworkMeta, getModelIcon, getNodeExecutionAccent, getNodeExecutionAccentRgb, isModelCompatibleWithFramework, useCanRedo, useCanUndo, useCanvasShortcuts, useClipboard, useContextMenu, useEditingNodeId, useHasCopied, useHelpLines, useIsRunning, useModalStore, useNodeResults, useSelectedNodeCount, useSubworkflowStore, useUndoRedo, useWorkflowBuilderClient, useWorkflowBuilderClientOptional, useWorkflowStore };
841
+ export { AgentFlowNode, type AgentFramework, AgentModal, AgentNodeData, AgentToolFlowNode, AgentWithPrompts, AmazonNovaIcon, AnswerFlowNode, AnswerNodeData, AnthropicIcon, AnthropicModelIcon, AutoSaveWorkspace, type AutoSaveWorkspaceProps, CodeFlowNode, CodeNodeData, CrewAIIcon, DocumentExtractorFlowNode, DocumentExtractorNodeData, DslExportModal, DslImportModal, DynamicIslandConfirm, type DynamicIslandConfirmProps, EndFlowNode, EndNodeData, EntityFlowNode, EntityNodeData, FRAMEWORK_META, GoogleADKIcon, GroupFlowNode, GroupNodeData, HttpRequestFlowNode, HttpRequestNodeData, IfElseFlowNode, IfElseNodeData, IterationFlowNode, IterationNodeData, IterationStartFlowNode, IterationStartNodeData, KnowledgeBaseFlowNode, KnowledgeBaseNodeData, LOGIC_ICON_MAP, LOGIC_NODE_BADGE_COLORS, LOGIC_NODE_GRADIENTS, LOGIC_NODE_HANDLE_COLORS, LangChainIcon, LayoutDirection, ListOperatorFlowNode, ListOperatorNodeData, LogicNodeModal, MINIMAP_NODE_COLORS, MetaLlamaIcon, type ModelProvider, ModelProviderFlowNode, ModelProviderNodeData, NODE_EXECUTION_ACCENT_COLORS, NodeCard, NodeContextMenu, NodePalette, type NodeRunResult, NoteFlowNode, NoteNodeData, OpenAIIcon, PanelContextMenu, ParameterExtractorFlowNode, ParameterExtractorNodeData, PipelineSettingsModal, PreviewPanel, type PreviewPanelProps, QuestionClassifierFlowNode, QuestionClassifierNodeData, RULE_STATUS_OPTIONS, type RuleAction, RuleActionBuilder, type RuleCondition, RuleConditionBuilder, type RuleConditionOperator, RuleFlowNode, RuleForm, type RuleFormValue, RuleNodeData, type RuleStatus, RunInputDialog, type RunInputDialogProps, RunPanel, SaveStatusBadge, type SaveStatusBadgeProps, SelectionContextMenu, StartFlowNode, StartNodeData, StrandsIcon, SubworkflowModal, TIMEZONE_OPTIONS, TemplateTransformFlowNode, TemplateTransformNodeData, type TimeWindow, ToolCanvasData, ToolFlowNode, VariableAggregatorFlowNode, VariableAggregatorNodeData, VariableAssignerFlowNode, VariableAssignerNodeData, VariableInspector, VersionHistoryPanel, type WorkflowBuilderClient, WorkflowBuilderProvider, type WorkflowBuilderProviderProps, WorkflowEntityDefinition, WorkflowGraph, WorkflowListBar, type WorkflowStore, type WorkspaceBootstrapPayload, WorkspaceProps, defaultRuleAction, defaultRuleCondition, defaultRuleForm, getCompatibleModels, getDefaultFrameworkForModel, getEntityBadgeColor, getEntityGradient, getEntityHandleColor, getEntityIcon, getEntityMinimapColor, getFrameworkMeta, getModelIcon, getNodeExecutionAccent, getNodeExecutionAccentRgb, isModelCompatibleWithFramework, useCanRedo, useCanUndo, useCanvasShortcuts, useClipboard, useContextMenu, useEditingNodeId, useHasCopied, useHelpLines, useIsRunning, useModalStore, useNodeResults, useSelectedNodeCount, useSubworkflowStore, useUndoRedo, useWorkflowBuilderClient, useWorkflowBuilderClientOptional, useWorkflowStore };