@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
|
@@ -7186,7 +7186,7 @@ var resources = {
|
|
|
7186
7186
|
},
|
|
7187
7187
|
leina: {
|
|
7188
7188
|
"notification": "Leina notification",
|
|
7189
|
-
"
|
|
7189
|
+
"subscription": "Notification subscription",
|
|
7190
7190
|
"message": "Notification content",
|
|
7191
7191
|
"loading": "Loading robots…",
|
|
7192
7192
|
"robot": "Robot",
|
|
@@ -8555,7 +8555,7 @@ var resources = {
|
|
|
8555
8555
|
},
|
|
8556
8556
|
leina: {
|
|
8557
8557
|
"notification": "Leina 通知",
|
|
8558
|
-
"
|
|
8558
|
+
"subscription": "通知订阅",
|
|
8559
8559
|
"message": "通知内容",
|
|
8560
8560
|
"loading": "正在加载机器人…",
|
|
8561
8561
|
"robot": "机器人",
|
|
@@ -9924,7 +9924,7 @@ var resources = {
|
|
|
9924
9924
|
},
|
|
9925
9925
|
leina: {
|
|
9926
9926
|
"notification": "Leina 通知",
|
|
9927
|
-
"
|
|
9927
|
+
"subscription": "通知訂閱",
|
|
9928
9928
|
"message": "通知內容",
|
|
9929
9929
|
"loading": "正在載入機器人…",
|
|
9930
9930
|
"robot": "機器人",
|
|
@@ -11293,7 +11293,7 @@ var resources = {
|
|
|
11293
11293
|
},
|
|
11294
11294
|
leina: {
|
|
11295
11295
|
"notification": "Leina 通知",
|
|
11296
|
-
"
|
|
11296
|
+
"subscription": "通知サブスクリプション",
|
|
11297
11297
|
"message": "通知内容",
|
|
11298
11298
|
"loading": "ロボットを読み込み中…",
|
|
11299
11299
|
"robot": "ロボット",
|
|
@@ -12662,7 +12662,7 @@ var resources = {
|
|
|
12662
12662
|
},
|
|
12663
12663
|
leina: {
|
|
12664
12664
|
"notification": "Leina 알림",
|
|
12665
|
-
"
|
|
12665
|
+
"subscription": "알림 구독",
|
|
12666
12666
|
"message": "알림 내용",
|
|
12667
12667
|
"loading": "로봇 불러오는 중…",
|
|
12668
12668
|
"robot": "로봇",
|
|
@@ -14031,7 +14031,7 @@ var resources = {
|
|
|
14031
14031
|
},
|
|
14032
14032
|
leina: {
|
|
14033
14033
|
"notification": "Уведомление Leina",
|
|
14034
|
-
"
|
|
14034
|
+
"subscription": "Подписка на уведомления",
|
|
14035
14035
|
"message": "Текст уведомления",
|
|
14036
14036
|
"loading": "Загрузка роботов…",
|
|
14037
14037
|
"robot": "Робот",
|
|
@@ -15400,7 +15400,7 @@ var resources = {
|
|
|
15400
15400
|
},
|
|
15401
15401
|
leina: {
|
|
15402
15402
|
"notification": "Notification Leina",
|
|
15403
|
-
"
|
|
15403
|
+
"subscription": "Abonnement aux notifications",
|
|
15404
15404
|
"message": "Contenu de la notification",
|
|
15405
15405
|
"loading": "Chargement des robots…",
|
|
15406
15406
|
"robot": "Robot",
|
|
@@ -23627,6 +23627,135 @@ function observeResource(source, signal, update) {
|
|
|
23627
23627
|
publish();
|
|
23628
23628
|
}
|
|
23629
23629
|
//#endregion
|
|
23630
|
+
//#region src/workbench/browser/runtime/editor/leinaBotSelect.tsx
|
|
23631
|
+
function LeinaBotSelect({ source, flowId, value, disabled, onChange }) {
|
|
23632
|
+
const t = useTranslate();
|
|
23633
|
+
const [attempt, setAttempt] = useState(0);
|
|
23634
|
+
const [state, setState] = useState();
|
|
23635
|
+
useEffect(() => {
|
|
23636
|
+
const controller = new AbortController();
|
|
23637
|
+
setState((previous) => ({
|
|
23638
|
+
flowId,
|
|
23639
|
+
source,
|
|
23640
|
+
loading: true,
|
|
23641
|
+
bots: previous?.flowId == flowId && previous.source == source ? previous.bots : void 0
|
|
23642
|
+
}));
|
|
23643
|
+
source.listLeinaBots(flowId, controller.signal).then((bots) => {
|
|
23644
|
+
if (!controller.signal.aborted) setState({
|
|
23645
|
+
flowId,
|
|
23646
|
+
source,
|
|
23647
|
+
bots,
|
|
23648
|
+
loading: false
|
|
23649
|
+
});
|
|
23650
|
+
}, (error) => {
|
|
23651
|
+
if (!controller.signal.aborted) setState((previous) => ({
|
|
23652
|
+
flowId,
|
|
23653
|
+
source,
|
|
23654
|
+
bots: previous?.flowId == flowId && previous.source == source ? previous.bots : void 0,
|
|
23655
|
+
loading: false,
|
|
23656
|
+
error: error instanceof Error ? error.message : t("contextPanel.loadFailed")
|
|
23657
|
+
}));
|
|
23658
|
+
});
|
|
23659
|
+
return () => controller.abort();
|
|
23660
|
+
}, [
|
|
23661
|
+
source,
|
|
23662
|
+
flowId,
|
|
23663
|
+
attempt,
|
|
23664
|
+
t
|
|
23665
|
+
]);
|
|
23666
|
+
const current = state?.flowId == flowId && state.source == source ? state : void 0;
|
|
23667
|
+
const bots = current?.bots;
|
|
23668
|
+
const selected = typeof value == "string" && value.trim().length > 0 ? value : void 0;
|
|
23669
|
+
const missing = selected != null && bots != null && !bots.some((bot) => bot.leinaId == selected);
|
|
23670
|
+
const error = selected == null ? t("leina.select") : missing ? t("leina.unavailable", { id: selected }) : void 0;
|
|
23671
|
+
const selectedLabel = bots?.find((bot) => bot.leinaId == selected)?.name ?? (missing ? t("leina.unavailable", { id: selected }) : current?.error != null ? t("leina.loadFailed") : t("leina.loading"));
|
|
23672
|
+
const items = [...(bots ?? []).map((bot) => ({
|
|
23673
|
+
value: bot.leinaId,
|
|
23674
|
+
label: bot.name
|
|
23675
|
+
})), ...selected != null && !bots?.some((bot) => bot.leinaId == selected) ? [{
|
|
23676
|
+
value: selected,
|
|
23677
|
+
label: selectedLabel
|
|
23678
|
+
}] : []];
|
|
23679
|
+
return /* @__PURE__ */ jsx(ValueEditorFeedback, {
|
|
23680
|
+
error,
|
|
23681
|
+
children: (errorId) => /* @__PURE__ */ jsxs(Select, {
|
|
23682
|
+
items,
|
|
23683
|
+
value: selected ?? null,
|
|
23684
|
+
disabled,
|
|
23685
|
+
onOpenChange: (open) => {
|
|
23686
|
+
if (open) setAttempt((previous) => previous + 1);
|
|
23687
|
+
},
|
|
23688
|
+
onValueChange: (next) => {
|
|
23689
|
+
if (typeof next == "string" && bots?.some((bot) => bot.leinaId == next)) onChange(next);
|
|
23690
|
+
},
|
|
23691
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
23692
|
+
size: "field",
|
|
23693
|
+
className: "w-full",
|
|
23694
|
+
"data-field-control": true,
|
|
23695
|
+
"aria-label": t("leina.robot"),
|
|
23696
|
+
"aria-invalid": error != null || void 0,
|
|
23697
|
+
"aria-describedby": errorId,
|
|
23698
|
+
children: /* @__PURE__ */ jsx(SelectValue, {
|
|
23699
|
+
placeholder: t("leina.select"),
|
|
23700
|
+
children: selected == null ? void 0 : selectedLabel
|
|
23701
|
+
})
|
|
23702
|
+
}), /* @__PURE__ */ jsxs(SelectContent, {
|
|
23703
|
+
align: "start",
|
|
23704
|
+
alignItemWithTrigger: false,
|
|
23705
|
+
className: selectionMenuContentClass,
|
|
23706
|
+
children: [
|
|
23707
|
+
(current?.loading ?? true) && /* @__PURE__ */ jsx("span", {
|
|
23708
|
+
role: "status",
|
|
23709
|
+
className: "block px-1.5 py-1 text-xs leading-5 text-muted-foreground",
|
|
23710
|
+
children: t("leina.loading")
|
|
23711
|
+
}),
|
|
23712
|
+
bots?.map((bot) => /* @__PURE__ */ jsx(SelectItem, {
|
|
23713
|
+
value: bot.leinaId,
|
|
23714
|
+
className: selectionMenuItemClass,
|
|
23715
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
23716
|
+
className: "truncate",
|
|
23717
|
+
children: bot.name
|
|
23718
|
+
})
|
|
23719
|
+
}, bot.leinaId)),
|
|
23720
|
+
missing && selected != null && /* @__PURE__ */ jsx(SelectItem, {
|
|
23721
|
+
value: selected,
|
|
23722
|
+
disabled: true,
|
|
23723
|
+
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`,
|
|
23724
|
+
children: t("leina.unavailable", { id: selected })
|
|
23725
|
+
}),
|
|
23726
|
+
current?.error != null && /* @__PURE__ */ jsxs("span", {
|
|
23727
|
+
role: "alert",
|
|
23728
|
+
className: "block px-1.5 py-1 text-xs leading-5 whitespace-normal break-words text-destructive",
|
|
23729
|
+
children: [
|
|
23730
|
+
t("leina.loadFailed"),
|
|
23731
|
+
" ",
|
|
23732
|
+
current.error
|
|
23733
|
+
]
|
|
23734
|
+
}),
|
|
23735
|
+
bots?.length == 0 && !current?.loading && /* @__PURE__ */ jsx("span", {
|
|
23736
|
+
className: "block px-1.5 py-1 text-xs leading-5 whitespace-normal text-muted-foreground",
|
|
23737
|
+
children: t("leina.empty")
|
|
23738
|
+
})
|
|
23739
|
+
]
|
|
23740
|
+
})]
|
|
23741
|
+
})
|
|
23742
|
+
});
|
|
23743
|
+
}
|
|
23744
|
+
//#endregion
|
|
23745
|
+
//#region src/workbench/browser/runtime/editor/connectorActionPresentation.tsx
|
|
23746
|
+
function connectorActionPresentation(actionId, t) {
|
|
23747
|
+
if (actionId != "leina.send_notification") return void 0;
|
|
23748
|
+
return {
|
|
23749
|
+
name: t("leina.notification"),
|
|
23750
|
+
fieldLabels: {
|
|
23751
|
+
leinaId: t("leina.robot"),
|
|
23752
|
+
message: t("leina.message"),
|
|
23753
|
+
subscription: t("leina.subscription")
|
|
23754
|
+
},
|
|
23755
|
+
renderInput: ({ handle, ...props }) => handle == "leinaId" ? /* @__PURE__ */ jsx(LeinaBotSelect, { ...props }, props.flowId) : void 0
|
|
23756
|
+
};
|
|
23757
|
+
}
|
|
23758
|
+
//#endregion
|
|
23630
23759
|
//#region src/workbench/browser/runtime/stores/optionSource.ts
|
|
23631
23760
|
function mapSource(source, signal, map) {
|
|
23632
23761
|
if ("then" in source) return source.then((data) => data === void 0 ? void 0 : map(data));
|
|
@@ -25371,4 +25500,4 @@ function updateHttpParameters(revision, nodeId, group, edit, bindingId) {
|
|
|
25371
25500
|
return cleanVariableBindings(content, [...operations, ...binding]);
|
|
25372
25501
|
}
|
|
25373
25502
|
//#endregion
|
|
25374
|
-
export {
|
|
25503
|
+
export { resourceValue as $, sourcePort as $n, IdTooltip as $t, schemaForEditor as A, EmptyDescription as An, controlErrorCode as Ar, actionWithConnections as At, datePickerValue as B, EventSourceSetup as Bn, setNodeContentHidden as Bt, updateValue as C, useFlowQuery as Cn, workflowCandidate as Cr, flowResourceReferences as Ct, defaultValueEditorSchema as D, InputGroupInput as Dn, invalidResponse as Dr, diagnosticMessage as Dt, supportsFeishuChatFilter as E, InputGroupAddon as En, workflowSelectionTask as Er, diagnosticItems as Et, calendarChange as F, EventSourcesPage as Fn, removeComments as Ft, indexAddNodeOptions as G, allConnectorConnectionsQuery as Gn, setCodeActions as Gt, isDateFormat as H, WorkbenchClient as Hn, setVerticalNodeWidth as Ht, calendarDate as I, SourceForm as In, restoreCanvasPresentation as It, scopedValue as J, executionReachableNodes as Jn, setServiceConnections as Jt, combineSources as K, decodeResultList as Kn, setConnectorConnection as Kt, dateFromTimeZone as L, SourceSelect as Ln, setCanvasLayout as Lt, getDefaultValue as M, EmptyMedia as Mn, canvasPresentationChange as Mt, isUnconstrainedSchema as N, EmptyTitle as Nn, commentIds as Nt, editorComponent as O, Empty as On, record$2 as Or, diagnosticNodeId as Ot, typeOfSchema as P, Badge as Pn, flowPresentation as Pt, resourceData as Q, sourceOutputLabel as Qn, WorkflowExportMenuItem as Qt, dateInTimeZone as R, createI18n as Rn, setComment as Rt, updateTriggerConfig as S, useComboboxRootContext as Sn, workflowAgentTool as Sr, revisionView as St, feishuResourceKind as T, InputGroup as Tn, workflowCapability as Tr, deriveInspectorDiagnostics as Tt, addNodeIntent as U, normalizeFlowQuery as Un, repairNodeNames as Ut, dateTimeWall as V, errorNotice as Vn, setNodePositions as Vt, deriveAddNodeOptions as W, randomId as Wn, resetInputValues as Wt, CacheResource as X, resolutionOutputPorts as Xn, updateTriggerSchedule as Xt, connectorActionPresentation as Y, inputSourceCandidates as Yn, updateStartInputDefs as Yt, observeResource as Z, webhookResponseDiagnostics as Zn, dequal as Zt, updateOutputPorts as _, ComboboxInputGroup as _n, securityOptions as _r, actionSummary as _t, nameCreatedNodes as a, selectionMenuItemClass as an, connectorActionMetadata as ar, getActionsCache as at, updateTaskAdditionalInputs as b, selectors as bn, servers as br, canCancelRun as bt, setInputVariable as c, valueEditor_module_default as cn, workflowFileName as cr, getProvidersCache as ct, updateCondition as d, ComboboxPopup as dn, triggerConfigValues as dr, loadJson as dt, FlowSettingsButton as en, normalizeTriggerOutputs as er, action as et, updateHttpParameters as f, ComboboxPositioner as fn, inputValue as fr, designerGraph as ft, updateNodeSettings as g, ComboboxTrigger as gn, openApiTask as gr, triggerNodeIcon as gt, updateNodeName as h, GroupCollectionProvider as hn, openApiFieldIssues as hr, semanticNodeIcon as ht, deleteSelection as i, selectionMenuContentClass as in, connection as ir, decodeAppCatalogResponse as it, valueForEditor as j, EmptyHeader as jn, eventSourceKind as jr, connectionCatalog as jt, editorGroups as k, EmptyContent as kn, ApiError as kr, schemaMismatchMessage as kt, setTriggerConnection as l, ComboboxItemIndicator as ln, workflowNameFromFile as lr, createPersistentCache as lt, updateNodeIcon as m, ComboboxList as mn, object$1 as mr, nodeTitle as mt, agentTool as n, FlowTagChips as nn, triggerOutputDefinitions as nr, proxyResponse as nt, selectWebhookResponse as o, ValueControl as on, encodeWorkflowFile as or, getAppCatalogCache as ot, updateNodeDescription as p, ComboboxPortal as pn, listOperations as pr, nodeIcon as pt, mapSource as q, decodeTriggerCatalog as qn, setInputSources as qt, applyFlowChanges as r, TagPicker as rn, isJsonObject as rr, validateAction as rt, setInputValue as s, ValueEditorFeedback as sn, parseWorkflowFile as sr, getConnectionsCache as st, addNode as t, FlowSettingsDialog as tn, sampleErrorOutputs as tr, provider as tt, setTriggerEventSource as u, ComboboxItem as un, triggerConfigValue as ur, createSessionCache as ut, updateResolution as v, ComboboxInput as vn, selectOperation as vr, providerIcon as vt, updateWebhook as w, followWorkbenchLink as wn, workflowCandidateGroup as wr, Latest as wt, updateTaskPorts as x, useComboboxInputValueContext as xn, sameWorkflowInterface as xr, hasRunFilter as xt, updateTask as y, ComboboxRoot as yn, serverAddress as yr, RunStore as yt, datePickerChange as z, FeishuEventPicker as zn, setFlowViewport as zt };
|
|
@@ -5,7 +5,7 @@ import { c as useLang, l as useTranslate, o as I18nProvider, r as isPlainObject,
|
|
|
5
5
|
import { A as string, Bn as transitionStatusMapping, Cr as cn, Dr as EMPTY_ARRAY, En as contains, Er as useRenderElement, Fr as formatErrorMessage, I as useCompositeListItem, In as useTransitionStatus, Ir as mergeProps, Ln as useOpenChangeComplete, Lr as useIsoLayoutEffect, Mn as ownerDocument, Mr as useButton, Nn as useLabelableId, Or as EMPTY_OBJECT, Qt as useStore, Sr as buttonVariants, Tn as activeElement, Tr as clsx, Un as useValueChanged, Wn as createChangeEventDetails, _r as fieldValidityMapping, a as createTooltipHandle, br as useControlled, c as TooltipPositioner, ct as CompositeList, d as TooltipRoot, dr as useFormContext, fr as useRegisterFieldControl, i as TooltipTrigger, jr as useMergedRefs, l as TooltipPortal, lt as inertValue, mr as useBaseUiId, mt as triggerOpenStateMapping, n as TooltipContent, nn as require_builtin_esm_external_require_react, o as TooltipArrow, p as timeZoneOffsetMinutes, pr as useFieldRootContext, qn as clearPress, r as TooltipProvider, rr as none, s as TooltipPopup, t as Tooltip, u as TooltipTrigger$1, ur as useLabelableContext, vr as visuallyHidden, wr as cva, xr as Button$1, yr as visuallyHiddenInput, zn as TransitionStatusDataAttributes, zr as useStableCallback } from "./tooltip-BDcVTNpu.js";
|
|
6
6
|
import { $ as waitAutoContinueSchema, A as comparisonIssue, At as variableInputCompatible, Bt as SelectChevron, Ct as limitDecisionQuestions, D as nodeSystemOutputPorts, Dt as matchesSchema, E as nodeErrorSchema, F as operatorsForType, Gt as SelectTrigger, Ht as SelectGroup, It as skipDuplicatesConfigSchema, J as webhookResponseAllowsBody, K as webhookHeaderValuePort, Kt as SelectValue, L as unaryOperator, O as supportsNodeErrorHandling, Ot as portsAssignable, P as operandHandle, Q as workflowOutputsPort, R as valueType, Rt as dequal, St as defaultDecisionQuestion, T as workflowToolNameIssue, Tt as webhookSupportsBody, U as decodeRevisionContent, Ut as SelectItem, Vt as SelectContent, Wt as SelectSeparator, X as webhookResponseTimeout, Y as webhookResponseInputs, Z as webhookStatusCodePort, _t as isHttpHost, a as DialogFooter, an as ChevronDown, at as httpHeaderSchema, b as nodeNameIssue, bt as decisionQuestionIssues, c as DialogTrigger, d as Field, et as defaultNodeRetry, f as FieldDescription, h as FieldLabel, i as DialogDescription, in as Input, kt as schemaObject, l as Icon, lt as httpRequestIssues, m as FieldGroup, nt as retryConfigurationSchema, o as DialogHeader, ot as httpQuerySchema, p as FieldError, pt as httpHeaderNameIssue, q as webhookHeadersPort, r as DialogContent, rn as Label, rt as supportsNodeRetry, s as DialogTitle, t as Dialog, tt as nodeRetryLimits, u as Spinner, ut as httpRequestTask, vt as decisionLimits, wt as webhookMethods, xt as decisionTask, zt as Select$1 } from "./dialog-CFlvkliO.js";
|
|
7
7
|
import { C as toManifestHandleName, E as isSameViewport, S as toViewEdge, T as isMac, _ as timeZoneOffset, a as NodeHistoryContext, b as CanvasTooltip, c as defaultTriggerIcon, d as formatDuration, f as useDebouncedValue, g as timeZoneLongLabel, h as timeZoneLabel, i as setAddItemId, l as JSONViewer, m as selectableTimeZones, n as CompositeRoot, o as Textarea, p as IconStack, r as ACTIVE_COMPOSITE_ITEM, s as CanvasNodeIcon, t as FlowCanvas, u as collapseAllNested, v as cronDescription, w as toManifestNodeId, x as CanvasStore, y as E$1 } from "./FlowCanvas-CrsiDHK8.js";
|
|
8
|
-
import { $
|
|
8
|
+
import { $ as resourceValue, $n as sourcePort, $t as IdTooltip, A as schemaForEditor, An as EmptyDescription, Ar as controlErrorCode, B as datePickerValue, Bn as EventSourceSetup, D as defaultValueEditorSchema, Dn as InputGroupInput, Dt as diagnosticMessage, E as supportsFeishuChatFilter, En as InputGroupAddon, Er as workflowSelectionTask, F as calendarChange, G as indexAddNodeOptions, H as isDateFormat, I as calendarDate, In as SourceForm, Jn as executionReachableNodes, Kn as decodeResultList, L as dateFromTimeZone, Ln as SourceSelect, M as getDefaultValue, Mn as EmptyMedia, N as isUnconstrainedSchema, Nn as EmptyTitle, O as editorComponent, On as Empty, Ot as diagnosticNodeId, P as typeOfSchema, Pn as Badge, Q as resourceData, Qn as sourceOutputLabel, Qt as WorkflowExportMenuItem, R as dateInTimeZone, Rn as createI18n, Sn as useComboboxRootContext, Sr as workflowAgentTool, St as revisionView, T as feishuResourceKind, Tn as InputGroup, Tr as workflowCapability, V as dateTimeWall, Vn as errorNotice, Xn as resolutionOutputPorts, Y as connectorActionPresentation, Yn as inputSourceCandidates, Z as observeResource, Zn as webhookResponseDiagnostics, Zt as dequal$1, _n as ComboboxInputGroup, _r as securityOptions, _t as actionSummary, an as selectionMenuItemClass, bn as selectors, br as servers, bt as canCancelRun, cn as valueEditor_module_default, dn as ComboboxPopup, dr as triggerConfigValues, dt as loadJson, en as FlowSettingsButton, fn as ComboboxPositioner, fr as inputValue, ft as designerGraph, gn as ComboboxTrigger, gr as openApiTask, gt as triggerNodeIcon, hn as GroupCollectionProvider, hr as openApiFieldIssues, ht as semanticNodeIcon, in as selectionMenuContentClass, it as decodeAppCatalogResponse, j as valueForEditor, jn as EmptyHeader, jr as eventSourceKind, jt as connectionCatalog, k as editorGroups, kn as EmptyContent, kr as ApiError, kt as schemaMismatchMessage, ln as ComboboxItemIndicator, mn as ComboboxList, mr as object$1, mt as nodeTitle, n as agentTool, nr as triggerOutputDefinitions, on as ValueControl, ot as getAppCatalogCache, pn as ComboboxPortal, pr as listOperations, pt as nodeIcon, q as mapSource, rr as isJsonObject, sn as ValueEditorFeedback, tt as provider, un as ComboboxItem, ur as triggerConfigValue, vn as ComboboxInput, vr as selectOperation, vt as providerIcon, wn as followWorkbenchLink, wr as workflowCandidateGroup, xn as useComboboxInputValueContext, xr as sameWorkflowInterface, xt as hasRunFilter, yn as ComboboxRoot, yr as serverAddress, z as datePickerChange, zn as FeishuEventPicker } from "./flowChanges-CFj5pL4Y.js";
|
|
9
9
|
import { r as resolveUiLanguage } from "./languages-gYzoQqCi.js";
|
|
10
10
|
import { a as renameObjectField, i as objectValue, n as isJsonValue, o as setObjectField, r as jsonDataTypes, s as valueType$1, t as initialValue } from "./value-BbFQZZ_V.js";
|
|
11
11
|
import { n as compile, r as validate } from "./flowRunInputEditorStore-ys1-w9GW.js";
|
|
@@ -28251,121 +28251,6 @@ function HttpRequestSection({ task, disabled, onSave, parameters, input }) {
|
|
|
28251
28251
|
] });
|
|
28252
28252
|
}
|
|
28253
28253
|
//#endregion
|
|
28254
|
-
//#region src/workbench/browser/runtime/editor/leinaBotSelect.tsx
|
|
28255
|
-
function LeinaBotSelect({ source, flowId, value, disabled, onChange }) {
|
|
28256
|
-
const t = useTranslate();
|
|
28257
|
-
const [attempt, setAttempt] = useState(0);
|
|
28258
|
-
const [state, setState] = useState();
|
|
28259
|
-
useEffect(() => {
|
|
28260
|
-
const controller = new AbortController();
|
|
28261
|
-
setState((previous) => ({
|
|
28262
|
-
flowId,
|
|
28263
|
-
source,
|
|
28264
|
-
loading: true,
|
|
28265
|
-
bots: previous?.flowId == flowId && previous.source == source ? previous.bots : void 0
|
|
28266
|
-
}));
|
|
28267
|
-
source.listLeinaBots(flowId, controller.signal).then((bots) => {
|
|
28268
|
-
if (!controller.signal.aborted) setState({
|
|
28269
|
-
flowId,
|
|
28270
|
-
source,
|
|
28271
|
-
bots,
|
|
28272
|
-
loading: false
|
|
28273
|
-
});
|
|
28274
|
-
}, (error) => {
|
|
28275
|
-
if (!controller.signal.aborted) setState((previous) => ({
|
|
28276
|
-
flowId,
|
|
28277
|
-
source,
|
|
28278
|
-
bots: previous?.flowId == flowId && previous.source == source ? previous.bots : void 0,
|
|
28279
|
-
loading: false,
|
|
28280
|
-
error: error instanceof Error ? error.message : t("contextPanel.loadFailed")
|
|
28281
|
-
}));
|
|
28282
|
-
});
|
|
28283
|
-
return () => controller.abort();
|
|
28284
|
-
}, [
|
|
28285
|
-
source,
|
|
28286
|
-
flowId,
|
|
28287
|
-
attempt,
|
|
28288
|
-
t
|
|
28289
|
-
]);
|
|
28290
|
-
const current = state?.flowId == flowId && state.source == source ? state : void 0;
|
|
28291
|
-
const bots = current?.bots;
|
|
28292
|
-
const selected = typeof value == "string" && value.trim().length > 0 ? value : void 0;
|
|
28293
|
-
const missing = selected != null && bots != null && !bots.some((bot) => bot.leinaId == selected);
|
|
28294
|
-
const error = selected == null ? t("leina.select") : missing ? t("leina.unavailable", { id: selected }) : void 0;
|
|
28295
|
-
const selectedLabel = bots?.find((bot) => bot.leinaId == selected)?.name ?? (missing ? t("leina.unavailable", { id: selected }) : current?.error != null ? t("leina.loadFailed") : t("leina.loading"));
|
|
28296
|
-
const items = [...(bots ?? []).map((bot) => ({
|
|
28297
|
-
value: bot.leinaId,
|
|
28298
|
-
label: bot.name
|
|
28299
|
-
})), ...selected != null && !bots?.some((bot) => bot.leinaId == selected) ? [{
|
|
28300
|
-
value: selected,
|
|
28301
|
-
label: selectedLabel
|
|
28302
|
-
}] : []];
|
|
28303
|
-
return /* @__PURE__ */ jsx(ValueEditorFeedback, {
|
|
28304
|
-
error,
|
|
28305
|
-
children: (errorId) => /* @__PURE__ */ jsxs(Select$1, {
|
|
28306
|
-
items,
|
|
28307
|
-
value: selected ?? null,
|
|
28308
|
-
disabled,
|
|
28309
|
-
onOpenChange: (open) => {
|
|
28310
|
-
if (open) setAttempt((previous) => previous + 1);
|
|
28311
|
-
},
|
|
28312
|
-
onValueChange: (next) => {
|
|
28313
|
-
if (typeof next == "string" && bots?.some((bot) => bot.leinaId == next)) onChange(next);
|
|
28314
|
-
},
|
|
28315
|
-
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
28316
|
-
size: "field",
|
|
28317
|
-
className: "w-full",
|
|
28318
|
-
"data-field-control": true,
|
|
28319
|
-
"aria-label": t("leina.robot"),
|
|
28320
|
-
"aria-invalid": error != null || void 0,
|
|
28321
|
-
"aria-describedby": errorId,
|
|
28322
|
-
children: /* @__PURE__ */ jsx(SelectValue, {
|
|
28323
|
-
placeholder: t("leina.select"),
|
|
28324
|
-
children: selected == null ? void 0 : selectedLabel
|
|
28325
|
-
})
|
|
28326
|
-
}), /* @__PURE__ */ jsxs(SelectContent, {
|
|
28327
|
-
align: "start",
|
|
28328
|
-
alignItemWithTrigger: false,
|
|
28329
|
-
className: selectionMenuContentClass,
|
|
28330
|
-
children: [
|
|
28331
|
-
(current?.loading ?? true) && /* @__PURE__ */ jsx("span", {
|
|
28332
|
-
role: "status",
|
|
28333
|
-
className: "block px-1.5 py-1 text-xs leading-5 text-muted-foreground",
|
|
28334
|
-
children: t("leina.loading")
|
|
28335
|
-
}),
|
|
28336
|
-
bots?.map((bot) => /* @__PURE__ */ jsx(SelectItem, {
|
|
28337
|
-
value: bot.leinaId,
|
|
28338
|
-
className: selectionMenuItemClass,
|
|
28339
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
28340
|
-
className: "truncate",
|
|
28341
|
-
children: bot.name
|
|
28342
|
-
})
|
|
28343
|
-
}, bot.leinaId)),
|
|
28344
|
-
missing && selected != null && /* @__PURE__ */ jsx(SelectItem, {
|
|
28345
|
-
value: selected,
|
|
28346
|
-
disabled: true,
|
|
28347
|
-
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`,
|
|
28348
|
-
children: t("leina.unavailable", { id: selected })
|
|
28349
|
-
}),
|
|
28350
|
-
current?.error != null && /* @__PURE__ */ jsxs("span", {
|
|
28351
|
-
role: "alert",
|
|
28352
|
-
className: "block px-1.5 py-1 text-xs leading-5 whitespace-normal break-words text-destructive",
|
|
28353
|
-
children: [
|
|
28354
|
-
t("leina.loadFailed"),
|
|
28355
|
-
" ",
|
|
28356
|
-
current.error
|
|
28357
|
-
]
|
|
28358
|
-
}),
|
|
28359
|
-
bots?.length == 0 && !current?.loading && /* @__PURE__ */ jsx("span", {
|
|
28360
|
-
className: "block px-1.5 py-1 text-xs leading-5 whitespace-normal text-muted-foreground",
|
|
28361
|
-
children: t("leina.empty")
|
|
28362
|
-
})
|
|
28363
|
-
]
|
|
28364
|
-
})]
|
|
28365
|
-
})
|
|
28366
|
-
});
|
|
28367
|
-
}
|
|
28368
|
-
//#endregion
|
|
28369
28254
|
//#region src/workbench/browser/runtime/editor/useTriggerConfigOptions.ts
|
|
28370
28255
|
function useTriggerConfigOptions(store, nodeId, field, scope, enabled) {
|
|
28371
28256
|
const [attempt, setAttempt] = useState(0);
|
|
@@ -31061,6 +30946,7 @@ function NodeInspector({ onAddWorkflowOutputs, onAddResponseNode, webhookDeploym
|
|
|
31061
30946
|
const unconfiguredOpenApi = task != null && "executor" in task && task.executor.kind == "openapi" && !task.executor.path;
|
|
31062
30947
|
const isLlm = task != null && "executor" in task && task.executor.kind == "llm";
|
|
31063
30948
|
const connector = task != null && "executor" in task && task.executor.kind == "connector" ? task.executor : void 0;
|
|
30949
|
+
const connectorPresentation = connector == null ? void 0 : connectorActionPresentation(connector.action, t);
|
|
31064
30950
|
const nodeId = selection?.kind == "task" ? selection.id : void 0;
|
|
31065
30951
|
const workflowSettings = task != null && "executor" in task && task.executor.kind == "workflow" && selection != null ? {
|
|
31066
30952
|
task,
|
|
@@ -31475,7 +31361,8 @@ function NodeInspector({ onAddWorkflowOutputs, onAddResponseNode, webhookDeploym
|
|
|
31475
31361
|
return {
|
|
31476
31362
|
definition,
|
|
31477
31363
|
sourceOnly: isHttpRequest && definition.handle.startsWith("auth."),
|
|
31478
|
-
editor: !readOnly && connectors != null &&
|
|
31364
|
+
editor: !readOnly && connectors != null && mapping?.kind != "sources" ? connectorPresentation?.renderInput({
|
|
31365
|
+
handle: definition.handle,
|
|
31479
31366
|
source: connectors,
|
|
31480
31367
|
flowId: revision.revision.flowId,
|
|
31481
31368
|
value: inputValue(mapping, definition.value),
|
|
@@ -31483,7 +31370,7 @@ function NodeInspector({ onAddWorkflowOutputs, onAddResponseNode, webhookDeploym
|
|
|
31483
31370
|
onChange: (value) => {
|
|
31484
31371
|
store?.nodes.setInputValue(selection.id, definition.handle, value);
|
|
31485
31372
|
}
|
|
31486
|
-
}
|
|
31373
|
+
}) : void 0,
|
|
31487
31374
|
value: inputValue(mapping, definition.value),
|
|
31488
31375
|
onReset: definition.value !== void 0 && mapping != null ? () => void store?.nodes.resetInputs(selection.id, [definition.handle]) : void 0,
|
|
31489
31376
|
connected: mapping?.kind === "sources" && binding?.kind !== "variable",
|
|
@@ -31496,10 +31383,7 @@ function NodeInspector({ onAddWorkflowOutputs, onAddResponseNode, webhookDeploym
|
|
|
31496
31383
|
title: t(selection.kind === "outputs" ? "inspector.ports.outputsTitle" : "inspector.ports.inputsTitle"),
|
|
31497
31384
|
titleIcon: selection.kind === "outputs" ? "output" : "input",
|
|
31498
31385
|
entries,
|
|
31499
|
-
fieldLabels:
|
|
31500
|
-
leinaId: t("leina.robot"),
|
|
31501
|
-
message: t("leina.message")
|
|
31502
|
-
} : void 0,
|
|
31386
|
+
fieldLabels: connectorPresentation?.fieldLabels,
|
|
31503
31387
|
onReset: () => {
|
|
31504
31388
|
return store?.nodes.resetInputs(selection.id, entries.flatMap((entry) => "group" in entry ? [] : [entry.definition.handle]));
|
|
31505
31389
|
},
|