@oomol-lab/open-flow 0.1.0-beta.80 → 0.1.0-beta.81
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/browser/{flowChanges-pFjPHU5k.js → flowChanges-CFj5pL4Y.js} +137 -8
- package/dist/browser/{flowWorkspace-CRlqc403.js → flowWorkspace-BeQaeJ3e.js} +6 -122
- package/dist/browser/preview.js +141 -128
- package/dist/browser/workbench.js +24 -8
- package/dist/command/index.js +3 -3
- package/dist/common/control-requests.js +19 -3
- package/dist/common/flow-authoring.js +19 -3
- package/dist/common/flow-semantics.js +24 -7
- package/package.json +1 -1
- package/src/connector/common/actionContract.ts +26 -0
- package/src/flow/common/edgeChanges.ts +9 -6
- package/src/flow/common/semantics.ts +11 -8
package/dist/browser/preview.js
CHANGED
|
@@ -99680,6 +99680,135 @@ function ConditionBranchesEditor({ value: configuration, disabled, readOnly, onC
|
|
|
99680
99680
|
});
|
|
99681
99681
|
}
|
|
99682
99682
|
//#endregion
|
|
99683
|
+
//#region src/workbench/browser/runtime/editor/leinaBotSelect.tsx
|
|
99684
|
+
function LeinaBotSelect({ source, flowId, value, disabled, onChange }) {
|
|
99685
|
+
const t = useTranslate();
|
|
99686
|
+
const [attempt, setAttempt] = useState(0);
|
|
99687
|
+
const [state, setState] = useState();
|
|
99688
|
+
useEffect(() => {
|
|
99689
|
+
const controller = new AbortController();
|
|
99690
|
+
setState((previous) => ({
|
|
99691
|
+
flowId,
|
|
99692
|
+
source,
|
|
99693
|
+
loading: true,
|
|
99694
|
+
bots: previous?.flowId == flowId && previous.source == source ? previous.bots : void 0
|
|
99695
|
+
}));
|
|
99696
|
+
source.listLeinaBots(flowId, controller.signal).then((bots) => {
|
|
99697
|
+
if (!controller.signal.aborted) setState({
|
|
99698
|
+
flowId,
|
|
99699
|
+
source,
|
|
99700
|
+
bots,
|
|
99701
|
+
loading: false
|
|
99702
|
+
});
|
|
99703
|
+
}, (error) => {
|
|
99704
|
+
if (!controller.signal.aborted) setState((previous) => ({
|
|
99705
|
+
flowId,
|
|
99706
|
+
source,
|
|
99707
|
+
bots: previous?.flowId == flowId && previous.source == source ? previous.bots : void 0,
|
|
99708
|
+
loading: false,
|
|
99709
|
+
error: error instanceof Error ? error.message : t("contextPanel.loadFailed")
|
|
99710
|
+
}));
|
|
99711
|
+
});
|
|
99712
|
+
return () => controller.abort();
|
|
99713
|
+
}, [
|
|
99714
|
+
source,
|
|
99715
|
+
flowId,
|
|
99716
|
+
attempt,
|
|
99717
|
+
t
|
|
99718
|
+
]);
|
|
99719
|
+
const current = state?.flowId == flowId && state.source == source ? state : void 0;
|
|
99720
|
+
const bots = current?.bots;
|
|
99721
|
+
const selected = typeof value == "string" && value.trim().length > 0 ? value : void 0;
|
|
99722
|
+
const missing = selected != null && bots != null && !bots.some((bot) => bot.leinaId == selected);
|
|
99723
|
+
const error = selected == null ? t("leina.select") : missing ? t("leina.unavailable", { id: selected }) : void 0;
|
|
99724
|
+
const selectedLabel = bots?.find((bot) => bot.leinaId == selected)?.name ?? (missing ? t("leina.unavailable", { id: selected }) : current?.error != null ? t("leina.loadFailed") : t("leina.loading"));
|
|
99725
|
+
const items = [...(bots ?? []).map((bot) => ({
|
|
99726
|
+
value: bot.leinaId,
|
|
99727
|
+
label: bot.name
|
|
99728
|
+
})), ...selected != null && !bots?.some((bot) => bot.leinaId == selected) ? [{
|
|
99729
|
+
value: selected,
|
|
99730
|
+
label: selectedLabel
|
|
99731
|
+
}] : []];
|
|
99732
|
+
return /* @__PURE__ */ jsx(ValueEditorFeedback, {
|
|
99733
|
+
error,
|
|
99734
|
+
children: (errorId) => /* @__PURE__ */ jsxs(Select$1, {
|
|
99735
|
+
items,
|
|
99736
|
+
value: selected ?? null,
|
|
99737
|
+
disabled,
|
|
99738
|
+
onOpenChange: (open) => {
|
|
99739
|
+
if (open) setAttempt((previous) => previous + 1);
|
|
99740
|
+
},
|
|
99741
|
+
onValueChange: (next) => {
|
|
99742
|
+
if (typeof next == "string" && bots?.some((bot) => bot.leinaId == next)) onChange(next);
|
|
99743
|
+
},
|
|
99744
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
99745
|
+
size: "field",
|
|
99746
|
+
className: "w-full",
|
|
99747
|
+
"data-field-control": true,
|
|
99748
|
+
"aria-label": t("leina.robot"),
|
|
99749
|
+
"aria-invalid": error != null || void 0,
|
|
99750
|
+
"aria-describedby": errorId,
|
|
99751
|
+
children: /* @__PURE__ */ jsx(SelectValue, {
|
|
99752
|
+
placeholder: t("leina.select"),
|
|
99753
|
+
children: selected == null ? void 0 : selectedLabel
|
|
99754
|
+
})
|
|
99755
|
+
}), /* @__PURE__ */ jsxs(SelectContent, {
|
|
99756
|
+
align: "start",
|
|
99757
|
+
alignItemWithTrigger: false,
|
|
99758
|
+
className: selectionMenuContentClass,
|
|
99759
|
+
children: [
|
|
99760
|
+
(current?.loading ?? true) && /* @__PURE__ */ jsx("span", {
|
|
99761
|
+
role: "status",
|
|
99762
|
+
className: "block px-1.5 py-1 text-xs leading-5 text-muted-foreground",
|
|
99763
|
+
children: t("leina.loading")
|
|
99764
|
+
}),
|
|
99765
|
+
bots?.map((bot) => /* @__PURE__ */ jsx(SelectItem, {
|
|
99766
|
+
value: bot.leinaId,
|
|
99767
|
+
className: selectionMenuItemClass,
|
|
99768
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
99769
|
+
className: "truncate",
|
|
99770
|
+
children: bot.name
|
|
99771
|
+
})
|
|
99772
|
+
}, bot.leinaId)),
|
|
99773
|
+
missing && selected != null && /* @__PURE__ */ jsx(SelectItem, {
|
|
99774
|
+
value: selected,
|
|
99775
|
+
disabled: true,
|
|
99776
|
+
className: `mt-1 first-of-type:mt-0 min-h-7 rounded-[var(--ui-control-radius,var(--ui-radius))] py-1 text-xs leading-5 font-normal text-destructive`,
|
|
99777
|
+
children: t("leina.unavailable", { id: selected })
|
|
99778
|
+
}),
|
|
99779
|
+
current?.error != null && /* @__PURE__ */ jsxs("span", {
|
|
99780
|
+
role: "alert",
|
|
99781
|
+
className: "block px-1.5 py-1 text-xs leading-5 whitespace-normal break-words text-destructive",
|
|
99782
|
+
children: [
|
|
99783
|
+
t("leina.loadFailed"),
|
|
99784
|
+
" ",
|
|
99785
|
+
current.error
|
|
99786
|
+
]
|
|
99787
|
+
}),
|
|
99788
|
+
bots?.length == 0 && !current?.loading && /* @__PURE__ */ jsx("span", {
|
|
99789
|
+
className: "block px-1.5 py-1 text-xs leading-5 whitespace-normal text-muted-foreground",
|
|
99790
|
+
children: t("leina.empty")
|
|
99791
|
+
})
|
|
99792
|
+
]
|
|
99793
|
+
})]
|
|
99794
|
+
})
|
|
99795
|
+
});
|
|
99796
|
+
}
|
|
99797
|
+
//#endregion
|
|
99798
|
+
//#region src/workbench/browser/runtime/editor/connectorActionPresentation.tsx
|
|
99799
|
+
function connectorActionPresentation(actionId, t) {
|
|
99800
|
+
if (actionId != "leina.send_notification") return void 0;
|
|
99801
|
+
return {
|
|
99802
|
+
name: t("leina.notification"),
|
|
99803
|
+
fieldLabels: {
|
|
99804
|
+
leinaId: t("leina.robot"),
|
|
99805
|
+
message: t("leina.message"),
|
|
99806
|
+
subscription: t("leina.subscription")
|
|
99807
|
+
},
|
|
99808
|
+
renderInput: ({ handle, ...props }) => handle == "leinaId" ? /* @__PURE__ */ jsx(LeinaBotSelect, { ...props }, props.flowId) : void 0
|
|
99809
|
+
};
|
|
99810
|
+
}
|
|
99811
|
+
//#endregion
|
|
99683
99812
|
//#region src/workbench/browser/runtime/editor/connectorInputPresentation.ts
|
|
99684
99813
|
/** Groups Provider inputs for display without changing their saved definitions. */
|
|
99685
99814
|
function presentConnectorInputs(inputs, t) {
|
|
@@ -103054,7 +103183,7 @@ var resources = {
|
|
|
103054
103183
|
},
|
|
103055
103184
|
leina: {
|
|
103056
103185
|
"notification": "Leina notification",
|
|
103057
|
-
"
|
|
103186
|
+
"subscription": "Notification subscription",
|
|
103058
103187
|
"message": "Notification content",
|
|
103059
103188
|
"loading": "Loading robots…",
|
|
103060
103189
|
"robot": "Robot",
|
|
@@ -104423,7 +104552,7 @@ var resources = {
|
|
|
104423
104552
|
},
|
|
104424
104553
|
leina: {
|
|
104425
104554
|
"notification": "Leina 通知",
|
|
104426
|
-
"
|
|
104555
|
+
"subscription": "通知订阅",
|
|
104427
104556
|
"message": "通知内容",
|
|
104428
104557
|
"loading": "正在加载机器人…",
|
|
104429
104558
|
"robot": "机器人",
|
|
@@ -105792,7 +105921,7 @@ var resources = {
|
|
|
105792
105921
|
},
|
|
105793
105922
|
leina: {
|
|
105794
105923
|
"notification": "Leina 通知",
|
|
105795
|
-
"
|
|
105924
|
+
"subscription": "通知訂閱",
|
|
105796
105925
|
"message": "通知內容",
|
|
105797
105926
|
"loading": "正在載入機器人…",
|
|
105798
105927
|
"robot": "機器人",
|
|
@@ -107161,7 +107290,7 @@ var resources = {
|
|
|
107161
107290
|
},
|
|
107162
107291
|
leina: {
|
|
107163
107292
|
"notification": "Leina 通知",
|
|
107164
|
-
"
|
|
107293
|
+
"subscription": "通知サブスクリプション",
|
|
107165
107294
|
"message": "通知内容",
|
|
107166
107295
|
"loading": "ロボットを読み込み中…",
|
|
107167
107296
|
"robot": "ロボット",
|
|
@@ -108530,7 +108659,7 @@ var resources = {
|
|
|
108530
108659
|
},
|
|
108531
108660
|
leina: {
|
|
108532
108661
|
"notification": "Leina 알림",
|
|
108533
|
-
"
|
|
108662
|
+
"subscription": "알림 구독",
|
|
108534
108663
|
"message": "알림 내용",
|
|
108535
108664
|
"loading": "로봇 불러오는 중…",
|
|
108536
108665
|
"robot": "로봇",
|
|
@@ -109899,7 +110028,7 @@ var resources = {
|
|
|
109899
110028
|
},
|
|
109900
110029
|
leina: {
|
|
109901
110030
|
"notification": "Уведомление Leina",
|
|
109902
|
-
"
|
|
110031
|
+
"subscription": "Подписка на уведомления",
|
|
109903
110032
|
"message": "Текст уведомления",
|
|
109904
110033
|
"loading": "Загрузка роботов…",
|
|
109905
110034
|
"robot": "Робот",
|
|
@@ -111268,7 +111397,7 @@ var resources = {
|
|
|
111268
111397
|
},
|
|
111269
111398
|
leina: {
|
|
111270
111399
|
"notification": "Notification Leina",
|
|
111271
|
-
"
|
|
111400
|
+
"subscription": "Abonnement aux notifications",
|
|
111272
111401
|
"message": "Contenu de la notification",
|
|
111273
111402
|
"loading": "Chargement des robots…",
|
|
111274
111403
|
"robot": "Robot",
|
|
@@ -114515,121 +114644,6 @@ function HttpRequestSection({ task, disabled, onSave, parameters, input }) {
|
|
|
114515
114644
|
] });
|
|
114516
114645
|
}
|
|
114517
114646
|
//#endregion
|
|
114518
|
-
//#region src/workbench/browser/runtime/editor/leinaBotSelect.tsx
|
|
114519
|
-
function LeinaBotSelect({ source, flowId, value, disabled, onChange }) {
|
|
114520
|
-
const t = useTranslate();
|
|
114521
|
-
const [attempt, setAttempt] = useState(0);
|
|
114522
|
-
const [state, setState] = useState();
|
|
114523
|
-
useEffect(() => {
|
|
114524
|
-
const controller = new AbortController();
|
|
114525
|
-
setState((previous) => ({
|
|
114526
|
-
flowId,
|
|
114527
|
-
source,
|
|
114528
|
-
loading: true,
|
|
114529
|
-
bots: previous?.flowId == flowId && previous.source == source ? previous.bots : void 0
|
|
114530
|
-
}));
|
|
114531
|
-
source.listLeinaBots(flowId, controller.signal).then((bots) => {
|
|
114532
|
-
if (!controller.signal.aborted) setState({
|
|
114533
|
-
flowId,
|
|
114534
|
-
source,
|
|
114535
|
-
bots,
|
|
114536
|
-
loading: false
|
|
114537
|
-
});
|
|
114538
|
-
}, (error) => {
|
|
114539
|
-
if (!controller.signal.aborted) setState((previous) => ({
|
|
114540
|
-
flowId,
|
|
114541
|
-
source,
|
|
114542
|
-
bots: previous?.flowId == flowId && previous.source == source ? previous.bots : void 0,
|
|
114543
|
-
loading: false,
|
|
114544
|
-
error: error instanceof Error ? error.message : t("contextPanel.loadFailed")
|
|
114545
|
-
}));
|
|
114546
|
-
});
|
|
114547
|
-
return () => controller.abort();
|
|
114548
|
-
}, [
|
|
114549
|
-
source,
|
|
114550
|
-
flowId,
|
|
114551
|
-
attempt,
|
|
114552
|
-
t
|
|
114553
|
-
]);
|
|
114554
|
-
const current = state?.flowId == flowId && state.source == source ? state : void 0;
|
|
114555
|
-
const bots = current?.bots;
|
|
114556
|
-
const selected = typeof value == "string" && value.trim().length > 0 ? value : void 0;
|
|
114557
|
-
const missing = selected != null && bots != null && !bots.some((bot) => bot.leinaId == selected);
|
|
114558
|
-
const error = selected == null ? t("leina.select") : missing ? t("leina.unavailable", { id: selected }) : void 0;
|
|
114559
|
-
const selectedLabel = bots?.find((bot) => bot.leinaId == selected)?.name ?? (missing ? t("leina.unavailable", { id: selected }) : current?.error != null ? t("leina.loadFailed") : t("leina.loading"));
|
|
114560
|
-
const items = [...(bots ?? []).map((bot) => ({
|
|
114561
|
-
value: bot.leinaId,
|
|
114562
|
-
label: bot.name
|
|
114563
|
-
})), ...selected != null && !bots?.some((bot) => bot.leinaId == selected) ? [{
|
|
114564
|
-
value: selected,
|
|
114565
|
-
label: selectedLabel
|
|
114566
|
-
}] : []];
|
|
114567
|
-
return /* @__PURE__ */ jsx(ValueEditorFeedback, {
|
|
114568
|
-
error,
|
|
114569
|
-
children: (errorId) => /* @__PURE__ */ jsxs(Select$1, {
|
|
114570
|
-
items,
|
|
114571
|
-
value: selected ?? null,
|
|
114572
|
-
disabled,
|
|
114573
|
-
onOpenChange: (open) => {
|
|
114574
|
-
if (open) setAttempt((previous) => previous + 1);
|
|
114575
|
-
},
|
|
114576
|
-
onValueChange: (next) => {
|
|
114577
|
-
if (typeof next == "string" && bots?.some((bot) => bot.leinaId == next)) onChange(next);
|
|
114578
|
-
},
|
|
114579
|
-
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
114580
|
-
size: "field",
|
|
114581
|
-
className: "w-full",
|
|
114582
|
-
"data-field-control": true,
|
|
114583
|
-
"aria-label": t("leina.robot"),
|
|
114584
|
-
"aria-invalid": error != null || void 0,
|
|
114585
|
-
"aria-describedby": errorId,
|
|
114586
|
-
children: /* @__PURE__ */ jsx(SelectValue, {
|
|
114587
|
-
placeholder: t("leina.select"),
|
|
114588
|
-
children: selected == null ? void 0 : selectedLabel
|
|
114589
|
-
})
|
|
114590
|
-
}), /* @__PURE__ */ jsxs(SelectContent, {
|
|
114591
|
-
align: "start",
|
|
114592
|
-
alignItemWithTrigger: false,
|
|
114593
|
-
className: selectionMenuContentClass,
|
|
114594
|
-
children: [
|
|
114595
|
-
(current?.loading ?? true) && /* @__PURE__ */ jsx("span", {
|
|
114596
|
-
role: "status",
|
|
114597
|
-
className: "block px-1.5 py-1 text-xs leading-5 text-muted-foreground",
|
|
114598
|
-
children: t("leina.loading")
|
|
114599
|
-
}),
|
|
114600
|
-
bots?.map((bot) => /* @__PURE__ */ jsx(SelectItem, {
|
|
114601
|
-
value: bot.leinaId,
|
|
114602
|
-
className: selectionMenuItemClass,
|
|
114603
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
114604
|
-
className: "truncate",
|
|
114605
|
-
children: bot.name
|
|
114606
|
-
})
|
|
114607
|
-
}, bot.leinaId)),
|
|
114608
|
-
missing && selected != null && /* @__PURE__ */ jsx(SelectItem, {
|
|
114609
|
-
value: selected,
|
|
114610
|
-
disabled: true,
|
|
114611
|
-
className: `mt-1 first-of-type:mt-0 min-h-7 rounded-[var(--ui-control-radius,var(--ui-radius))] py-1 text-xs leading-5 font-normal text-destructive`,
|
|
114612
|
-
children: t("leina.unavailable", { id: selected })
|
|
114613
|
-
}),
|
|
114614
|
-
current?.error != null && /* @__PURE__ */ jsxs("span", {
|
|
114615
|
-
role: "alert",
|
|
114616
|
-
className: "block px-1.5 py-1 text-xs leading-5 whitespace-normal break-words text-destructive",
|
|
114617
|
-
children: [
|
|
114618
|
-
t("leina.loadFailed"),
|
|
114619
|
-
" ",
|
|
114620
|
-
current.error
|
|
114621
|
-
]
|
|
114622
|
-
}),
|
|
114623
|
-
bots?.length == 0 && !current?.loading && /* @__PURE__ */ jsx("span", {
|
|
114624
|
-
className: "block px-1.5 py-1 text-xs leading-5 whitespace-normal text-muted-foreground",
|
|
114625
|
-
children: t("leina.empty")
|
|
114626
|
-
})
|
|
114627
|
-
]
|
|
114628
|
-
})]
|
|
114629
|
-
})
|
|
114630
|
-
});
|
|
114631
|
-
}
|
|
114632
|
-
//#endregion
|
|
114633
114647
|
//#region src/workbench/browser/runtime/editor/useTriggerConfigOptions.ts
|
|
114634
114648
|
function useTriggerConfigOptions(store, nodeId, field, scope, enabled) {
|
|
114635
114649
|
const [attempt, setAttempt] = useState(0);
|
|
@@ -117305,6 +117319,7 @@ function NodeInspector({ onAddWorkflowOutputs, onAddResponseNode, webhookDeploym
|
|
|
117305
117319
|
const unconfiguredOpenApi = task != null && "executor" in task && task.executor.kind == "openapi" && !task.executor.path;
|
|
117306
117320
|
const isLlm = task != null && "executor" in task && task.executor.kind == "llm";
|
|
117307
117321
|
const connector = task != null && "executor" in task && task.executor.kind == "connector" ? task.executor : void 0;
|
|
117322
|
+
const connectorPresentation = connector == null ? void 0 : connectorActionPresentation(connector.action, t);
|
|
117308
117323
|
const nodeId = selection?.kind == "task" ? selection.id : void 0;
|
|
117309
117324
|
const workflowSettings = task != null && "executor" in task && task.executor.kind == "workflow" && selection != null ? {
|
|
117310
117325
|
task,
|
|
@@ -117719,7 +117734,8 @@ function NodeInspector({ onAddWorkflowOutputs, onAddResponseNode, webhookDeploym
|
|
|
117719
117734
|
return {
|
|
117720
117735
|
definition,
|
|
117721
117736
|
sourceOnly: isHttpRequest && definition.handle.startsWith("auth."),
|
|
117722
|
-
editor: !readOnly && connectors != null &&
|
|
117737
|
+
editor: !readOnly && connectors != null && mapping?.kind != "sources" ? connectorPresentation?.renderInput({
|
|
117738
|
+
handle: definition.handle,
|
|
117723
117739
|
source: connectors,
|
|
117724
117740
|
flowId: revision.revision.flowId,
|
|
117725
117741
|
value: inputValue(mapping, definition.value),
|
|
@@ -117727,7 +117743,7 @@ function NodeInspector({ onAddWorkflowOutputs, onAddResponseNode, webhookDeploym
|
|
|
117727
117743
|
onChange: (value) => {
|
|
117728
117744
|
store?.nodes.setInputValue(selection.id, definition.handle, value);
|
|
117729
117745
|
}
|
|
117730
|
-
}
|
|
117746
|
+
}) : void 0,
|
|
117731
117747
|
value: inputValue(mapping, definition.value),
|
|
117732
117748
|
onReset: definition.value !== void 0 && mapping != null ? () => void store?.nodes.resetInputs(selection.id, [definition.handle]) : void 0,
|
|
117733
117749
|
connected: mapping?.kind === "sources" && binding?.kind !== "variable",
|
|
@@ -117740,10 +117756,7 @@ function NodeInspector({ onAddWorkflowOutputs, onAddResponseNode, webhookDeploym
|
|
|
117740
117756
|
title: t(selection.kind === "outputs" ? "inspector.ports.outputsTitle" : "inspector.ports.inputsTitle"),
|
|
117741
117757
|
titleIcon: selection.kind === "outputs" ? "output" : "input",
|
|
117742
117758
|
entries,
|
|
117743
|
-
fieldLabels:
|
|
117744
|
-
leinaId: t("leina.robot"),
|
|
117745
|
-
message: t("leina.message")
|
|
117746
|
-
} : void 0,
|
|
117759
|
+
fieldLabels: connectorPresentation?.fieldLabels,
|
|
117747
117760
|
onReset: () => {
|
|
117748
117761
|
return store?.nodes.resetInputs(selection.id, entries.flatMap((entry) => "group" in entry ? [] : [entry.definition.handle]));
|
|
117749
117762
|
},
|
|
@@ -3,7 +3,7 @@ import { a as derive, i as compute, l as val } from "./dist-bO8nvHFH.js";
|
|
|
3
3
|
import { c as useLang, l as useTranslate, o as I18nProvider, u as useVal } from "./dist-BFmpkX4P.js";
|
|
4
4
|
import { Cr as cn, i as TooltipTrigger, n as TooltipContent, t as Tooltip, xr as Button } from "./tooltip-BDcVTNpu.js";
|
|
5
5
|
import { C as upgradeManualTrigger, M as mapConditionSources, N as nodeInputMappings, Rt as dequal, S as resourceNameIssue, _ as applyFlowChanges, a as DialogFooter, d as Field, g as FlowChangeError, h as FieldLabel, i as DialogDescription, in as Input, l as Icon, m as FieldGroup, o as DialogHeader, p as FieldError, r as DialogContent, s as DialogTitle, t as Dialog, u as Spinner, v as isTriggerNode, w as upgradeRevisionContent } from "./dialog-CFlvkliO.js";
|
|
6
|
-
import { $ as
|
|
6
|
+
import { $ as resourceValue, $t as IdTooltip, An as EmptyDescription, Ar as controlErrorCode, At as actionWithConnections, Bt as setNodeContentHidden, C as updateValue, Cn as useFlowQuery, Cr as workflowCandidate, Ct as flowResourceReferences, Dn as InputGroupInput, Dr as invalidResponse, En as InputGroupAddon, Et as diagnosticItems, Fn as EventSourcesPage, Ft as removeComments, Gn as allConnectorConnectionsQuery, Gt as setCodeActions, Hn as WorkbenchClient, Ht as setVerticalNodeWidth, It as restoreCanvasPresentation, J as scopedValue, Jt as setServiceConnections, K as combineSources, Kt as setConnectorConnection, Lt as setCanvasLayout, Mn as EmptyMedia, Mt as canvasPresentationChange, Nn as EmptyTitle, Nt as commentIds, On as Empty, Or as record, Pn as Badge, Pt as flowPresentation, Q as resourceData, Qt as WorkflowExportMenuItem, Rn as createI18n, Rt as setComment, S as updateTriggerConfig, St as revisionView, Tn as InputGroup, Tt as deriveInspectorDiagnostics, U as addNodeIntent, Un as normalizeFlowQuery, Ut as repairNodeNames, Vn as errorNotice, Vt as setNodePositions, W as deriveAddNodeOptions, Wn as randomId, Wt as resetInputValues, X as CacheResource, Xt as updateTriggerSchedule, Y as connectorActionPresentation, Yt as updateStartInputDefs, Zt as dequal$1, _ as updateOutputPorts, a as nameCreatedNodes, ar as connectorActionMetadata, at as getActionsCache, b as updateTaskAdditionalInputs, c as setInputVariable, cr as workflowFileName, ct as getProvidersCache, d as updateCondition, er as normalizeTriggerOutputs, et as action, f as updateHttpParameters, ft as designerGraph, g as updateNodeSettings, h as updateNodeName, i as deleteSelection, ir as connection, jn as EmptyHeader, jt as connectionCatalog, kn as EmptyContent, kr as ApiError, l as setTriggerConnection, lr as workflowNameFromFile, lt as createPersistentCache, m as updateNodeIcon, nn as FlowTagChips, nr as triggerOutputDefinitions, nt as proxyResponse, o as selectWebhookResponse, or as encodeWorkflowFile, p as updateNodeDescription, qn as decodeTriggerCatalog, qt as setInputSources, r as applyFlowChanges$1, rn as TagPicker, rt as validateAction, s as setInputValue, sr as parseWorkflowFile, st as getConnectionsCache, t as addNode, tn as FlowSettingsDialog, tr as sampleErrorOutputs, tt as provider, u as setTriggerEventSource, ut as createSessionCache, v as updateResolution, vt as providerIcon, w as updateWebhook, wn as followWorkbenchLink, wt as Latest, x as updateTaskPorts, y as updateTask, yt as RunStore, zt as setFlowViewport } from "./flowChanges-CFj5pL4Y.js";
|
|
7
7
|
import { a as uiLanguages, i as uiLanguageNames, n as isUiLanguage, r as resolveUiLanguage, t as importedWorkflowName } from "./languages-gYzoQqCi.js";
|
|
8
8
|
import { i as objectValue, n as isJsonValue } from "./value-BbFQZZ_V.js";
|
|
9
9
|
import { Suspense, forwardRef, lazy, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
|
|
@@ -1274,6 +1274,21 @@ var customRandom = (alphabet, defaultSize, getRandom) => {
|
|
|
1274
1274
|
};
|
|
1275
1275
|
var customAlphabet = (alphabet, size = 21) => customRandom(alphabet, size | 0, random);
|
|
1276
1276
|
//#endregion
|
|
1277
|
+
//#region src/connector/common/actionContract.ts
|
|
1278
|
+
/** These rules also apply to existing Revision snapshots without a catalog lookup. */
|
|
1279
|
+
var connectorActionContracts = { "leina.send_notification": {
|
|
1280
|
+
inputConstraints: [{
|
|
1281
|
+
handle: "leinaId",
|
|
1282
|
+
jsonSchema: {
|
|
1283
|
+
type: "string",
|
|
1284
|
+
pattern: "\\S"
|
|
1285
|
+
},
|
|
1286
|
+
code: "leina.robot-required",
|
|
1287
|
+
message: "Select a Leina robot or bind its identifier to an input source."
|
|
1288
|
+
}],
|
|
1289
|
+
pendingMessageInput: "message"
|
|
1290
|
+
} };
|
|
1291
|
+
//#endregion
|
|
1277
1292
|
//#region src/flow/common/edgeChanges.ts
|
|
1278
1293
|
function connect(content, edge) {
|
|
1279
1294
|
const selected = content.document.graph;
|
|
@@ -1284,11 +1299,12 @@ function connect(content, edge) {
|
|
|
1284
1299
|
}];
|
|
1285
1300
|
const source = selected.nodes[edge.source];
|
|
1286
1301
|
const target = selected.nodes[edge.target];
|
|
1287
|
-
|
|
1302
|
+
const messageInput = target?.kind == "task" && "executor" in target.task && target.task.executor.kind == "connector" ? connectorActionContracts[target.task.executor.action]?.pendingMessageInput : void 0;
|
|
1303
|
+
if (edge.sourceHandle == "pending" && (source?.kind == "approval" || source?.kind == "wait") && target?.kind == "task" && messageInput != null && (target.inputs[messageInput] == null || target.inputs[messageInput]?.kind == "unset")) changes.push({
|
|
1288
1304
|
kind: "graph.node.input.set",
|
|
1289
1305
|
nodeId: edge.target,
|
|
1290
|
-
handle:
|
|
1291
|
-
before: target.inputs
|
|
1306
|
+
handle: messageInput,
|
|
1307
|
+
before: target.inputs[messageInput],
|
|
1292
1308
|
value: {
|
|
1293
1309
|
kind: "sources",
|
|
1294
1310
|
sources: [{
|
|
@@ -3113,10 +3129,10 @@ function ports(values) {
|
|
|
3113
3129
|
}));
|
|
3114
3130
|
}
|
|
3115
3131
|
function option$1(action, t) {
|
|
3116
|
-
|
|
3132
|
+
const presentation = connectorActionPresentation(action.actionId, t);
|
|
3133
|
+
if (presentation != null) action = {
|
|
3117
3134
|
...action,
|
|
3118
|
-
name:
|
|
3119
|
-
description: t("leina.description")
|
|
3135
|
+
name: presentation.name
|
|
3120
3136
|
};
|
|
3121
3137
|
return {
|
|
3122
3138
|
connector: action,
|
|
@@ -7078,7 +7094,7 @@ var WorkbenchStore = class {
|
|
|
7078
7094
|
};
|
|
7079
7095
|
//#endregion
|
|
7080
7096
|
//#region src/workbench/browser/runtime/openFlowWorkbench.tsx
|
|
7081
|
-
var FlowWorkspace = lazy(() => import("./flowWorkspace-
|
|
7097
|
+
var FlowWorkspace = lazy(() => import("./flowWorkspace-BeQaeJ3e.js"));
|
|
7082
7098
|
function OpenFlowSessionGate({ action, description, error, onSubmit, onTokenChange, pending = false, title, token, tokenLabel }) {
|
|
7083
7099
|
const hasToken = token != null && tokenLabel != null && onTokenChange != null;
|
|
7084
7100
|
const tokenValue = token ?? "";
|