@stigmer/react 0.5.1 → 1.0.0
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/activity/group-activity.d.ts +13 -0
- package/activity/group-activity.d.ts.map +1 -0
- package/activity/group-activity.js +54 -0
- package/activity/group-activity.js.map +1 -0
- package/activity/index.d.ts +4 -0
- package/activity/index.d.ts.map +1 -0
- package/activity/index.js +3 -0
- package/activity/index.js.map +1 -0
- package/activity/types.d.ts +34 -0
- package/activity/types.d.ts.map +1 -0
- package/activity/types.js +2 -0
- package/activity/types.js.map +1 -0
- package/activity/useRecentActivity.d.ts +35 -0
- package/activity/useRecentActivity.d.ts.map +1 -0
- package/activity/useRecentActivity.js +73 -0
- package/activity/useRecentActivity.js.map +1 -0
- package/agent/AgentPicker.d.ts.map +1 -1
- package/agent/AgentPicker.js +4 -2
- package/agent/AgentPicker.js.map +1 -1
- package/billing/BillingSection.d.ts.map +1 -1
- package/billing/BillingSection.js +1 -1
- package/billing/BillingSection.js.map +1 -1
- package/composer/ComposerToolbar.d.ts +5 -1
- package/composer/ComposerToolbar.d.ts.map +1 -1
- package/composer/ComposerToolbar.js +4 -3
- package/composer/ComposerToolbar.js.map +1 -1
- package/composer/InteractionModePicker.d.ts +40 -0
- package/composer/InteractionModePicker.d.ts.map +1 -0
- package/composer/InteractionModePicker.js +76 -0
- package/composer/InteractionModePicker.js.map +1 -0
- package/composer/SessionComposer.d.ts +53 -64
- package/composer/SessionComposer.d.ts.map +1 -1
- package/composer/SessionComposer.js +20 -8
- package/composer/SessionComposer.js.map +1 -1
- package/composer/__tests__/SessionComposer-memo.test.js +10 -5
- package/composer/__tests__/SessionComposer-memo.test.js.map +1 -1
- package/composer/index.d.ts +3 -1
- package/composer/index.d.ts.map +1 -1
- package/composer/index.js +1 -0
- package/composer/index.js.map +1 -1
- package/dashboard/DashboardFailedRuns.d.ts +19 -0
- package/dashboard/DashboardFailedRuns.d.ts.map +1 -0
- package/dashboard/DashboardFailedRuns.js +35 -0
- package/dashboard/DashboardFailedRuns.js.map +1 -0
- package/dashboard/DashboardKPICards.d.ts +19 -0
- package/dashboard/DashboardKPICards.d.ts.map +1 -0
- package/dashboard/DashboardKPICards.js +80 -0
- package/dashboard/DashboardKPICards.js.map +1 -0
- package/dashboard/OperationalDashboard.d.ts +37 -0
- package/dashboard/OperationalDashboard.d.ts.map +1 -0
- package/dashboard/OperationalDashboard.js +48 -0
- package/dashboard/OperationalDashboard.js.map +1 -0
- package/dashboard/index.d.ts +8 -0
- package/dashboard/index.d.ts.map +1 -0
- package/dashboard/index.js +9 -0
- package/dashboard/index.js.map +1 -0
- package/dashboard/types.d.ts +49 -0
- package/dashboard/types.d.ts.map +1 -0
- package/dashboard/types.js +2 -0
- package/dashboard/types.js.map +1 -0
- package/dashboard/useAgentExecutionSummary.d.ts +33 -0
- package/dashboard/useAgentExecutionSummary.d.ts.map +1 -0
- package/dashboard/useAgentExecutionSummary.js +32 -0
- package/dashboard/useAgentExecutionSummary.js.map +1 -0
- package/dashboard/useDashboardFailedRuns.d.ts +18 -0
- package/dashboard/useDashboardFailedRuns.d.ts.map +1 -0
- package/dashboard/useDashboardFailedRuns.js +86 -0
- package/dashboard/useDashboardFailedRuns.js.map +1 -0
- package/dashboard/useDashboardSummary.d.ts +32 -0
- package/dashboard/useDashboardSummary.d.ts.map +1 -0
- package/dashboard/useDashboardSummary.js +67 -0
- package/dashboard/useDashboardSummary.js.map +1 -0
- package/execution/ContextGauge.d.ts +45 -0
- package/execution/ContextGauge.d.ts.map +1 -0
- package/execution/ContextGauge.js +82 -0
- package/execution/ContextGauge.js.map +1 -0
- package/execution/InteractionModeBadge.d.ts +24 -0
- package/execution/InteractionModeBadge.d.ts.map +1 -0
- package/execution/InteractionModeBadge.js +29 -0
- package/execution/InteractionModeBadge.js.map +1 -0
- package/execution/MessageThread.d.ts +33 -3
- package/execution/MessageThread.d.ts.map +1 -1
- package/execution/MessageThread.js +51 -9
- package/execution/MessageThread.js.map +1 -1
- package/execution/PlanCompletionCard.d.ts +23 -0
- package/execution/PlanCompletionCard.d.ts.map +1 -0
- package/execution/PlanCompletionCard.js +28 -0
- package/execution/PlanCompletionCard.js.map +1 -0
- package/execution/SummarizationBadge.d.ts +30 -0
- package/execution/SummarizationBadge.d.ts.map +1 -0
- package/execution/SummarizationBadge.js +61 -0
- package/execution/SummarizationBadge.js.map +1 -0
- package/execution/SummarizationCard.d.ts +27 -0
- package/execution/SummarizationCard.d.ts.map +1 -0
- package/execution/SummarizationCard.js +47 -0
- package/execution/SummarizationCard.js.map +1 -0
- package/execution/__tests__/PlanCompletionCard.test.d.ts +2 -0
- package/execution/__tests__/PlanCompletionCard.test.d.ts.map +1 -0
- package/execution/__tests__/PlanCompletionCard.test.js +53 -0
- package/execution/__tests__/PlanCompletionCard.test.js.map +1 -0
- package/execution/__tests__/buildThreadItems-plan-completion.test.d.ts +2 -0
- package/execution/__tests__/buildThreadItems-plan-completion.test.d.ts.map +1 -0
- package/execution/__tests__/buildThreadItems-plan-completion.test.js +137 -0
- package/execution/__tests__/buildThreadItems-plan-completion.test.js.map +1 -0
- package/execution/__tests__/useContextWindow.test.d.ts +2 -0
- package/execution/__tests__/useContextWindow.test.d.ts.map +1 -0
- package/execution/__tests__/useContextWindow.test.js +121 -0
- package/execution/__tests__/useContextWindow.test.js.map +1 -0
- package/execution/index.d.ts +12 -0
- package/execution/index.d.ts.map +1 -1
- package/execution/index.js +6 -0
- package/execution/index.js.map +1 -1
- package/execution/useContextWindow.d.ts +71 -0
- package/execution/useContextWindow.d.ts.map +1 -0
- package/execution/useContextWindow.js +91 -0
- package/execution/useContextWindow.js.map +1 -0
- package/execution/useCreateAgentExecution.d.ts +9 -0
- package/execution/useCreateAgentExecution.d.ts.map +1 -1
- package/execution/useCreateAgentExecution.js +15 -3
- package/execution/useCreateAgentExecution.js.map +1 -1
- package/index.d.ts +9 -4
- package/index.d.ts.map +1 -1
- package/index.js +12 -2
- package/index.js.map +1 -1
- package/internal/VirtualizedThread.d.ts +2 -1
- package/internal/VirtualizedThread.d.ts.map +1 -1
- package/internal/VirtualizedThread.js +3 -2
- package/internal/VirtualizedThread.js.map +1 -1
- package/internal/store/index.d.ts +1 -0
- package/internal/store/index.d.ts.map +1 -1
- package/internal/store/index.js +1 -0
- package/internal/store/index.js.map +1 -1
- package/internal/store/workflow-execution-event-store.d.ts +92 -0
- package/internal/store/workflow-execution-event-store.d.ts.map +1 -0
- package/internal/store/workflow-execution-event-store.js +298 -0
- package/internal/store/workflow-execution-event-store.js.map +1 -0
- package/library/ScopeToggle.d.ts +13 -9
- package/library/ScopeToggle.d.ts.map +1 -1
- package/library/ScopeToggle.js +43 -22
- package/library/ScopeToggle.js.map +1 -1
- package/library/VisibilityToggle.js +14 -5
- package/library/VisibilityToggle.js.map +1 -1
- package/library/index.d.ts +1 -0
- package/library/index.d.ts.map +1 -1
- package/library/index.js +1 -0
- package/library/index.js.map +1 -1
- package/library/useExportResource.d.ts +3 -2
- package/library/useExportResource.d.ts.map +1 -1
- package/library/useExportResource.js +11 -6
- package/library/useExportResource.js.map +1 -1
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +25 -13
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/McpServerPicker.d.ts.map +1 -1
- package/mcp-server/McpServerPicker.js +4 -2
- package/mcp-server/McpServerPicker.js.map +1 -1
- package/package.json +16 -5
- package/provider.d.ts.map +1 -1
- package/provider.js +164 -1
- package/provider.js.map +1 -1
- package/resource-detail/ResourceDetailShell.d.ts +1 -1
- package/resource-detail/ResourceDetailShell.d.ts.map +1 -1
- package/resource-detail/ResourceDetailShell.js +6 -6
- package/resource-detail/ResourceDetailShell.js.map +1 -1
- package/resource-detail/types.d.ts +23 -0
- package/resource-detail/types.d.ts.map +1 -1
- package/resource-detail/useDeleteResource.d.ts +1 -1
- package/resource-detail/useDeleteResource.d.ts.map +1 -1
- package/resource-detail/useDeleteResource.js +5 -0
- package/resource-detail/useDeleteResource.js.map +1 -1
- package/resource-workbench/components/ResourceWorkbench.d.ts.map +1 -1
- package/resource-workbench/components/ResourceWorkbench.js +2 -1
- package/resource-workbench/components/ResourceWorkbench.js.map +1 -1
- package/session/useNewSessionFlow.d.ts.map +1 -1
- package/session/useNewSessionFlow.js +1 -0
- package/session/useNewSessionFlow.js.map +1 -1
- package/session/useSessionConversation.d.ts +7 -0
- package/session/useSessionConversation.d.ts.map +1 -1
- package/session/useSessionConversation.js +1 -0
- package/session/useSessionConversation.js.map +1 -1
- package/session/useSessionPageFlow.d.ts.map +1 -1
- package/session/useSessionPageFlow.js +1 -0
- package/session/useSessionPageFlow.js.map +1 -1
- package/session/useSessionUsage.d.ts.map +1 -1
- package/session/useSessionUsage.js +65 -4
- package/session/useSessionUsage.js.map +1 -1
- package/settings/UsageSection.d.ts.map +1 -1
- package/settings/UsageSection.js +1 -4
- package/settings/UsageSection.js.map +1 -1
- package/skill/SkillPicker.d.ts.map +1 -1
- package/skill/SkillPicker.js +4 -2
- package/skill/SkillPicker.js.map +1 -1
- package/src/activity/group-activity.ts +65 -0
- package/src/activity/index.ts +13 -0
- package/src/activity/types.ts +35 -0
- package/src/activity/useRecentActivity.ts +131 -0
- package/src/agent/AgentPicker.tsx +6 -1
- package/src/billing/BillingSection.tsx +3 -2
- package/src/composer/ComposerToolbar.tsx +19 -1
- package/src/composer/InteractionModePicker.tsx +189 -0
- package/src/composer/SessionComposer.tsx +85 -8
- package/src/composer/__tests__/SessionComposer-memo.test.ts +11 -6
- package/src/composer/index.ts +7 -0
- package/src/dashboard/DashboardFailedRuns.tsx +109 -0
- package/src/dashboard/DashboardKPICards.tsx +128 -0
- package/src/dashboard/OperationalDashboard.tsx +96 -0
- package/src/dashboard/index.ts +37 -0
- package/src/dashboard/types.ts +50 -0
- package/src/dashboard/useAgentExecutionSummary.ts +71 -0
- package/src/dashboard/useDashboardFailedRuns.ts +122 -0
- package/src/dashboard/useDashboardSummary.ts +109 -0
- package/src/execution/ContextGauge.tsx +243 -0
- package/src/execution/InteractionModeBadge.tsx +70 -0
- package/src/execution/MessageThread.tsx +88 -3
- package/src/execution/PlanCompletionCard.tsx +105 -0
- package/src/execution/SummarizationBadge.tsx +188 -0
- package/src/execution/SummarizationCard.tsx +126 -0
- package/src/execution/__tests__/PlanCompletionCard.test.tsx +67 -0
- package/src/execution/__tests__/buildThreadItems-plan-completion.test.ts +197 -0
- package/src/execution/__tests__/useContextWindow.test.ts +167 -0
- package/src/execution/index.ts +22 -0
- package/src/execution/useContextWindow.ts +148 -0
- package/src/execution/useCreateAgentExecution.ts +26 -3
- package/src/index.ts +222 -0
- package/src/internal/VirtualizedThread.tsx +4 -1
- package/src/internal/store/index.ts +6 -0
- package/src/internal/store/workflow-execution-event-store.ts +391 -0
- package/src/library/ScopeToggle.tsx +88 -20
- package/src/library/VisibilityToggle.tsx +54 -13
- package/src/library/index.ts +2 -0
- package/src/library/useExportResource.ts +12 -9
- package/src/mcp-server/McpServerDetailView.tsx +80 -148
- package/src/mcp-server/McpServerPicker.tsx +6 -1
- package/src/provider.tsx +195 -8
- package/src/resource-detail/ResourceDetailShell.tsx +21 -4
- package/src/resource-detail/types.ts +25 -0
- package/src/resource-detail/useDeleteResource.ts +6 -1
- package/src/resource-workbench/components/ResourceWorkbench.tsx +4 -0
- package/src/session/useNewSessionFlow.ts +1 -0
- package/src/session/useSessionConversation.ts +8 -0
- package/src/session/useSessionPageFlow.ts +1 -0
- package/src/session/useSessionUsage.ts +72 -4
- package/src/settings/UsageSection.tsx +1 -9
- package/src/skill/SkillPicker.tsx +6 -1
- package/src/workflow/ApprovalFormBuilder.tsx +1017 -0
- package/src/workflow/BranchConditionBuilder.tsx +451 -0
- package/src/workflow/CanvasActionsContext.ts +12 -0
- package/src/workflow/CanvasContextMenu.tsx +364 -0
- package/src/workflow/CanvasTaskNode.tsx +372 -0
- package/src/workflow/CanvasTransitionEdge.tsx +122 -0
- package/src/workflow/CostByWorkflowChart.tsx +120 -0
- package/src/workflow/ExecutionSummaryWidget.tsx +194 -0
- package/src/workflow/ExecutionTrendChart.tsx +157 -0
- package/src/workflow/FailedRunsWidget.tsx +109 -0
- package/src/workflow/PendingApprovalsWidget.tsx +115 -0
- package/src/workflow/TaskConfigForm.tsx +618 -0
- package/src/workflow/TaskKindRegistryContext.ts +36 -0
- package/src/workflow/TaskPickerPopover.tsx +326 -0
- package/src/workflow/WorkflowArchitectDialog.tsx +505 -0
- package/src/workflow/WorkflowCanvasEditor.tsx +651 -0
- package/src/workflow/WorkflowCanvasInner.tsx +160 -0
- package/src/workflow/WorkflowDashboard.tsx +124 -0
- package/src/workflow/WorkflowDetailView.tsx +527 -0
- package/src/workflow/WorkflowEditorView.tsx +547 -0
- package/src/workflow/WorkflowExecutionApprovalCard.tsx +129 -0
- package/src/workflow/WorkflowExecutionArtifactPanel.tsx +112 -0
- package/src/workflow/WorkflowExecutionCostPanel.tsx +131 -0
- package/src/workflow/WorkflowExecutionHeader.tsx +194 -0
- package/src/workflow/WorkflowExecutionPhaseBadge.tsx +188 -0
- package/src/workflow/WorkflowExecutionTaskPanel.tsx +135 -0
- package/src/workflow/WorkflowExecutionTimeline.tsx +118 -0
- package/src/workflow/WorkflowExecutionTimelineEvent.tsx +488 -0
- package/src/workflow/WorkflowExecutionViewer.tsx +248 -0
- package/src/workflow/WorkflowInspectorPanel.tsx +568 -0
- package/src/workflow/WorkflowRefinePanel.tsx +411 -0
- package/src/workflow/WorkflowRepairCard.tsx +433 -0
- package/src/workflow/WorkflowRunDialog.tsx +220 -0
- package/src/workflow/WorkflowRunForm.tsx +245 -0
- package/src/workflow/WorkflowTaskList.tsx +177 -0
- package/src/workflow/WorkflowTaskPalette.tsx +248 -0
- package/src/workflow/WorkflowTopologyGraph.tsx +250 -0
- package/src/workflow/WorkflowYamlEditor.tsx +271 -0
- package/src/workflow/__tests__/starter-workflow-yaml.test.ts +57 -0
- package/src/workflow/canvas-constants.ts +87 -0
- package/src/workflow/canvas-icons.tsx +36 -0
- package/src/workflow/extract-workflow-yaml.ts +87 -0
- package/src/workflow/graph-commands.ts +675 -0
- package/src/workflow/index.ts +375 -0
- package/src/workflow/serialize-workflow-yaml.ts +546 -0
- package/src/workflow/starter-workflow-yaml.ts +29 -0
- package/src/workflow/types.ts +99 -0
- package/src/workflow/useCanvasKeyboardShortcuts.ts +134 -0
- package/src/workflow/useDiagnoseExecutionFlow.ts +378 -0
- package/src/workflow/useGraphHistory.ts +138 -0
- package/src/workflow/usePendingApprovals.ts +89 -0
- package/src/workflow/useRefineWorkflowFlow.ts +321 -0
- package/src/workflow/useResolveAgentExecutionSession.ts +57 -0
- package/src/workflow/useRunWorkflowFlow.ts +235 -0
- package/src/workflow/useTaskKindRegistry.ts +135 -0
- package/src/workflow/useWorkflow.ts +78 -0
- package/src/workflow/useWorkflowArchitectFlow.ts +303 -0
- package/src/workflow/useWorkflowCanvas.ts +882 -0
- package/src/workflow/useWorkflowCount.ts +66 -0
- package/src/workflow/useWorkflowDashboardSummary.ts +71 -0
- package/src/workflow/useWorkflowEditor.ts +106 -0
- package/src/workflow/useWorkflowExecution.ts +67 -0
- package/src/workflow/useWorkflowExecutionActions.ts +179 -0
- package/src/workflow/useWorkflowExecutionArtifacts.ts +57 -0
- package/src/workflow/useWorkflowExecutionEventLog.ts +111 -0
- package/src/workflow/useWorkflowExecutionEventStream.ts +244 -0
- package/src/workflow/useWorkflowExecutionList.ts +121 -0
- package/src/workflow/useWorkflowInstances.ts +62 -0
- package/src/workflow/useWorkflowList.ts +79 -0
- package/src/workflow/useWorkflowSave.ts +84 -0
- package/src/workflow/useWorkflowTopology.ts +229 -0
- package/src/workflow/useWorkflowValidation.ts +329 -0
- package/src/workflow/useWorkflowYaml.ts +49 -0
- package/src/workflow/workflow-graph-conversions.ts +796 -0
- package/src/workflow/workflow-graph-model.ts +83 -0
- package/src/workflow/workflow-yaml-diff.ts +132 -0
- package/styles.css +1 -1
- package/workflow/ApprovalFormBuilder.d.ts +24 -0
- package/workflow/ApprovalFormBuilder.d.ts.map +1 -0
- package/workflow/ApprovalFormBuilder.js +347 -0
- package/workflow/ApprovalFormBuilder.js.map +1 -0
- package/workflow/BranchConditionBuilder.d.ts +29 -0
- package/workflow/BranchConditionBuilder.d.ts.map +1 -0
- package/workflow/BranchConditionBuilder.js +170 -0
- package/workflow/BranchConditionBuilder.js.map +1 -0
- package/workflow/CanvasActionsContext.d.ts +8 -0
- package/workflow/CanvasActionsContext.d.ts.map +1 -0
- package/workflow/CanvasActionsContext.js +4 -0
- package/workflow/CanvasActionsContext.js.map +1 -0
- package/workflow/CanvasContextMenu.d.ts +59 -0
- package/workflow/CanvasContextMenu.d.ts.map +1 -0
- package/workflow/CanvasContextMenu.js +98 -0
- package/workflow/CanvasContextMenu.js.map +1 -0
- package/workflow/CanvasTaskNode.d.ts +21 -0
- package/workflow/CanvasTaskNode.d.ts.map +1 -0
- package/workflow/CanvasTaskNode.js +125 -0
- package/workflow/CanvasTaskNode.js.map +1 -0
- package/workflow/CanvasTransitionEdge.d.ts +24 -0
- package/workflow/CanvasTransitionEdge.d.ts.map +1 -0
- package/workflow/CanvasTransitionEdge.js +50 -0
- package/workflow/CanvasTransitionEdge.js.map +1 -0
- package/workflow/CostByWorkflowChart.d.ts +15 -0
- package/workflow/CostByWorkflowChart.d.ts.map +1 -0
- package/workflow/CostByWorkflowChart.js +45 -0
- package/workflow/CostByWorkflowChart.js.map +1 -0
- package/workflow/ExecutionSummaryWidget.d.ts +16 -0
- package/workflow/ExecutionSummaryWidget.d.ts.map +1 -0
- package/workflow/ExecutionSummaryWidget.js +93 -0
- package/workflow/ExecutionSummaryWidget.js.map +1 -0
- package/workflow/ExecutionTrendChart.d.ts +14 -0
- package/workflow/ExecutionTrendChart.d.ts.map +1 -0
- package/workflow/ExecutionTrendChart.js +67 -0
- package/workflow/ExecutionTrendChart.js.map +1 -0
- package/workflow/FailedRunsWidget.d.ts +19 -0
- package/workflow/FailedRunsWidget.d.ts.map +1 -0
- package/workflow/FailedRunsWidget.js +37 -0
- package/workflow/FailedRunsWidget.js.map +1 -0
- package/workflow/PendingApprovalsWidget.d.ts +19 -0
- package/workflow/PendingApprovalsWidget.d.ts.map +1 -0
- package/workflow/PendingApprovalsWidget.js +35 -0
- package/workflow/PendingApprovalsWidget.js.map +1 -0
- package/workflow/TaskConfigForm.d.ts +29 -0
- package/workflow/TaskConfigForm.d.ts.map +1 -0
- package/workflow/TaskConfigForm.js +230 -0
- package/workflow/TaskConfigForm.js.map +1 -0
- package/workflow/TaskKindRegistryContext.d.ts +24 -0
- package/workflow/TaskKindRegistryContext.d.ts.map +1 -0
- package/workflow/TaskKindRegistryContext.js +25 -0
- package/workflow/TaskKindRegistryContext.js.map +1 -0
- package/workflow/TaskPickerPopover.d.ts +33 -0
- package/workflow/TaskPickerPopover.d.ts.map +1 -0
- package/workflow/TaskPickerPopover.js +110 -0
- package/workflow/TaskPickerPopover.js.map +1 -0
- package/workflow/WorkflowArchitectDialog.d.ts +48 -0
- package/workflow/WorkflowArchitectDialog.d.ts.map +1 -0
- package/workflow/WorkflowArchitectDialog.js +129 -0
- package/workflow/WorkflowArchitectDialog.js.map +1 -0
- package/workflow/WorkflowCanvasEditor.d.ts +38 -0
- package/workflow/WorkflowCanvasEditor.d.ts.map +1 -0
- package/workflow/WorkflowCanvasEditor.js +287 -0
- package/workflow/WorkflowCanvasEditor.js.map +1 -0
- package/workflow/WorkflowCanvasInner.d.ts +32 -0
- package/workflow/WorkflowCanvasInner.d.ts.map +1 -0
- package/workflow/WorkflowCanvasInner.js +49 -0
- package/workflow/WorkflowCanvasInner.js.map +1 -0
- package/workflow/WorkflowDashboard.d.ts +35 -0
- package/workflow/WorkflowDashboard.d.ts.map +1 -0
- package/workflow/WorkflowDashboard.js +59 -0
- package/workflow/WorkflowDashboard.js.map +1 -0
- package/workflow/WorkflowDetailView.d.ts +63 -0
- package/workflow/WorkflowDetailView.d.ts.map +1 -0
- package/workflow/WorkflowDetailView.js +202 -0
- package/workflow/WorkflowDetailView.js.map +1 -0
- package/workflow/WorkflowEditorView.d.ts +43 -0
- package/workflow/WorkflowEditorView.d.ts.map +1 -0
- package/workflow/WorkflowEditorView.js +165 -0
- package/workflow/WorkflowEditorView.js.map +1 -0
- package/workflow/WorkflowExecutionApprovalCard.d.ts +27 -0
- package/workflow/WorkflowExecutionApprovalCard.d.ts.map +1 -0
- package/workflow/WorkflowExecutionApprovalCard.js +32 -0
- package/workflow/WorkflowExecutionApprovalCard.js.map +1 -0
- package/workflow/WorkflowExecutionArtifactPanel.d.ts +15 -0
- package/workflow/WorkflowExecutionArtifactPanel.d.ts.map +1 -0
- package/workflow/WorkflowExecutionArtifactPanel.js +53 -0
- package/workflow/WorkflowExecutionArtifactPanel.js.map +1 -0
- package/workflow/WorkflowExecutionCostPanel.d.ts +18 -0
- package/workflow/WorkflowExecutionCostPanel.d.ts.map +1 -0
- package/workflow/WorkflowExecutionCostPanel.js +44 -0
- package/workflow/WorkflowExecutionCostPanel.js.map +1 -0
- package/workflow/WorkflowExecutionHeader.d.ts +26 -0
- package/workflow/WorkflowExecutionHeader.d.ts.map +1 -0
- package/workflow/WorkflowExecutionHeader.js +68 -0
- package/workflow/WorkflowExecutionHeader.js.map +1 -0
- package/workflow/WorkflowExecutionPhaseBadge.d.ts +23 -0
- package/workflow/WorkflowExecutionPhaseBadge.d.ts.map +1 -0
- package/workflow/WorkflowExecutionPhaseBadge.js +99 -0
- package/workflow/WorkflowExecutionPhaseBadge.js.map +1 -0
- package/workflow/WorkflowExecutionTaskPanel.d.ts +24 -0
- package/workflow/WorkflowExecutionTaskPanel.d.ts.map +1 -0
- package/workflow/WorkflowExecutionTaskPanel.js +59 -0
- package/workflow/WorkflowExecutionTaskPanel.js.map +1 -0
- package/workflow/WorkflowExecutionTimeline.d.ts +27 -0
- package/workflow/WorkflowExecutionTimeline.d.ts.map +1 -0
- package/workflow/WorkflowExecutionTimeline.js +51 -0
- package/workflow/WorkflowExecutionTimeline.js.map +1 -0
- package/workflow/WorkflowExecutionTimelineEvent.d.ts +18 -0
- package/workflow/WorkflowExecutionTimelineEvent.d.ts.map +1 -0
- package/workflow/WorkflowExecutionTimelineEvent.js +210 -0
- package/workflow/WorkflowExecutionTimelineEvent.js.map +1 -0
- package/workflow/WorkflowExecutionViewer.d.ts +45 -0
- package/workflow/WorkflowExecutionViewer.d.ts.map +1 -0
- package/workflow/WorkflowExecutionViewer.js +75 -0
- package/workflow/WorkflowExecutionViewer.js.map +1 -0
- package/workflow/WorkflowInspectorPanel.d.ts +46 -0
- package/workflow/WorkflowInspectorPanel.d.ts.map +1 -0
- package/workflow/WorkflowInspectorPanel.js +152 -0
- package/workflow/WorkflowInspectorPanel.js.map +1 -0
- package/workflow/WorkflowRefinePanel.d.ts +30 -0
- package/workflow/WorkflowRefinePanel.d.ts.map +1 -0
- package/workflow/WorkflowRefinePanel.js +107 -0
- package/workflow/WorkflowRefinePanel.js.map +1 -0
- package/workflow/WorkflowRepairCard.d.ts +35 -0
- package/workflow/WorkflowRepairCard.d.ts.map +1 -0
- package/workflow/WorkflowRepairCard.js +113 -0
- package/workflow/WorkflowRepairCard.js.map +1 -0
- package/workflow/WorkflowRunDialog.d.ts +51 -0
- package/workflow/WorkflowRunDialog.d.ts.map +1 -0
- package/workflow/WorkflowRunDialog.js +75 -0
- package/workflow/WorkflowRunDialog.js.map +1 -0
- package/workflow/WorkflowRunForm.d.ts +62 -0
- package/workflow/WorkflowRunForm.d.ts.map +1 -0
- package/workflow/WorkflowRunForm.js +64 -0
- package/workflow/WorkflowRunForm.js.map +1 -0
- package/workflow/WorkflowTaskList.d.ts +25 -0
- package/workflow/WorkflowTaskList.d.ts.map +1 -0
- package/workflow/WorkflowTaskList.js +89 -0
- package/workflow/WorkflowTaskList.js.map +1 -0
- package/workflow/WorkflowTaskPalette.d.ts +22 -0
- package/workflow/WorkflowTaskPalette.d.ts.map +1 -0
- package/workflow/WorkflowTaskPalette.js +83 -0
- package/workflow/WorkflowTaskPalette.js.map +1 -0
- package/workflow/WorkflowTopologyGraph.d.ts +22 -0
- package/workflow/WorkflowTopologyGraph.d.ts.map +1 -0
- package/workflow/WorkflowTopologyGraph.js +123 -0
- package/workflow/WorkflowTopologyGraph.js.map +1 -0
- package/workflow/WorkflowYamlEditor.d.ts +43 -0
- package/workflow/WorkflowYamlEditor.d.ts.map +1 -0
- package/workflow/WorkflowYamlEditor.js +215 -0
- package/workflow/WorkflowYamlEditor.js.map +1 -0
- package/workflow/__tests__/starter-workflow-yaml.test.d.ts +2 -0
- package/workflow/__tests__/starter-workflow-yaml.test.d.ts.map +1 -0
- package/workflow/__tests__/starter-workflow-yaml.test.js +44 -0
- package/workflow/__tests__/starter-workflow-yaml.test.js.map +1 -0
- package/workflow/canvas-constants.d.ts +56 -0
- package/workflow/canvas-constants.d.ts.map +1 -0
- package/workflow/canvas-constants.js +74 -0
- package/workflow/canvas-constants.js.map +1 -0
- package/workflow/canvas-icons.d.ts +13 -0
- package/workflow/canvas-icons.d.ts.map +1 -0
- package/workflow/canvas-icons.js +21 -0
- package/workflow/canvas-icons.js.map +1 -0
- package/workflow/extract-workflow-yaml.d.ts +22 -0
- package/workflow/extract-workflow-yaml.d.ts.map +1 -0
- package/workflow/extract-workflow-yaml.js +63 -0
- package/workflow/extract-workflow-yaml.js.map +1 -0
- package/workflow/graph-commands.d.ts +209 -0
- package/workflow/graph-commands.d.ts.map +1 -0
- package/workflow/graph-commands.js +516 -0
- package/workflow/graph-commands.js.map +1 -0
- package/workflow/index.d.ts +66 -0
- package/workflow/index.d.ts.map +1 -0
- package/workflow/index.js +88 -0
- package/workflow/index.js.map +1 -0
- package/workflow/serialize-workflow-yaml.d.ts +39 -0
- package/workflow/serialize-workflow-yaml.d.ts.map +1 -0
- package/workflow/serialize-workflow-yaml.js +413 -0
- package/workflow/serialize-workflow-yaml.js.map +1 -0
- package/workflow/starter-workflow-yaml.d.ts +12 -0
- package/workflow/starter-workflow-yaml.d.ts.map +1 -0
- package/workflow/starter-workflow-yaml.js +30 -0
- package/workflow/starter-workflow-yaml.js.map +1 -0
- package/workflow/types.d.ts +80 -0
- package/workflow/types.d.ts.map +1 -0
- package/workflow/types.js +2 -0
- package/workflow/types.js.map +1 -0
- package/workflow/useCanvasKeyboardShortcuts.d.ts +34 -0
- package/workflow/useCanvasKeyboardShortcuts.d.ts.map +1 -0
- package/workflow/useCanvasKeyboardShortcuts.js +108 -0
- package/workflow/useCanvasKeyboardShortcuts.js.map +1 -0
- package/workflow/useDiagnoseExecutionFlow.d.ts +87 -0
- package/workflow/useDiagnoseExecutionFlow.d.ts.map +1 -0
- package/workflow/useDiagnoseExecutionFlow.js +257 -0
- package/workflow/useDiagnoseExecutionFlow.js.map +1 -0
- package/workflow/useGraphHistory.d.ts +28 -0
- package/workflow/useGraphHistory.d.ts.map +1 -0
- package/workflow/useGraphHistory.js +106 -0
- package/workflow/useGraphHistory.js.map +1 -0
- package/workflow/usePendingApprovals.d.ts +35 -0
- package/workflow/usePendingApprovals.d.ts.map +1 -0
- package/workflow/usePendingApprovals.js +50 -0
- package/workflow/usePendingApprovals.js.map +1 -0
- package/workflow/useRefineWorkflowFlow.d.ts +75 -0
- package/workflow/useRefineWorkflowFlow.d.ts.map +1 -0
- package/workflow/useRefineWorkflowFlow.js +216 -0
- package/workflow/useRefineWorkflowFlow.js.map +1 -0
- package/workflow/useResolveAgentExecutionSession.d.ts +33 -0
- package/workflow/useResolveAgentExecutionSession.d.ts.map +1 -0
- package/workflow/useResolveAgentExecutionSession.js +37 -0
- package/workflow/useResolveAgentExecutionSession.js.map +1 -0
- package/workflow/useRunWorkflowFlow.d.ts +82 -0
- package/workflow/useRunWorkflowFlow.d.ts.map +1 -0
- package/workflow/useRunWorkflowFlow.js +145 -0
- package/workflow/useRunWorkflowFlow.js.map +1 -0
- package/workflow/useTaskKindRegistry.d.ts +96 -0
- package/workflow/useTaskKindRegistry.d.ts.map +1 -0
- package/workflow/useTaskKindRegistry.js +75 -0
- package/workflow/useTaskKindRegistry.js.map +1 -0
- package/workflow/useWorkflow.d.ts +47 -0
- package/workflow/useWorkflow.d.ts.map +1 -0
- package/workflow/useWorkflow.js +53 -0
- package/workflow/useWorkflow.js.map +1 -0
- package/workflow/useWorkflowArchitectFlow.d.ts +96 -0
- package/workflow/useWorkflowArchitectFlow.d.ts.map +1 -0
- package/workflow/useWorkflowArchitectFlow.js +179 -0
- package/workflow/useWorkflowArchitectFlow.js.map +1 -0
- package/workflow/useWorkflowCanvas.d.ts +66 -0
- package/workflow/useWorkflowCanvas.d.ts.map +1 -0
- package/workflow/useWorkflowCanvas.js +628 -0
- package/workflow/useWorkflowCanvas.js.map +1 -0
- package/workflow/useWorkflowCount.d.ts +47 -0
- package/workflow/useWorkflowCount.d.ts.map +1 -0
- package/workflow/useWorkflowCount.js +26 -0
- package/workflow/useWorkflowCount.js.map +1 -0
- package/workflow/useWorkflowDashboardSummary.d.ts +34 -0
- package/workflow/useWorkflowDashboardSummary.d.ts.map +1 -0
- package/workflow/useWorkflowDashboardSummary.js +33 -0
- package/workflow/useWorkflowDashboardSummary.js.map +1 -0
- package/workflow/useWorkflowEditor.d.ts +45 -0
- package/workflow/useWorkflowEditor.d.ts.map +1 -0
- package/workflow/useWorkflowEditor.js +52 -0
- package/workflow/useWorkflowEditor.js.map +1 -0
- package/workflow/useWorkflowExecution.d.ts +37 -0
- package/workflow/useWorkflowExecution.d.ts.map +1 -0
- package/workflow/useWorkflowExecution.js +43 -0
- package/workflow/useWorkflowExecution.js.map +1 -0
- package/workflow/useWorkflowExecutionActions.d.ts +41 -0
- package/workflow/useWorkflowExecutionActions.d.ts.map +1 -0
- package/workflow/useWorkflowExecutionActions.js +86 -0
- package/workflow/useWorkflowExecutionActions.js.map +1 -0
- package/workflow/useWorkflowExecutionArtifacts.d.ts +26 -0
- package/workflow/useWorkflowExecutionArtifacts.d.ts.map +1 -0
- package/workflow/useWorkflowExecutionArtifacts.js +29 -0
- package/workflow/useWorkflowExecutionArtifacts.js.map +1 -0
- package/workflow/useWorkflowExecutionEventLog.d.ts +47 -0
- package/workflow/useWorkflowExecutionEventLog.d.ts.map +1 -0
- package/workflow/useWorkflowExecutionEventLog.js +59 -0
- package/workflow/useWorkflowExecutionEventLog.js.map +1 -0
- package/workflow/useWorkflowExecutionEventStream.d.ts +61 -0
- package/workflow/useWorkflowExecutionEventStream.d.ts.map +1 -0
- package/workflow/useWorkflowExecutionEventStream.js +161 -0
- package/workflow/useWorkflowExecutionEventStream.js.map +1 -0
- package/workflow/useWorkflowExecutionList.d.ts +49 -0
- package/workflow/useWorkflowExecutionList.d.ts.map +1 -0
- package/workflow/useWorkflowExecutionList.js +65 -0
- package/workflow/useWorkflowExecutionList.js.map +1 -0
- package/workflow/useWorkflowInstances.d.ts +30 -0
- package/workflow/useWorkflowInstances.d.ts.map +1 -0
- package/workflow/useWorkflowInstances.js +33 -0
- package/workflow/useWorkflowInstances.js.map +1 -0
- package/workflow/useWorkflowList.d.ts +57 -0
- package/workflow/useWorkflowList.d.ts.map +1 -0
- package/workflow/useWorkflowList.js +29 -0
- package/workflow/useWorkflowList.js.map +1 -0
- package/workflow/useWorkflowSave.d.ts +25 -0
- package/workflow/useWorkflowSave.d.ts.map +1 -0
- package/workflow/useWorkflowSave.js +61 -0
- package/workflow/useWorkflowSave.js.map +1 -0
- package/workflow/useWorkflowTopology.d.ts +40 -0
- package/workflow/useWorkflowTopology.d.ts.map +1 -0
- package/workflow/useWorkflowTopology.js +163 -0
- package/workflow/useWorkflowTopology.js.map +1 -0
- package/workflow/useWorkflowValidation.d.ts +27 -0
- package/workflow/useWorkflowValidation.d.ts.map +1 -0
- package/workflow/useWorkflowValidation.js +253 -0
- package/workflow/useWorkflowValidation.js.map +1 -0
- package/workflow/useWorkflowYaml.d.ts +26 -0
- package/workflow/useWorkflowYaml.d.ts.map +1 -0
- package/workflow/useWorkflowYaml.js +26 -0
- package/workflow/useWorkflowYaml.js.map +1 -0
- package/workflow/workflow-graph-conversions.d.ts +70 -0
- package/workflow/workflow-graph-conversions.d.ts.map +1 -0
- package/workflow/workflow-graph-conversions.js +634 -0
- package/workflow/workflow-graph-conversions.js.map +1 -0
- package/workflow/workflow-graph-model.d.ts +83 -0
- package/workflow/workflow-graph-model.d.ts.map +1 -0
- package/workflow/workflow-graph-model.js +5 -0
- package/workflow/workflow-graph-model.js.map +1 -0
- package/workflow/workflow-yaml-diff.d.ts +24 -0
- package/workflow/workflow-yaml-diff.d.ts.map +1 -0
- package/workflow/workflow-yaml-diff.js +96 -0
- package/workflow/workflow-yaml-diff.js.map +1 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { memo, useState, useCallback } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { START_NODE_ID, END_NODE_ID } from "./workflow-graph-model";
|
|
6
|
+
import { TaskConfigForm } from "./TaskConfigForm";
|
|
7
|
+
import { BranchConditionBuilder } from "./BranchConditionBuilder";
|
|
8
|
+
import { ApprovalFormBuilder } from "./ApprovalFormBuilder";
|
|
9
|
+
import { CATEGORY_COLORS, TASK_NAME_PATTERN, TASK_NAME_PATTERN_ERROR } from "./canvas-constants";
|
|
10
|
+
import { taskKindToString } from "./workflow-graph-conversions";
|
|
11
|
+
/**
|
|
12
|
+
* Inspector panel for the visual canvas editor.
|
|
13
|
+
*
|
|
14
|
+
* Renders a right sidebar with context-sensitive sections based on the
|
|
15
|
+
* selected element: node inspector (Identity, Configuration, Export, Flow),
|
|
16
|
+
* edge inspector (label, source/target), or sentinel summary.
|
|
17
|
+
*
|
|
18
|
+
* Controlled component: receives selection + graph from the canvas hook
|
|
19
|
+
* and calls mutation methods for all edits (AD-T15-B3-004).
|
|
20
|
+
*
|
|
21
|
+
* @since T15 Batch 3 (Inspector + Edit Loop)
|
|
22
|
+
*/
|
|
23
|
+
export const WorkflowInspectorPanel = memo(function WorkflowInspectorPanel({ selection, graph, descriptor, onUpdateField, onRenameNode, onUpdateExport, onUpdateFlow, onDeleteEdge, onDeleteNode, onUpdateBranchRouting, onMigrateBranchHandle, onRemoveBranchEdges, className, }) {
|
|
24
|
+
if (!selection || !graph) {
|
|
25
|
+
return (_jsx("div", { className: cn("flex h-full items-center justify-center p-4", className), children: _jsx("span", { className: "text-xs text-[var(--stgm-muted-foreground,#737373)]", children: "Select a task or connection to inspect" }) }));
|
|
26
|
+
}
|
|
27
|
+
if (selection.type === "edge") {
|
|
28
|
+
const edge = graph.edges.find((e) => e.id === selection.id);
|
|
29
|
+
if (!edge)
|
|
30
|
+
return null;
|
|
31
|
+
return (_jsx(EdgeInspector, { edge: edge, graph: graph, onDeleteEdge: onDeleteEdge, className: className }));
|
|
32
|
+
}
|
|
33
|
+
const node = graph.nodes.find((n) => n.id === selection.id);
|
|
34
|
+
if (!node)
|
|
35
|
+
return null;
|
|
36
|
+
if (node.id === START_NODE_ID || node.id === END_NODE_ID) {
|
|
37
|
+
return _jsx(SentinelInspector, { node: node, className: className });
|
|
38
|
+
}
|
|
39
|
+
return (_jsx(NodeInspector, { node: node, graph: graph, descriptor: descriptor, onUpdateField: onUpdateField, onRenameNode: onRenameNode, onUpdateExport: onUpdateExport, onUpdateFlow: onUpdateFlow, onDeleteNode: onDeleteNode, onUpdateBranchRouting: onUpdateBranchRouting, onMigrateBranchHandle: onMigrateBranchHandle, onRemoveBranchEdges: onRemoveBranchEdges }));
|
|
40
|
+
});
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
// NodeInspector
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
function NodeInspector({ node, graph, descriptor, onUpdateField, onRenameNode, onUpdateExport, onUpdateFlow, onDeleteNode, onUpdateBranchRouting, onMigrateBranchHandle, onRemoveBranchEdges, }) {
|
|
45
|
+
const kindStr = taskKindToString(node.kind);
|
|
46
|
+
const categoryColor = CATEGORY_COLORS[node.category];
|
|
47
|
+
const handleFieldChange = useCallback((fieldPath, value) => {
|
|
48
|
+
onUpdateField(node.id, fieldPath, value);
|
|
49
|
+
}, [node.id, onUpdateField]);
|
|
50
|
+
const otherTaskNames = graph.nodes
|
|
51
|
+
.filter((n) => n.id !== node.id && n.id !== START_NODE_ID && n.id !== END_NODE_ID)
|
|
52
|
+
.map((n) => n.taskName);
|
|
53
|
+
const isSwitchCase = kindStr === "switch_case";
|
|
54
|
+
const isHumanInput = kindStr === "human_input";
|
|
55
|
+
const hasSpecializedEditor = isSwitchCase || isHumanInput;
|
|
56
|
+
return (_jsxs("div", { className: "flex h-full flex-col overflow-y-auto", children: [_jsx(IdentitySection, { node: node, graph: graph, kindStr: kindStr, categoryColor: categoryColor, description: descriptor?.description, onRenameNode: onRenameNode }), _jsxs("div", { className: "border-t border-[var(--stgm-border,#e5e5e5)]", children: [_jsx(SectionHeader, { title: "Configuration" }), isSwitchCase && onUpdateBranchRouting && onMigrateBranchHandle && onRemoveBranchEdges ? (_jsx(BranchConditionBuilder, { nodeId: node.id, config: node.config, edges: graph.edges, allTaskNames: otherTaskNames, onUpdateConfig: handleFieldChange, onUpdateBranchRouting: (handleId, target) => onUpdateBranchRouting(node.id, handleId, target), onMigrateBranchHandle: (oldId, newId) => onMigrateBranchHandle(node.id, oldId, newId), onRemoveBranchEdges: (handleId) => onRemoveBranchEdges(node.id, handleId) })) : isHumanInput && onUpdateBranchRouting && onMigrateBranchHandle && onRemoveBranchEdges ? (_jsx(ApprovalFormBuilder, { nodeId: node.id, config: node.config, edges: graph.edges, allTaskNames: otherTaskNames, onUpdateConfig: handleFieldChange, onUpdateBranchRouting: (handleId, target) => onUpdateBranchRouting(node.id, handleId, target), onMigrateBranchHandle: (oldId, newId) => onMigrateBranchHandle(node.id, oldId, newId), onRemoveBranchEdges: (handleId) => onRemoveBranchEdges(node.id, handleId) })) : descriptor && descriptor.fields.length > 0 ? (_jsx(TaskConfigForm, { fields: descriptor.fields, fieldGroups: descriptor.fieldGroups, config: node.config, onChange: handleFieldChange })) : (_jsx("div", { className: "px-3 py-4 text-xs text-[var(--stgm-muted-foreground,#737373)]", children: "No configurable fields for this task kind." }))] }), _jsx("div", { className: "border-t border-[var(--stgm-border,#e5e5e5)]", children: _jsx(ExportSection, { node: node, onUpdateExport: onUpdateExport }) }), !hasSpecializedEditor && (_jsx("div", { className: "border-t border-[var(--stgm-border,#e5e5e5)]", children: _jsx(FlowSection, { node: node, otherTaskNames: otherTaskNames, onUpdateFlow: onUpdateFlow }) })), onDeleteNode && (_jsx("div", { className: "mt-auto border-t border-[var(--stgm-border,#e5e5e5)] px-3 py-3", children: _jsx("button", { type: "button", onClick: () => onDeleteNode(node.id), className: "w-full rounded-md border border-[var(--stgm-destructive,#ef4444)]/30 px-2.5 py-1.5 text-xs font-medium text-[var(--stgm-destructive,#ef4444)] transition-colors hover:bg-[var(--stgm-destructive,#ef4444)]/10", children: "Delete task" }) }))] }));
|
|
57
|
+
}
|
|
58
|
+
// ---------------------------------------------------------------------------
|
|
59
|
+
// IdentitySection
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
function IdentitySection({ node, graph, kindStr, categoryColor, description, onRenameNode, }) {
|
|
62
|
+
const [editingName, setEditingName] = useState(false);
|
|
63
|
+
const [nameValue, setNameValue] = useState(node.taskName);
|
|
64
|
+
const [nameError, setNameError] = useState(null);
|
|
65
|
+
const existingNames = new Set(graph.nodes.filter((n) => n.id !== node.id).map((n) => n.taskName));
|
|
66
|
+
const startEditing = useCallback(() => {
|
|
67
|
+
setEditingName(true);
|
|
68
|
+
setNameValue(node.taskName);
|
|
69
|
+
setNameError(null);
|
|
70
|
+
}, [node.taskName]);
|
|
71
|
+
const commitName = useCallback(() => {
|
|
72
|
+
const trimmed = nameValue.trim();
|
|
73
|
+
if (!trimmed) {
|
|
74
|
+
setNameError("Name cannot be empty");
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (!TASK_NAME_PATTERN.test(trimmed)) {
|
|
78
|
+
setNameError(TASK_NAME_PATTERN_ERROR);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (existingNames.has(trimmed)) {
|
|
82
|
+
setNameError("A task with this name already exists");
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
setEditingName(false);
|
|
86
|
+
setNameError(null);
|
|
87
|
+
if (trimmed !== node.taskName) {
|
|
88
|
+
onRenameNode(node.id, trimmed);
|
|
89
|
+
}
|
|
90
|
+
}, [nameValue, existingNames, node.id, node.taskName, onRenameNode]);
|
|
91
|
+
const handleKeyDown = useCallback((e) => {
|
|
92
|
+
if (e.key === "Enter")
|
|
93
|
+
commitName();
|
|
94
|
+
if (e.key === "Escape") {
|
|
95
|
+
setEditingName(false);
|
|
96
|
+
setNameError(null);
|
|
97
|
+
}
|
|
98
|
+
}, [commitName]);
|
|
99
|
+
return (_jsxs("div", { className: "flex flex-col gap-2 px-3 py-3", children: [editingName ? (_jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx("input", { type: "text", value: nameValue, onChange: (e) => { setNameValue(e.target.value); setNameError(null); }, onBlur: commitName, onKeyDown: handleKeyDown, autoFocus: true, className: "rounded-md border border-[var(--stgm-border,#d4d4d8)] bg-[var(--stgm-background,#fff)] px-2 py-1 text-sm font-medium text-[var(--stgm-foreground,#1a1a2e)] focus:outline-none focus:ring-1 focus:ring-[var(--stgm-ring,#3b82f6)]" }), nameError && (_jsx("span", { className: "text-[10px] text-[var(--stgm-destructive,#ef4444)]", children: nameError }))] })) : (_jsx("button", { type: "button", onClick: startEditing, className: "w-fit text-left text-sm font-medium text-[var(--stgm-foreground,#1a1a2e)] hover:underline", title: "Click to rename", children: node.taskName })), _jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "inline-block rounded px-1.5 py-0.5 text-[10px] font-medium leading-tight", style: {
|
|
100
|
+
color: categoryColor,
|
|
101
|
+
backgroundColor: `color-mix(in srgb, ${categoryColor} 12%, transparent)`,
|
|
102
|
+
}, children: kindStr.replace(/_/g, " ") }), _jsx("span", { className: "text-[10px] text-[var(--stgm-muted-foreground,#737373)]", children: node.category })] }), description && (_jsx("p", { className: "text-[11px] leading-relaxed text-[var(--stgm-muted-foreground,#737373)]", children: description }))] }));
|
|
103
|
+
}
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
// ExportSection
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
function ExportSection({ node, onUpdateExport, }) {
|
|
108
|
+
const [value, setValue] = useState(node.export?.as ?? "");
|
|
109
|
+
const handleChange = useCallback((e) => {
|
|
110
|
+
setValue(e.target.value);
|
|
111
|
+
}, []);
|
|
112
|
+
const handleBlur = useCallback(() => {
|
|
113
|
+
const trimmed = value.trim();
|
|
114
|
+
onUpdateExport(node.id, trimmed || undefined);
|
|
115
|
+
}, [value, node.id, onUpdateExport]);
|
|
116
|
+
return (_jsxs("div", { className: "flex flex-col gap-1.5 px-3 py-3", children: [_jsx(SectionHeader, { title: "Export" }), _jsx("label", { className: "text-[11px] text-[var(--stgm-muted-foreground,#737373)]", children: "Export task output as a named variable" }), _jsx("input", { type: "text", value: value, onChange: handleChange, onBlur: handleBlur, placeholder: "e.g., result, analysis_output", className: "w-full rounded-md border border-[var(--stgm-border,#d4d4d8)] bg-[var(--stgm-background,#fff)] px-2 py-1.5 text-xs text-[var(--stgm-foreground,#1a1a2e)] placeholder:text-[var(--stgm-muted-foreground,#a3a3a3)] focus:outline-none focus:ring-1 focus:ring-[var(--stgm-ring,#3b82f6)]" })] }));
|
|
117
|
+
}
|
|
118
|
+
// ---------------------------------------------------------------------------
|
|
119
|
+
// FlowSection
|
|
120
|
+
// ---------------------------------------------------------------------------
|
|
121
|
+
function FlowSection({ node, otherTaskNames, onUpdateFlow, }) {
|
|
122
|
+
const currentFlow = node.flow?.then ?? "";
|
|
123
|
+
const handleChange = useCallback((e) => {
|
|
124
|
+
const val = e.target.value;
|
|
125
|
+
onUpdateFlow(node.id, val || undefined);
|
|
126
|
+
}, [node.id, onUpdateFlow]);
|
|
127
|
+
return (_jsxs("div", { className: "flex flex-col gap-1.5 px-3 py-3", children: [_jsx(SectionHeader, { title: "Flow" }), _jsx("label", { className: "text-[11px] text-[var(--stgm-muted-foreground,#737373)]", children: "Transition after this task completes" }), _jsxs("select", { value: currentFlow, onChange: handleChange, className: "w-full rounded-md border border-[var(--stgm-border,#d4d4d8)] bg-[var(--stgm-background,#fff)] px-2 py-1.5 text-xs text-[var(--stgm-foreground,#1a1a2e)] focus:outline-none focus:ring-1 focus:ring-[var(--stgm-ring,#3b82f6)]", children: [_jsx("option", { value: "", children: "Next (implicit sequential)" }), _jsx("option", { value: "end", children: "End workflow" }), otherTaskNames.map((name) => (_jsx("option", { value: name, children: name }, name)))] })] }));
|
|
128
|
+
}
|
|
129
|
+
// ---------------------------------------------------------------------------
|
|
130
|
+
// EdgeInspector
|
|
131
|
+
// ---------------------------------------------------------------------------
|
|
132
|
+
function EdgeInspector({ edge, graph, onDeleteEdge, className, }) {
|
|
133
|
+
const sourceNode = graph.nodes.find((n) => n.id === edge.source);
|
|
134
|
+
const targetNode = graph.nodes.find((n) => n.id === edge.target);
|
|
135
|
+
return (_jsxs("div", { className: cn("flex h-full flex-col gap-4 p-3", className), children: [_jsx(SectionHeader, { title: "Connection" }), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsxs("div", { className: "flex items-center gap-2 text-xs", children: [_jsx("span", { className: "font-medium text-[var(--stgm-foreground,#1a1a2e)]", children: sourceNode?.taskName ?? edge.source }), _jsx("span", { className: "text-[var(--stgm-muted-foreground,#737373)]", children: "\u2192" }), _jsx("span", { className: "font-medium text-[var(--stgm-foreground,#1a1a2e)]", children: targetNode?.taskName ?? edge.target })] }), edge.label && (_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "text-[11px] text-[var(--stgm-muted-foreground,#737373)]", children: "Label:" }), _jsx("span", { className: "text-xs text-[var(--stgm-foreground,#1a1a2e)]", children: edge.label })] })), edge.sourceHandle && (_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: "text-[11px] text-[var(--stgm-muted-foreground,#737373)]", children: "Port:" }), _jsx("span", { className: "text-xs text-[var(--stgm-foreground,#1a1a2e)]", children: edge.sourceHandle })] }))] }), onDeleteEdge && (_jsx("button", { type: "button", onClick: () => onDeleteEdge(edge.id), className: "self-start rounded px-2 py-1 text-xs text-[var(--stgm-destructive,#ef4444)] hover:bg-[var(--stgm-destructive,#ef4444)]/10", children: "Delete connection" }))] }));
|
|
136
|
+
}
|
|
137
|
+
// ---------------------------------------------------------------------------
|
|
138
|
+
// SentinelInspector
|
|
139
|
+
// ---------------------------------------------------------------------------
|
|
140
|
+
function SentinelInspector({ node, className, }) {
|
|
141
|
+
const isStart = node.id === START_NODE_ID;
|
|
142
|
+
return (_jsxs("div", { className: cn("flex h-full flex-col gap-2 p-3", className), children: [_jsx(SectionHeader, { title: isStart ? "Start" : "End" }), _jsx("p", { className: "text-xs text-[var(--stgm-muted-foreground,#737373)]", children: isStart
|
|
143
|
+
? "Entry point of the workflow. The first task is connected automatically."
|
|
144
|
+
: "Terminal point. Tasks routing here end the workflow execution." })] }));
|
|
145
|
+
}
|
|
146
|
+
// ---------------------------------------------------------------------------
|
|
147
|
+
// Shared
|
|
148
|
+
// ---------------------------------------------------------------------------
|
|
149
|
+
function SectionHeader({ title }) {
|
|
150
|
+
return (_jsx("h3", { className: "text-[11px] font-semibold uppercase tracking-wide text-[var(--stgm-muted-foreground,#737373)]", children: title }));
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=WorkflowInspectorPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowInspectorPanel.js","sourceRoot":"","sources":["../../src/workflow/WorkflowInspectorPanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAGpC,OA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ement context. */
|
|
4
|
+
readonly org: string;
|
|
5
|
+
/** Current workflow YAML from the editor. */
|
|
6
|
+
readonly currentYaml: string;
|
|
7
|
+
/** Called when the user accepts a refinement. Receives the updated YAML. */
|
|
8
|
+
readonly onAccept: (yaml: string) => void;
|
|
9
|
+
/** Called when the panel should close. */
|
|
10
|
+
readonly onClose: () => void;
|
|
11
|
+
/** Additional CSS class names. */
|
|
12
|
+
readonly className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Side panel for agent-powered iterative workflow refinement.
|
|
16
|
+
*
|
|
17
|
+
* Renders inside the editor's right pane (replacing the topology graph
|
|
18
|
+
* in code mode, or as a sidebar in visual mode). Layout:
|
|
19
|
+
*
|
|
20
|
+
* 1. **Header** — title + close button
|
|
21
|
+
* 2. **MessageThread** — streaming agent conversation (all turns)
|
|
22
|
+
* 3. **Result strip** — diff preview + accept/discard (when YAML extracted)
|
|
23
|
+
* 4. **Composer** — textarea + send button (pinned to bottom)
|
|
24
|
+
*
|
|
25
|
+
* Powered by the Workflow Architect system agent via
|
|
26
|
+
* {@link useRefineWorkflowFlow}. Styled via `--stgm-*` design tokens.
|
|
27
|
+
* Zero console dependencies (DD-004).
|
|
28
|
+
*/
|
|
29
|
+
export declare function WorkflowRefinePanel({ org, currentYaml, onAccept, onClose, className, }: WorkflowRefinePanelProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=WorkflowRefinePanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowRefinePanel.d.ts","sourceRoot":"","sources":["../../src/workflow/WorkflowRefinePanel.tsx"],"names":[],"mappings":"AAQA,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,gDAAgD;IAChD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,4EAA4E;IAC5E,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,kCAAkC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AASD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,WAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,GACV,EAAE,wBAAwB,2CA2L1B"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useRef, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { useRefineWorkflowFlow } from "./useRefineWorkflowFlow";
|
|
6
|
+
import { MessageThread } from "../execution/MessageThread";
|
|
7
|
+
import { computeUnifiedDiff } from "./workflow-yaml-diff";
|
|
8
|
+
const COMPOSER_ENABLED_PHASES = new Set([
|
|
9
|
+
"idle",
|
|
10
|
+
"ready",
|
|
11
|
+
"complete",
|
|
12
|
+
"error",
|
|
13
|
+
]);
|
|
14
|
+
/**
|
|
15
|
+
* Side panel for agent-powered iterative workflow refinement.
|
|
16
|
+
*
|
|
17
|
+
* Renders inside the editor's right pane (replacing the topology graph
|
|
18
|
+
* in code mode, or as a sidebar in visual mode). Layout:
|
|
19
|
+
*
|
|
20
|
+
* 1. **Header** — title + close button
|
|
21
|
+
* 2. **MessageThread** — streaming agent conversation (all turns)
|
|
22
|
+
* 3. **Result strip** — diff preview + accept/discard (when YAML extracted)
|
|
23
|
+
* 4. **Composer** — textarea + send button (pinned to bottom)
|
|
24
|
+
*
|
|
25
|
+
* Powered by the Workflow Architect system agent via
|
|
26
|
+
* {@link useRefineWorkflowFlow}. Styled via `--stgm-*` design tokens.
|
|
27
|
+
* Zero console dependencies (DD-004).
|
|
28
|
+
*/
|
|
29
|
+
export function WorkflowRefinePanel({ org, currentYaml, onAccept, onClose, className, }) {
|
|
30
|
+
const [instruction, setInstruction] = useState("");
|
|
31
|
+
const scrollRef = useRef(null);
|
|
32
|
+
const flow = useRefineWorkflowFlow({
|
|
33
|
+
org,
|
|
34
|
+
currentYaml,
|
|
35
|
+
onError: () => {
|
|
36
|
+
/* Error is displayed inline via flow.error */
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
const composerEnabled = COMPOSER_ENABLED_PHASES.has(flow.phase);
|
|
40
|
+
const hasConversation = flow.completedExecutions.length > 0 || flow.activeExecution !== null;
|
|
41
|
+
// -------------------------------------------------------------------------
|
|
42
|
+
// Handlers
|
|
43
|
+
// -------------------------------------------------------------------------
|
|
44
|
+
const handleSend = useCallback(async () => {
|
|
45
|
+
const trimmed = instruction.trim();
|
|
46
|
+
if (trimmed.length < 5)
|
|
47
|
+
return;
|
|
48
|
+
setInstruction("");
|
|
49
|
+
await flow.sendInstruction(trimmed);
|
|
50
|
+
requestAnimationFrame(() => {
|
|
51
|
+
scrollRef.current?.scrollTo({
|
|
52
|
+
top: scrollRef.current.scrollHeight,
|
|
53
|
+
behavior: "smooth",
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}, [flow.sendInstruction, instruction]);
|
|
57
|
+
const handleAccept = useCallback(() => {
|
|
58
|
+
const yaml = flow.acceptResult();
|
|
59
|
+
if (yaml) {
|
|
60
|
+
onAccept(yaml);
|
|
61
|
+
}
|
|
62
|
+
}, [flow.acceptResult, onAccept]);
|
|
63
|
+
const handleDiscard = useCallback(() => {
|
|
64
|
+
flow.discardResult();
|
|
65
|
+
}, [flow.discardResult]);
|
|
66
|
+
const handleKeyDown = useCallback((e) => {
|
|
67
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
handleSend();
|
|
70
|
+
}
|
|
71
|
+
}, [handleSend]);
|
|
72
|
+
// -------------------------------------------------------------------------
|
|
73
|
+
// Render
|
|
74
|
+
// -------------------------------------------------------------------------
|
|
75
|
+
return (_jsxs("div", { className: cn("flex h-full flex-col border-l border-border bg-background", className), role: "complementary", "aria-label": "Workflow refinement panel", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-border px-3 py-2", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(SparklesIcon, {}), _jsx("h3", { className: "text-xs font-semibold text-foreground", children: "Refine with AI" }), flow.isStreaming && (_jsxs("span", { className: "inline-flex items-center gap-1 text-[0.65rem] text-muted-foreground", children: [_jsx(SpinnerIcon, { size: 10 }), "Working\u2026"] }))] }), _jsx("button", { type: "button", onClick: onClose, className: "rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground", "aria-label": "Close refinement panel", children: _jsx(CloseIcon, {}) })] }), _jsxs("div", { ref: scrollRef, className: "flex min-h-0 flex-1 flex-col overflow-y-auto", children: [!hasConversation && flow.phase === "idle" && (_jsxs("div", { className: "flex flex-1 flex-col items-center justify-center gap-2 px-4 py-8 text-center", children: [_jsx(SparklesIcon, {}), _jsx("p", { className: "text-xs text-muted-foreground", children: "Describe the changes you want and the Workflow Architect agent will refine your workflow definition." })] })), flow.phase === "starting" && (_jsxs("div", { className: "flex flex-col items-center justify-center gap-2 py-8", children: [_jsx(SpinnerIcon, {}), _jsx("p", { className: "text-xs text-muted-foreground", children: "Starting Workflow Architect\u2026" })] })), hasConversation && (_jsx(MessageThread, { executions: flow.completedExecutions, activeStreamExecution: flow.activeExecution, pendingUserMessage: flow.phase === "starting" ? instruction || undefined : undefined, className: "flex-1" })), flow.error && flow.phase === "error" && (_jsx("div", { className: "mx-3 mt-3 rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive", role: "alert", children: flow.error }))] }), flow.phase === "complete" && flow.extractedYaml && (_jsx(ResultStrip, { extractedYaml: flow.extractedYaml, explanation: flow.explanation, beforeYaml: currentYaml, onAccept: handleAccept, onDiscard: handleDiscard })), _jsxs("div", { className: "border-t border-border p-3", children: [_jsx("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value), onKeyDown: handleKeyDown, placeholder: "What would you like to change?", disabled: !composerEnabled, rows: 3, className: cn("w-full resize-none rounded-md border border-input bg-background px-2.5 py-1.5 text-sm text-foreground", "placeholder:text-muted-foreground", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50") }), _jsxs("div", { className: "mt-2 flex items-center justify-between", children: [_jsxs("p", { className: "text-[0.65rem] text-muted-foreground", children: ["\u2318", "+Enter to submit"] }), _jsx("button", { type: "button", onClick: handleSend, disabled: !composerEnabled || instruction.trim().length < 5, className: cn("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", "bg-primary text-primary-foreground hover:bg-primary/90", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-40"), children: "Send" })] })] })] }));
|
|
76
|
+
}
|
|
77
|
+
// ---------------------------------------------------------------------------
|
|
78
|
+
// Result Strip — diff preview with accept/discard actions
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
function ResultStrip({ extractedYaml, explanation, beforeYaml, onAccept, onDiscard, }) {
|
|
81
|
+
const diffLines = computeUnifiedDiff(beforeYaml, extractedYaml);
|
|
82
|
+
const hasChanges = diffLines.some((l) => l.type !== "equal");
|
|
83
|
+
return (_jsxs("div", { className: "border-t border-border px-3 py-3", "aria-live": "polite", children: [explanation && (_jsxs("div", { className: "mb-3", children: [_jsx("h4", { className: "mb-1 text-[0.65rem] font-medium uppercase tracking-wider text-muted-foreground", children: "Changes" }), _jsx("p", { className: "text-xs leading-relaxed text-foreground", children: explanation })] })), hasChanges && (_jsxs("div", { className: "mb-3", children: [_jsx("h4", { className: "mb-1 text-[0.65rem] font-medium uppercase tracking-wider text-muted-foreground", children: "Diff" }), _jsx(DiffPreview, { lines: diffLines })] })), _jsxs("div", { className: "flex gap-2", children: [_jsx("button", { type: "button", onClick: onAccept, className: cn("flex-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", "bg-primary text-primary-foreground hover:bg-primary/90", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: "Accept" }), _jsx("button", { type: "button", onClick: onDiscard, className: cn("flex-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", "border border-input bg-background text-foreground", "hover:bg-accent hover:text-accent-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: "Discard" })] })] }));
|
|
84
|
+
}
|
|
85
|
+
// ---------------------------------------------------------------------------
|
|
86
|
+
// Diff Preview
|
|
87
|
+
// ---------------------------------------------------------------------------
|
|
88
|
+
function DiffPreview({ lines }) {
|
|
89
|
+
const filteredLines = lines.filter((l) => l.type !== "equal" || l.content.trim() !== "");
|
|
90
|
+
if (filteredLines.length > 200) {
|
|
91
|
+
return (_jsx("p", { className: "text-[0.7rem] text-muted-foreground", children: "Diff is too large to display. Accept to see the updated YAML." }));
|
|
92
|
+
}
|
|
93
|
+
return (_jsx("pre", { className: "max-h-60 overflow-auto rounded-md border border-border text-[0.7rem] leading-relaxed", children: lines.map((line, i) => (_jsxs("div", { className: cn("px-2", line.type === "added" && "bg-success/10 text-success", line.type === "removed" && "bg-destructive/10 text-destructive", line.type === "equal" && "text-muted-foreground"), children: [_jsx("span", { className: "mr-2 inline-block w-3 select-none text-right opacity-60", children: line.type === "added" ? "+" : line.type === "removed" ? "-" : " " }), line.content] }, i))) }));
|
|
94
|
+
}
|
|
95
|
+
// ---------------------------------------------------------------------------
|
|
96
|
+
// Icons
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
function SparklesIcon() {
|
|
99
|
+
return (_jsx("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M8 2l1.5 4.5L14 8l-4.5 1.5L8 14l-1.5-4.5L2 8l4.5-1.5z" }) }));
|
|
100
|
+
}
|
|
101
|
+
function CloseIcon() {
|
|
102
|
+
return (_jsx("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", "aria-hidden": "true", children: _jsx("path", { d: "M4 4l8 8M12 4l-8 8" }) }));
|
|
103
|
+
}
|
|
104
|
+
function SpinnerIcon({ size = 14 }) {
|
|
105
|
+
return (_jsx("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", className: "animate-spin", "aria-hidden": "true", children: _jsx("path", { d: "M8 2a6 6 0 1 0 6 6" }) }));
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=WorkflowRefinePanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowRefinePanel.js","sourceRoot":"","sources":["../../src/workflow/WorkflowRefinePanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAoB,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAiB,MAAM,sBAAsB,CAAC;AAgBzE,MAAM,uBAAuB,GAA6B,IAAI,GAAG,CAAC;IAChE,MAAM;IACN,OAAO;IACP,UAAU;IACV,OAAO;CACR,CAAC,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,GAAG,EACH,WAAW,EACX,QAAQ,EACR,OAAO,EACP,SAAS,GACgB;IACzB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,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KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,YAElB,eAAM,CAAC,EAAC,uDAAuD,GAAG,GAC9D,CACP,CAAC;AACJ,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,CACL,cACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,iBACT,MAAM,YAElB,eAAM,CAAC,EAAC,oBAAoB,GAAG,GAC3B,CACP,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,IAAI,GAAG,EAAE,EAA8B;IAC5D,OAAO,CACL,cACE,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,SAAS,EAAC,cAAc,iBACZ,MAAM,YAElB,eAAM,CAAC,EAAC,oBAAoB,GAAG,GAC3B,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Props for {@link WorkflowRepairCard}. */
|
|
2
|
+
export interface WorkflowRepairCardProps {
|
|
3
|
+
/** ID of the failed workflow execution to diagnose. */
|
|
4
|
+
readonly executionId: string;
|
|
5
|
+
/** Organization slug for authorization and resource context. */
|
|
6
|
+
readonly org: string;
|
|
7
|
+
/** Current workflow YAML for diff computation (optional). */
|
|
8
|
+
readonly currentWorkflowYaml?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Called when the user clicks "Apply Fix". Receives the suggested YAML.
|
|
11
|
+
* The host application handles navigation to the workflow editor (DD-004).
|
|
12
|
+
*/
|
|
13
|
+
readonly onApplyFix?: (yaml: string) => void;
|
|
14
|
+
/** Called when the panel should close. */
|
|
15
|
+
readonly onClose?: () => void;
|
|
16
|
+
/** Additional CSS class names. */
|
|
17
|
+
readonly className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Panel component that displays agent-powered diagnosis of a failed workflow
|
|
21
|
+
* execution. Designed for the execution viewer's right panel (AD-B5-001).
|
|
22
|
+
*
|
|
23
|
+
* Layout:
|
|
24
|
+
* 1. Header — "AI Diagnosis" title with sparkles icon + close button
|
|
25
|
+
* 2. Message area — `MessageThread` showing the agent conversation
|
|
26
|
+
* 3. Result strip (conditional) — fix explanation, diff preview, Apply Fix / Discard
|
|
27
|
+
* 4. Follow-up composer (pinned to bottom) — text input for additional questions
|
|
28
|
+
*
|
|
29
|
+
* Auto-starts diagnosis on mount (AD-B5-002). Supports multi-turn
|
|
30
|
+
* follow-up questions within the same session (AD-B5-003).
|
|
31
|
+
*
|
|
32
|
+
* Styled via `--stgm-*` design tokens. Zero console dependencies (DD-004).
|
|
33
|
+
*/
|
|
34
|
+
export declare function WorkflowRepairCard({ executionId, org, currentWorkflowYaml, onApplyFix, onClose, className, }: WorkflowRepairCardProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
//# sourceMappingURL=WorkflowRepairCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowRepairCard.d.ts","sourceRoot":"","sources":["../../src/workflow/WorkflowRepairCard.tsx"],"names":[],"mappings":"AAQA,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB;IACtC,uDAAuD;IACvD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,gEAAgE;IAChE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,6DAA6D;IAC7D,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,kCAAkC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAQD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,WAAW,EACX,GAAG,EACH,mBAAmB,EACnB,UAAU,EACV,OAAO,EACP,SAAS,GACV,EAAE,uBAAuB,2CA2MzB"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useRef, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { useDiagnoseExecutionFlow } from "./useDiagnoseExecutionFlow";
|
|
6
|
+
import { MessageThread } from "../execution/MessageThread";
|
|
7
|
+
import { computeUnifiedDiff } from "./workflow-yaml-diff";
|
|
8
|
+
const COMPOSER_ENABLED_PHASES = new Set([
|
|
9
|
+
"ready",
|
|
10
|
+
"complete",
|
|
11
|
+
"error",
|
|
12
|
+
]);
|
|
13
|
+
/**
|
|
14
|
+
* Panel component that displays agent-powered diagnosis of a failed workflow
|
|
15
|
+
* execution. Designed for the execution viewer's right panel (AD-B5-001).
|
|
16
|
+
*
|
|
17
|
+
* Layout:
|
|
18
|
+
* 1. Header — "AI Diagnosis" title with sparkles icon + close button
|
|
19
|
+
* 2. Message area — `MessageThread` showing the agent conversation
|
|
20
|
+
* 3. Result strip (conditional) — fix explanation, diff preview, Apply Fix / Discard
|
|
21
|
+
* 4. Follow-up composer (pinned to bottom) — text input for additional questions
|
|
22
|
+
*
|
|
23
|
+
* Auto-starts diagnosis on mount (AD-B5-002). Supports multi-turn
|
|
24
|
+
* follow-up questions within the same session (AD-B5-003).
|
|
25
|
+
*
|
|
26
|
+
* Styled via `--stgm-*` design tokens. Zero console dependencies (DD-004).
|
|
27
|
+
*/
|
|
28
|
+
export function WorkflowRepairCard({ executionId, org, currentWorkflowYaml, onApplyFix, onClose, className, }) {
|
|
29
|
+
const [followUp, setFollowUp] = useState("");
|
|
30
|
+
const scrollRef = useRef(null);
|
|
31
|
+
const flow = useDiagnoseExecutionFlow({
|
|
32
|
+
executionId,
|
|
33
|
+
org,
|
|
34
|
+
currentWorkflowYaml,
|
|
35
|
+
autoStart: true,
|
|
36
|
+
onError: () => {
|
|
37
|
+
/* Error is displayed inline via flow.error */
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const composerEnabled = COMPOSER_ENABLED_PHASES.has(flow.phase);
|
|
41
|
+
const hasConversation = flow.completedExecutions.length > 0 || flow.activeExecution !== null;
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
// Handlers
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
const handleSendFollowUp = useCallback(async () => {
|
|
46
|
+
const trimmed = followUp.trim();
|
|
47
|
+
if (trimmed.length < 5)
|
|
48
|
+
return;
|
|
49
|
+
setFollowUp("");
|
|
50
|
+
await flow.sendFollowUp(trimmed);
|
|
51
|
+
requestAnimationFrame(() => {
|
|
52
|
+
scrollRef.current?.scrollTo({
|
|
53
|
+
top: scrollRef.current.scrollHeight,
|
|
54
|
+
behavior: "smooth",
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}, [flow.sendFollowUp, followUp]);
|
|
58
|
+
const handleApplyFix = useCallback(() => {
|
|
59
|
+
const yaml = flow.acceptFix();
|
|
60
|
+
if (yaml && onApplyFix) {
|
|
61
|
+
onApplyFix(yaml);
|
|
62
|
+
}
|
|
63
|
+
}, [flow.acceptFix, onApplyFix]);
|
|
64
|
+
const handleDiscard = useCallback(() => {
|
|
65
|
+
flow.discardFix();
|
|
66
|
+
}, [flow.discardFix]);
|
|
67
|
+
const handleRetry = useCallback(() => {
|
|
68
|
+
flow.reset();
|
|
69
|
+
}, [flow.reset]);
|
|
70
|
+
const handleKeyDown = useCallback((e) => {
|
|
71
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
handleSendFollowUp();
|
|
74
|
+
}
|
|
75
|
+
}, [handleSendFollowUp]);
|
|
76
|
+
// ---------------------------------------------------------------------------
|
|
77
|
+
// Render
|
|
78
|
+
// ---------------------------------------------------------------------------
|
|
79
|
+
return (_jsxs("div", { className: cn("flex h-full flex-col bg-background", className), role: "complementary", "aria-label": "Workflow diagnosis panel", children: [_jsxs("div", { className: "flex items-center justify-between border-b border-border px-3 py-2", children: [_jsxs("div", { className: "flex items-center gap-1.5", children: [_jsx(SparklesIcon, {}), _jsx("h3", { className: "text-xs font-semibold text-foreground", children: "AI Diagnosis" }), flow.isStreaming && (_jsxs("span", { className: "inline-flex items-center gap-1 text-[0.65rem] text-muted-foreground", children: [_jsx(SpinnerIcon, { size: 10 }), "Analyzing\u2026"] }))] }), onClose && (_jsx("button", { type: "button", onClick: onClose, className: "rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground", "aria-label": "Close diagnosis panel", children: _jsx(CloseIcon, {}) }))] }), _jsxs("div", { ref: scrollRef, className: "flex min-h-0 flex-1 flex-col overflow-y-auto", children: [flow.phase === "starting" && !hasConversation && (_jsxs("div", { className: "flex flex-col items-center justify-center gap-2 py-8", children: [_jsx(SpinnerIcon, {}), _jsx("p", { className: "text-xs text-muted-foreground", children: "Starting Workflow Architect\u2026" })] })), hasConversation && (_jsx(MessageThread, { executions: flow.completedExecutions, activeStreamExecution: flow.activeExecution, className: "flex-1" })), flow.error && flow.phase === "error" && (_jsxs("div", { className: "mx-3 mt-3 space-y-2", children: [_jsx("div", { className: "rounded-md border border-destructive/30 bg-destructive/5 px-3 py-2 text-xs text-destructive", role: "alert", children: flow.error }), _jsx("button", { type: "button", onClick: handleRetry, className: cn("w-full rounded-md px-3 py-1.5 text-xs font-medium transition-colors", "border border-input bg-background text-foreground", "hover:bg-accent hover:text-accent-foreground"), children: "Try Again" })] }))] }), flow.phase === "complete" && flow.extractedYaml && (_jsx(ResultStrip, { extractedYaml: flow.extractedYaml, explanation: flow.explanation, beforeYaml: currentWorkflowYaml, onApplyFix: onApplyFix ? handleApplyFix : undefined, onDiscard: handleDiscard })), flow.phase === "ready" && !flow.extractedYaml && flow.completedExecutions.length > 0 && (_jsx("div", { className: "border-t border-border px-3 py-2", children: _jsx("div", { className: "rounded-md border border-border bg-muted/50 px-2.5 py-2 text-[0.7rem] text-muted-foreground", children: "No workflow definition changes are needed. Check the analysis above for remediation steps." }) })), _jsxs("div", { className: "border-t border-border p-3", children: [_jsx("textarea", { value: followUp, onChange: (e) => setFollowUp(e.target.value), onKeyDown: handleKeyDown, placeholder: "Ask a follow-up question...", disabled: !composerEnabled, rows: 2, className: cn("w-full resize-none rounded-md border border-input bg-background px-2.5 py-1.5 text-sm text-foreground", "placeholder:text-muted-foreground", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50") }), _jsxs("div", { className: "mt-2 flex items-center justify-between", children: [_jsxs("p", { className: "text-[0.65rem] text-muted-foreground", children: ["\u2318", "+Enter to send"] }), _jsx("button", { type: "button", onClick: handleSendFollowUp, disabled: !composerEnabled || followUp.trim().length < 5, className: cn("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", "bg-primary text-primary-foreground hover:bg-primary/90", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-40"), children: "Send" })] })] })] }));
|
|
80
|
+
}
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
// Result Strip — diff preview with apply/discard actions
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
function ResultStrip({ extractedYaml, explanation, beforeYaml, onApplyFix, onDiscard, }) {
|
|
85
|
+
const diffLines = beforeYaml
|
|
86
|
+
? computeUnifiedDiff(beforeYaml, extractedYaml)
|
|
87
|
+
: null;
|
|
88
|
+
const hasChanges = diffLines?.some((l) => l.type !== "equal") ?? false;
|
|
89
|
+
return (_jsxs("div", { className: "border-t border-border px-3 py-3", "aria-live": "polite", children: [explanation && (_jsxs("div", { className: "mb-3", children: [_jsx("h4", { className: "mb-1 text-[0.65rem] font-medium uppercase tracking-wider text-muted-foreground", children: "Suggested Fix" }), _jsx("p", { className: "text-xs leading-relaxed text-foreground", children: explanation })] })), hasChanges && diffLines && (_jsxs("div", { className: "mb-3", children: [_jsx("h4", { className: "mb-1 text-[0.65rem] font-medium uppercase tracking-wider text-muted-foreground", children: "Diff" }), _jsx(DiffPreview, { lines: diffLines })] })), _jsxs("div", { className: "flex gap-2", children: [onApplyFix && (_jsx("button", { type: "button", onClick: onApplyFix, className: cn("flex-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", "bg-primary text-primary-foreground hover:bg-primary/90", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: "Apply Fix" })), _jsx("button", { type: "button", onClick: onDiscard, className: cn("flex-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors", "border border-input bg-background text-foreground", "hover:bg-accent hover:text-accent-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"), children: "Discard" })] })] }));
|
|
90
|
+
}
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
// Diff Preview
|
|
93
|
+
// ---------------------------------------------------------------------------
|
|
94
|
+
function DiffPreview({ lines }) {
|
|
95
|
+
const filteredLines = lines.filter((l) => l.type !== "equal" || l.content.trim() !== "");
|
|
96
|
+
if (filteredLines.length > 200) {
|
|
97
|
+
return (_jsx("p", { className: "text-[0.7rem] text-muted-foreground", children: "Diff is too large to display. Apply the fix to see the updated YAML." }));
|
|
98
|
+
}
|
|
99
|
+
return (_jsx("pre", { className: "max-h-60 overflow-auto rounded-md border border-border text-[0.7rem] leading-relaxed", children: lines.map((line, i) => (_jsxs("div", { className: cn("px-2", line.type === "added" && "bg-success/10 text-success", line.type === "removed" && "bg-destructive/10 text-destructive", line.type === "equal" && "text-muted-foreground"), children: [_jsx("span", { className: "mr-2 inline-block w-3 select-none text-right opacity-60", children: line.type === "added" ? "+" : line.type === "removed" ? "-" : " " }), line.content] }, i))) }));
|
|
100
|
+
}
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
// Icons
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
function SparklesIcon() {
|
|
105
|
+
return (_jsx("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M8 2l1.5 4.5L14 8l-4.5 1.5L8 14l-1.5-4.5L2 8l4.5-1.5z" }) }));
|
|
106
|
+
}
|
|
107
|
+
function CloseIcon() {
|
|
108
|
+
return (_jsx("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", "aria-hidden": "true", children: _jsx("path", { d: "M4 4l8 8M12 4l-8 8" }) }));
|
|
109
|
+
}
|
|
110
|
+
function SpinnerIcon({ size = 14 }) {
|
|
111
|
+
return (_jsx("svg", { width: size, height: size, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", className: "animate-spin", "aria-hidden": "true", children: _jsx("path", { d: "M8 2a6 6 0 1 0 6 6" }) }));
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=WorkflowRepairCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowRepairCard.js","sourceRoot":"","sources":["../../src/workflow/WorkflowRepairCard.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,wBAAwB,EAAsB,MAAM,4BAA4B,CAAC;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ElB,eAAM,CAAC,EAAC,oBAAoB,GAAG,GAC3B,CACP,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EAAE,IAAI,GAAG,EAAE,EAA8B;IAC5D,OAAO,CACL,cACE,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,SAAS,EAAC,cAAc,iBACZ,MAAM,YAElB,eAAM,CAAC,EAAC,oBAAoB,GAAG,GAC3B,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Workflow } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/api_pb";
|
|
2
|
+
import type { WorkflowInstance } from "@stigmer/protos/ai/stigmer/agentic/workflowinstance/v1/api_pb";
|
|
3
|
+
/** Props for {@link WorkflowRunDialog}. */
|
|
4
|
+
export interface WorkflowRunDialogProps {
|
|
5
|
+
/** Whether the dialog is open. */
|
|
6
|
+
readonly open: boolean;
|
|
7
|
+
/** Called when the dialog should close (cancel, backdrop click, Escape). */
|
|
8
|
+
readonly onOpenChange: (open: boolean) => void;
|
|
9
|
+
/** Organization slug that owns the workflow. */
|
|
10
|
+
readonly org: string;
|
|
11
|
+
/** The workflow blueprint to run. */
|
|
12
|
+
readonly workflow: Workflow;
|
|
13
|
+
/** Available workflow instances for the instance selector. */
|
|
14
|
+
readonly instances: readonly WorkflowInstance[];
|
|
15
|
+
/**
|
|
16
|
+
* Called after the execution is created successfully.
|
|
17
|
+
* Receives the execution ID — use for navigation.
|
|
18
|
+
*/
|
|
19
|
+
readonly onSuccess: (executionId: string) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Called when submission fails. Receives a human-readable message.
|
|
22
|
+
* Use for toast notifications.
|
|
23
|
+
*/
|
|
24
|
+
readonly onError?: (message: string) => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Dialog for running a workflow execution.
|
|
28
|
+
*
|
|
29
|
+
* Composes {@link useRunWorkflowFlow} with {@link WorkflowRunForm}
|
|
30
|
+
* inside a native `<dialog>` element. Manages the full lifecycle:
|
|
31
|
+
* form fields, validation, submission, error display, and close.
|
|
32
|
+
*
|
|
33
|
+
* Uses the same `<dialog>` + `showModal()` pattern as
|
|
34
|
+
* {@link ConfirmDialog} — built-in focus trapping, Escape key
|
|
35
|
+
* handling, and backdrop. Styled via `--stgm-*` design tokens.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* <WorkflowRunDialog
|
|
40
|
+
* open={showRunDialog}
|
|
41
|
+
* onOpenChange={setShowRunDialog}
|
|
42
|
+
* org="acme"
|
|
43
|
+
* workflow={workflow}
|
|
44
|
+
* instances={instances}
|
|
45
|
+
* onSuccess={(id) => router.push(`/workflows/executions/${id}`)}
|
|
46
|
+
* onError={(msg) => toast.error(msg)}
|
|
47
|
+
* />
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function WorkflowRunDialog({ open, onOpenChange, org, workflow, instances, onSuccess, onError, }: WorkflowRunDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
//# sourceMappingURL=WorkflowRunDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowRunDialog.d.ts","sourceRoot":"","sources":["../../src/workflow/WorkflowRunDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uDAAuD,CAAC;AACtF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+DAA+D,CAAC;AAItG,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,4EAA4E;IAC5E,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,gDAAgD;IAChD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAChD;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,YAAY,EACZ,GAAG,EACH,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO,GACR,EAAE,sBAAsB,2CAoIxB"}
|