@datatechsolutions/ui 2.11.79 → 2.11.80
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/dist/astrlabe/index.d.mts +16 -1
- package/dist/astrlabe/index.d.ts +16 -1
- package/dist/astrlabe/index.js +229 -0
- package/dist/astrlabe/index.js.map +1 -1
- package/dist/astrlabe/index.mjs +230 -2
- package/dist/astrlabe/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -258,6 +258,21 @@ type PipelineSettingsModalProps = {
|
|
|
258
258
|
};
|
|
259
259
|
declare function PipelineSettingsModal({ onSave }: PipelineSettingsModalProps): react_jsx_runtime.JSX.Element;
|
|
260
260
|
|
|
261
|
+
type ReplayInputVariables = Record<string, unknown>;
|
|
262
|
+
type RunReplayModalProps = {
|
|
263
|
+
open: boolean;
|
|
264
|
+
onClose: () => void;
|
|
265
|
+
runId: string;
|
|
266
|
+
workflowId: string;
|
|
267
|
+
/** The original run's `inputVariables` map. Keys become the form
|
|
268
|
+
* rows; types are inferred (string/number/boolean/json) so the
|
|
269
|
+
* inputs render appropriately. */
|
|
270
|
+
originalInputs: ReplayInputVariables;
|
|
271
|
+
/** Receives the override map. Empty object → verbatim re-run. */
|
|
272
|
+
onReplay: (overrides: ReplayInputVariables) => Promise<void>;
|
|
273
|
+
};
|
|
274
|
+
declare function RunReplayModal({ open, onClose, runId, workflowId, originalInputs, onReplay, }: RunReplayModalProps): react_jsx_runtime.JSX.Element;
|
|
275
|
+
|
|
261
276
|
/**
|
|
262
277
|
* Rule editing types.
|
|
263
278
|
*
|
|
@@ -858,4 +873,4 @@ declare function getEntityBadgeColor(entityKey: string | undefined): string;
|
|
|
858
873
|
declare function getEntityHandleColor(entityKey: string | undefined): string;
|
|
859
874
|
declare function getEntityMinimapColor(entityKey: string | undefined): string;
|
|
860
875
|
|
|
861
|
-
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, type PipelineSettingsPatch, 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 };
|
|
876
|
+
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, type PipelineSettingsPatch, PreviewPanel, type PreviewPanelProps, QuestionClassifierFlowNode, QuestionClassifierNodeData, RULE_STATUS_OPTIONS, type ReplayInputVariables, type RuleAction, RuleActionBuilder, type RuleCondition, RuleConditionBuilder, type RuleConditionOperator, RuleFlowNode, RuleForm, type RuleFormValue, RuleNodeData, type RuleStatus, RunInputDialog, type RunInputDialogProps, RunPanel, RunReplayModal, type RunReplayModalProps, 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 };
|
package/dist/astrlabe/index.d.ts
CHANGED
|
@@ -258,6 +258,21 @@ type PipelineSettingsModalProps = {
|
|
|
258
258
|
};
|
|
259
259
|
declare function PipelineSettingsModal({ onSave }: PipelineSettingsModalProps): react_jsx_runtime.JSX.Element;
|
|
260
260
|
|
|
261
|
+
type ReplayInputVariables = Record<string, unknown>;
|
|
262
|
+
type RunReplayModalProps = {
|
|
263
|
+
open: boolean;
|
|
264
|
+
onClose: () => void;
|
|
265
|
+
runId: string;
|
|
266
|
+
workflowId: string;
|
|
267
|
+
/** The original run's `inputVariables` map. Keys become the form
|
|
268
|
+
* rows; types are inferred (string/number/boolean/json) so the
|
|
269
|
+
* inputs render appropriately. */
|
|
270
|
+
originalInputs: ReplayInputVariables;
|
|
271
|
+
/** Receives the override map. Empty object → verbatim re-run. */
|
|
272
|
+
onReplay: (overrides: ReplayInputVariables) => Promise<void>;
|
|
273
|
+
};
|
|
274
|
+
declare function RunReplayModal({ open, onClose, runId, workflowId, originalInputs, onReplay, }: RunReplayModalProps): react_jsx_runtime.JSX.Element;
|
|
275
|
+
|
|
261
276
|
/**
|
|
262
277
|
* Rule editing types.
|
|
263
278
|
*
|
|
@@ -858,4 +873,4 @@ declare function getEntityBadgeColor(entityKey: string | undefined): string;
|
|
|
858
873
|
declare function getEntityHandleColor(entityKey: string | undefined): string;
|
|
859
874
|
declare function getEntityMinimapColor(entityKey: string | undefined): string;
|
|
860
875
|
|
|
861
|
-
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, type PipelineSettingsPatch, 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 };
|
|
876
|
+
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, type PipelineSettingsPatch, PreviewPanel, type PreviewPanelProps, QuestionClassifierFlowNode, QuestionClassifierNodeData, RULE_STATUS_OPTIONS, type ReplayInputVariables, type RuleAction, RuleActionBuilder, type RuleCondition, RuleConditionBuilder, type RuleConditionOperator, RuleFlowNode, RuleForm, type RuleFormValue, RuleNodeData, type RuleStatus, RunInputDialog, type RunInputDialogProps, RunPanel, RunReplayModal, type RunReplayModalProps, 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 };
|
package/dist/astrlabe/index.js
CHANGED
|
@@ -1553,6 +1553,234 @@ function PipelineSettingsModal({ onSave }) {
|
|
|
1553
1553
|
}
|
|
1554
1554
|
);
|
|
1555
1555
|
}
|
|
1556
|
+
function RunReplayModal({
|
|
1557
|
+
open,
|
|
1558
|
+
onClose,
|
|
1559
|
+
runId,
|
|
1560
|
+
workflowId,
|
|
1561
|
+
originalInputs,
|
|
1562
|
+
onReplay
|
|
1563
|
+
}) {
|
|
1564
|
+
const t = chunkYXN2K77G_js.useTranslations("agents.workflow");
|
|
1565
|
+
const [rows, setRows] = react.useState([]);
|
|
1566
|
+
const [submitting, setSubmitting] = react.useState(false);
|
|
1567
|
+
const [error, setError] = react.useState(null);
|
|
1568
|
+
react.useEffect(() => {
|
|
1569
|
+
if (!open) return;
|
|
1570
|
+
setRows(Object.entries(originalInputs).map(([key, value]) => toRow(key, value)));
|
|
1571
|
+
setError(null);
|
|
1572
|
+
}, [open, originalInputs]);
|
|
1573
|
+
const overrides = react.useMemo(() => {
|
|
1574
|
+
const out = {};
|
|
1575
|
+
for (const row of rows) {
|
|
1576
|
+
if (!row.touched) continue;
|
|
1577
|
+
try {
|
|
1578
|
+
out[row.key] = parseRow(row);
|
|
1579
|
+
} catch (e) {
|
|
1580
|
+
out[`__error__${row.key}`] = e.message;
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
return out;
|
|
1584
|
+
}, [rows]);
|
|
1585
|
+
const hasParseError = Object.keys(overrides).some((k) => k.startsWith("__error__"));
|
|
1586
|
+
const updateRow = (index, patch) => {
|
|
1587
|
+
setRows((current) => current.map((r, i) => i === index ? { ...r, ...patch, touched: true } : r));
|
|
1588
|
+
};
|
|
1589
|
+
const resetRow = (index) => {
|
|
1590
|
+
setRows((current) => current.map((r, i) => {
|
|
1591
|
+
if (i !== index) return r;
|
|
1592
|
+
return toRow(r.key, r.original);
|
|
1593
|
+
}));
|
|
1594
|
+
};
|
|
1595
|
+
const handleSubmit = async () => {
|
|
1596
|
+
setError(null);
|
|
1597
|
+
if (hasParseError) {
|
|
1598
|
+
setError(t("replayParseError", { _: "One or more values do not match their declared type." }));
|
|
1599
|
+
return;
|
|
1600
|
+
}
|
|
1601
|
+
setSubmitting(true);
|
|
1602
|
+
try {
|
|
1603
|
+
const cleaned = {};
|
|
1604
|
+
for (const row of rows) {
|
|
1605
|
+
if (!row.touched) continue;
|
|
1606
|
+
cleaned[row.key] = parseRow(row);
|
|
1607
|
+
}
|
|
1608
|
+
await onReplay(cleaned);
|
|
1609
|
+
onClose();
|
|
1610
|
+
} catch (e) {
|
|
1611
|
+
setError(e.message);
|
|
1612
|
+
} finally {
|
|
1613
|
+
setSubmitting(false);
|
|
1614
|
+
}
|
|
1615
|
+
};
|
|
1616
|
+
const footer = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1617
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[11px] text-gray-400", children: [
|
|
1618
|
+
"run ",
|
|
1619
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: runId.slice(0, 8) }),
|
|
1620
|
+
" \xB7 wf ",
|
|
1621
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: workflowId.slice(0, 8) })
|
|
1622
|
+
] }),
|
|
1623
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1624
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1625
|
+
"button",
|
|
1626
|
+
{
|
|
1627
|
+
type: "button",
|
|
1628
|
+
onClick: onClose,
|
|
1629
|
+
className: "rounded-lg border border-gray-200/50 px-4 py-2 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-100/50 dark:border-white/10 dark:text-gray-300 dark:hover:bg-white/5",
|
|
1630
|
+
children: t("cancel")
|
|
1631
|
+
}
|
|
1632
|
+
),
|
|
1633
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1634
|
+
chunkTUEYBNWL_js.Button,
|
|
1635
|
+
{
|
|
1636
|
+
type: "submit",
|
|
1637
|
+
form: "run-replay-form",
|
|
1638
|
+
color: "ios-glass-blue",
|
|
1639
|
+
loading: submitting,
|
|
1640
|
+
children: [
|
|
1641
|
+
/* @__PURE__ */ jsxRuntime.jsx(outline.ArrowPathIcon, { className: "h-4 w-4" }),
|
|
1642
|
+
t("replay", { _: "Replay" })
|
|
1643
|
+
]
|
|
1644
|
+
}
|
|
1645
|
+
)
|
|
1646
|
+
] })
|
|
1647
|
+
] });
|
|
1648
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1649
|
+
chunkTUEYBNWL_js.GlassModal,
|
|
1650
|
+
{
|
|
1651
|
+
open,
|
|
1652
|
+
onClose,
|
|
1653
|
+
title: t("replayTitle", { _: "Replay run" }),
|
|
1654
|
+
subtitle: t("replaySubtitle", { _: "Tweak any input below and re-execute. Untouched keys keep their original value." }),
|
|
1655
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.ArrowPathIcon, { className: "h-5 w-5 text-white" }),
|
|
1656
|
+
gradient: "from-sky-500 to-indigo-600",
|
|
1657
|
+
maxWidth: "lg",
|
|
1658
|
+
footer,
|
|
1659
|
+
onSubmit: (event) => {
|
|
1660
|
+
event.preventDefault();
|
|
1661
|
+
void handleSubmit();
|
|
1662
|
+
},
|
|
1663
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1664
|
+
"form",
|
|
1665
|
+
{
|
|
1666
|
+
id: "run-replay-form",
|
|
1667
|
+
onSubmit: (event) => {
|
|
1668
|
+
event.preventDefault();
|
|
1669
|
+
void handleSubmit();
|
|
1670
|
+
},
|
|
1671
|
+
className: "space-y-3",
|
|
1672
|
+
children: [
|
|
1673
|
+
rows.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: t("replayNoInputs", { _: "This run had no input variables \u2014 replaying will execute the workflow as-is." }) }) : rows.map((row, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1674
|
+
RowEditor,
|
|
1675
|
+
{
|
|
1676
|
+
row,
|
|
1677
|
+
onChange: (patch) => updateRow(index, patch),
|
|
1678
|
+
onReset: () => resetRow(index)
|
|
1679
|
+
},
|
|
1680
|
+
row.key
|
|
1681
|
+
)),
|
|
1682
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "rounded-lg border border-red-400/40 bg-red-500/10 p-2 text-xs text-red-600 dark:text-red-300", children: error })
|
|
1683
|
+
]
|
|
1684
|
+
}
|
|
1685
|
+
)
|
|
1686
|
+
}
|
|
1687
|
+
);
|
|
1688
|
+
}
|
|
1689
|
+
function RowEditor({
|
|
1690
|
+
row,
|
|
1691
|
+
onChange,
|
|
1692
|
+
onReset
|
|
1693
|
+
}) {
|
|
1694
|
+
const isJson = row.kind === "json";
|
|
1695
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-gray-200/60 bg-gray-50/60 p-3 dark:border-white/10 dark:bg-white/5", children: [
|
|
1696
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
|
|
1697
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono text-xs text-gray-700 dark:text-gray-200", children: row.key }),
|
|
1698
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1699
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-gray-200/60 px-2 py-0.5 text-[10px] uppercase tracking-wider text-gray-600 dark:bg-white/10 dark:text-gray-300", children: row.kind }),
|
|
1700
|
+
row.touched && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1701
|
+
"button",
|
|
1702
|
+
{
|
|
1703
|
+
type: "button",
|
|
1704
|
+
onClick: onReset,
|
|
1705
|
+
className: "text-[11px] text-indigo-600 hover:text-indigo-500 dark:text-indigo-400",
|
|
1706
|
+
children: "reset"
|
|
1707
|
+
}
|
|
1708
|
+
)
|
|
1709
|
+
] })
|
|
1710
|
+
] }),
|
|
1711
|
+
row.kind === "boolean" ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1712
|
+
"select",
|
|
1713
|
+
{
|
|
1714
|
+
value: row.value,
|
|
1715
|
+
onChange: (event) => onChange({ value: event.target.value }),
|
|
1716
|
+
className: "w-full rounded-lg border border-gray-200/50 bg-white/70 px-3 py-2 text-sm text-gray-900 dark:border-white/10 dark:bg-gray-800/70 dark:text-gray-100",
|
|
1717
|
+
children: [
|
|
1718
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "true", children: "true" }),
|
|
1719
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "false", children: "false" })
|
|
1720
|
+
]
|
|
1721
|
+
}
|
|
1722
|
+
) : isJson ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1723
|
+
chunkTUEYBNWL_js.FormTextarea,
|
|
1724
|
+
{
|
|
1725
|
+
value: row.value,
|
|
1726
|
+
onValueChange: (v) => onChange({ value: v }),
|
|
1727
|
+
rows: 4,
|
|
1728
|
+
className: "font-mono"
|
|
1729
|
+
}
|
|
1730
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1731
|
+
chunkTUEYBNWL_js.FormInput,
|
|
1732
|
+
{
|
|
1733
|
+
type: row.kind === "number" ? "number" : "text",
|
|
1734
|
+
value: row.value,
|
|
1735
|
+
onValueChange: (v) => onChange({ value: v })
|
|
1736
|
+
}
|
|
1737
|
+
)
|
|
1738
|
+
] });
|
|
1739
|
+
}
|
|
1740
|
+
function toRow(key, value) {
|
|
1741
|
+
if (value === null || value === void 0) {
|
|
1742
|
+
return { key, value: "", kind: "string", touched: false, original: value };
|
|
1743
|
+
}
|
|
1744
|
+
if (typeof value === "boolean") {
|
|
1745
|
+
return { key, value: value ? "true" : "false", kind: "boolean", touched: false, original: value };
|
|
1746
|
+
}
|
|
1747
|
+
if (typeof value === "number") {
|
|
1748
|
+
return { key, value: String(value), kind: "number", touched: false, original: value };
|
|
1749
|
+
}
|
|
1750
|
+
if (typeof value === "string") {
|
|
1751
|
+
return { key, value, kind: "string", touched: false, original: value };
|
|
1752
|
+
}
|
|
1753
|
+
return {
|
|
1754
|
+
key,
|
|
1755
|
+
value: JSON.stringify(value, null, 2),
|
|
1756
|
+
kind: "json",
|
|
1757
|
+
touched: false,
|
|
1758
|
+
original: value
|
|
1759
|
+
};
|
|
1760
|
+
}
|
|
1761
|
+
function parseRow(row) {
|
|
1762
|
+
switch (row.kind) {
|
|
1763
|
+
case "string":
|
|
1764
|
+
return row.value;
|
|
1765
|
+
case "number": {
|
|
1766
|
+
const n = Number(row.value);
|
|
1767
|
+
if (!Number.isFinite(n)) {
|
|
1768
|
+
throw new Error(`'${row.key}' must be a number, got '${row.value}'`);
|
|
1769
|
+
}
|
|
1770
|
+
return n;
|
|
1771
|
+
}
|
|
1772
|
+
case "boolean":
|
|
1773
|
+
return row.value === "true";
|
|
1774
|
+
case "json": {
|
|
1775
|
+
if (row.value.trim().length === 0) return null;
|
|
1776
|
+
try {
|
|
1777
|
+
return JSON.parse(row.value);
|
|
1778
|
+
} catch (e) {
|
|
1779
|
+
throw new Error(`'${row.key}' is not valid JSON: ${e.message}`);
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
}
|
|
1556
1784
|
|
|
1557
1785
|
// src/astrlabe/components/rules/types.ts
|
|
1558
1786
|
var RULE_STATUS_OPTIONS = ["draft", "active", "archived"];
|
|
@@ -4609,6 +4837,7 @@ exports.RuleConditionBuilder = RuleConditionBuilder;
|
|
|
4609
4837
|
exports.RuleForm = RuleForm;
|
|
4610
4838
|
exports.RunInputDialog = RunInputDialog;
|
|
4611
4839
|
exports.RunPanel = RunPanel;
|
|
4840
|
+
exports.RunReplayModal = RunReplayModal;
|
|
4612
4841
|
exports.SaveStatusBadge = SaveStatusBadge;
|
|
4613
4842
|
exports.SubworkflowModal = SubworkflowModal;
|
|
4614
4843
|
exports.TIMEZONE_OPTIONS = TIMEZONE_OPTIONS;
|