@oomol-lab/open-flow 0.1.0-beta.51 → 0.1.0-beta.53
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/{createResourceDialog-BDtXpRSt.js → createResourceDialog-BsaBMf7_.js} +2 -1
- package/dist/browser/flow-authoring.js +46 -3
- package/dist/browser/flow-change.d.ts +6 -1
- package/dist/browser/flow-change.js +46 -3
- package/dist/browser/{flowChanges-BWSXSnMX.js → flowChanges-CcscgZsW.js} +3492 -1939
- package/dist/browser/{flowWorkspace-DBaq2Eks.js → flowWorkspace-CoT_ewLX.js} +904 -330
- package/dist/browser/{workbenchSelect-C9kwcUmN.js → icons-0s-Q_3lp.js} +48 -32
- package/dist/browser/licenses.md +204 -0
- package/dist/browser/preview.css +282 -179
- package/dist/browser/preview.js +4311 -2200
- package/dist/browser/theme.css +2 -0
- package/dist/browser/ui-hostNavigationActions.d.ts +13 -0
- package/dist/browser/ui-hostTooltip.d.ts +8 -0
- package/dist/browser/ui-logo.d.ts +5 -0
- package/dist/browser/ui.css +82 -8
- package/dist/browser/ui.d.ts +3 -0
- package/dist/browser/ui.js +172 -8
- package/dist/browser/workbench-contract.d.ts +4 -11
- package/dist/browser/workbench.css +346 -200
- package/dist/browser/workbench.d.ts +1 -1
- package/dist/browser/workbench.js +1056 -367
- package/dist/browser/workbenchSelect-BqUPacsr.js +31 -0
- package/dist/common/authoringExamples.d.ts +4 -3
- package/dist/common/connector-proxy.d.ts +32 -0
- package/dist/common/control-api-conformance.js +54 -3
- package/dist/common/control-api.d.ts +6 -0
- package/dist/common/control-api.js +58 -4
- package/dist/common/control-requests.d.ts +4 -0
- package/dist/common/control-requests.js +1299 -68
- package/dist/common/feishu-subscriptions.d.ts +1 -5
- package/dist/common/flow-connectionUsage.d.ts +1 -0
- package/dist/common/flow-encoding.js +34 -0
- package/dist/common/flow-semantics.js +675 -252
- package/dist/common/integration-trigger.js +23 -0
- package/dist/common/mcp.js +54 -3
- package/dist/common/openapi.d.ts +53 -0
- package/dist/common/openapi.js +10390 -0
- package/dist/common/poll-trigger.js +23 -0
- package/dist/common/provider-triggers.d.ts +1 -1
- package/dist/common/provider-triggers.js +166 -16204
- package/dist/common/run-events.js +1 -0
- package/dist/common/scheduler.d.ts +1 -1
- package/dist/common/scheduler.js +31 -1
- package/dist/common/webhook-trigger.js +23 -0
- package/package.json +5 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { i as __require, o as __toESM, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime-CEgmsyvS.js";
|
|
2
|
-
import { $ as useIconifyCollectionLoader, $t as
|
|
2
|
+
import { $ as useIconifyCollectionLoader, $t as InputGroup, A as calendarDate, An as resolutionOutputPorts, B as mapSource, Bn as inputValue, Bt as followWorkbenchLink, C as editorGroups, Cn as EventSourceSetup, D as isUnconstrainedSchema, E as getDefaultValue, Fn as triggerConfigValue, Ft as securityOptions, G as resourceValue, Gt as PopoverPanelContent, Ht as Popover, I as indexAddNodeOptions, In as triggerConfigValues, It as selectOperation, J as triggerNodeIcon, Jn as Checkbox, Jt as NativeScrollArea, K as designerGraph, Kt as PopoverTitle, L as feishuResourceKind, Ln as variableInputCompatible, Lt as serverAddress, M as datePickerValue, Mt as object, N as isDateFormat, Nn as triggerOutputDefinitions, Nt as openApiFieldIssues, O as typeOfSchema, On as decodeResultList, Pn as isJsonObject, Pt as openApiTask, Q as IconifyProvider, Qt as useTriggerFocusGuards, R as supportsFeishuChatFilter, Rt as servers, S as editorComponent, Sn as FeishuEventPicker, T as valueForEditor, U as observeResource, Ut as PopoverContent, Vt as Switch, W as resourceData, Wt as PopoverDescription, X as providerIcon, Xt as VirtualScrollArea, Y as actionSummary, Yn as IconThemeContext, Yt as ScrollArea, Z as ContentIcon, Zt as Z$2, _n as ko_default$1, an as EmptyHeader, bn as en_default$1, ct as diagnosticMessage, dn as createI18n$1, en as InputGroupAddon, et as useIconifyData, fn as uiLocales, ft as connectionCatalog, gn as ru_default$1, hn as zh_CN_default$1, in as EmptyDescription, it as revisionView, j as datePickerChange, jn as sourceOutputLabel, jt as listOperations, k as calendarChange, ln as SourceForm, lt as diagnosticNodeId, mn as zh_TW_default$1, n as agentTool, nn as Empty, nt as canCancelRun, on as EmptyMedia, pn as waitBranchDescription, q as semanticNodeIcon, qn as controlErrorCode, qt as PopoverTrigger, rn as EmptyContent, rt as hasRunFilter, sn as EmptyTitle, tn as InputGroupInput, un as SourceSelect, ut as schemaMismatchMessage, vn as ja_default$1, w as schemaForEditor, wn as errorNotice, x as defaultValueEditorSchema, xn as I18n, yn as fr_default$1, zt as IdTooltip } from "./flowChanges-CcscgZsW.js";
|
|
3
3
|
import { a as derive, c as strictEqual, i as compute, l as val, n as attachSetter, r as combine, s as readonlyVal } from "./dist-bO8nvHFH.js";
|
|
4
4
|
import { a as useVal, i as useTranslate, n as useI18n, r as useLang, t as I18nProvider } from "./main-BPABKzwN.js";
|
|
5
|
-
import { $
|
|
5
|
+
import { $r as useRefWithInit, $t as useFocus$1, A as nodeNameIssue, An as Label, At as scrollIntoViewIfNeeded, Bn as getGridCellIndexOfCorner, Br as EMPTY_ARRAY$1, Bt as inertValue, C as FieldError, Cn as ReactStore, Cr as triggerPress, Dn as require_builtin_esm_external_require_react, Dt as VERTICAL_KEYS, En as require_with_selector, Et as MODIFIER_KEYS, Fr as buttonVariants, Ft as InternalBackdrop, G as webhookSupportsBody, Gn as isIndexOutOfListBounds, Gr as useButton, Gt as useOpenInteractionType, H as valueType, Hn as getGridNavigatedIndex, Ht as popupStateMapping, Ir as cn$1, It as useAnchorPositioning, Jn as activeElement, Jr as formatErrorMessage, Jt as useRole, K as dequal, Kn as isListIndexDisabled, Kr as CompositeRootContext, Kt as safePolygon, L as nodeInputMappings, Lr as cva, Lt as adaptiveOrigin, Mt as useAnchoredPopupScrollLock, Nn as useTimeout, Nr as useControlled, Nt as usePositioner, On as createSelector, Or as useBaseUiId, Ot as VERTICAL_KEYS_WITH_EXTRA_KEYS, P as comparisonIssue, Pr as Button$1, Pt as getDisabledMountTransitionStyles, Qn as ownerDocument, Qr as useStableCallback, Qt as useHoverFloatingInteraction, R as operandHandle, Rn as createGridCellMap, Rr as clsx, Rt as useDirection, S as FieldDescription, Sn as addEventListener, St as COMPOSITE_KEYS, T as FieldLabel, Tn as fastComponentRef, Tt as HORIZONTAL_KEYS_WITH_EXTRA_KEYS, U as decodeRevisionContent, Un as getMaxListIndex, Ur as warn, Ut as pressableTriggerOpenStateMapping, V as unaryOperator, Vn as getGridCellIndices, Vr as EMPTY_OBJECT, Vt as getPseudoElementBounds, W as webhookMethods, Wn as getMinListIndex, Wr as useMergedRefs, Wt as triggerOpenStateMapping, Xn as getTarget, Xr as useIsoLayoutEffect, Xt as useInteractions, Yn as contains, Yr as mergeProps, Yt as useListNavigation, Zn as isMac$1, Zr as SafeReact, Zt as useHoverReferenceInteraction, _ as TooltipPortal, _n as FloatingPortal, _t as ARROW_DOWN, a as DialogDescription, an as useOpenStateTransitions, ar as useAnimationsFinished, b as Spinner, bn as POPUP_COLLISION_AVOIDANCE, br as siblingOpen, bt as ARROW_RIGHT, c as DialogTitle, cn as useDismiss, ct as SelectContent, d as TooltipContent, dn as FloatingNode, dr as cancelOpen, dt as SelectSeparator, ei as getParentNode, en as useSyncedFloatingRootContext, er as ChevronDown, f as TooltipProvider, fn as FloatingTree, ft as SelectTrigger, g as TooltipPositioner, gn as FloatingTreeStore, gr as itemPress, gt as ALL_KEYS, h as TooltipPopup, hn as useFloatingTree, hr as imperativeAction, ht as useCompositeListItem, i as DialogContent, in as useImplicitActiveTrigger, ir as useOpenChangeComplete, it as string, jn as Input$1, jt as useToolbarRootContext, kn as useOnFirstRender, kr as useId$1, kt as isNativeInput, l as DialogTrigger, ln as useClick, lt as SelectGroup, m as TooltipArrow, mn as useFloatingParentNodeId, mt as Separator, n as Dialog, ni as isLastTraversableNode, nn as popupStoreSelectors, nr as createLucideIcon, on as useTriggerDataForwarding, or as TransitionStatusDataAttributes, ot as Select$1, p as TooltipTrigger, pn as useFloatingNodeId, pt as SelectValue, qn as stopEvent$1, qr as useCompositeRootContext, qt as useTypeahead, rn as PopupTriggerMap, rr as useTransitionStatus, sn as useTriggerRegistration, sr as transitionStatusMapping, st as SelectChevron, t as Icon, ti as isHTMLElement, tn as createInitialPopupStoreState, tr as Check, u as Tooltip, un as FloatingFocusManager, ur as createChangeEventDetails, ut as SelectItem, v as TooltipTrigger$1, vr as none$1, vt as ARROW_KEYS, w as FieldGroup, wn as fastComponent, wt as HORIZONTAL_KEYS, x as Field, xn as FocusGuard, xt as ARROW_UP, y as TooltipRoot, yn as DROPDOWN_COLLISION_AVOIDANCE, yt as ARROW_LEFT, z as operatorsForType, zn as findNonDisabledListIndex, zr as useRenderElement, zt as CompositeList } from "./icons-0s-Q_3lp.js";
|
|
6
6
|
import { i as isString, n as isBoolean, r as isPlainObject, t as isArray$1 } from "./dist-BDBTOgS5.js";
|
|
7
7
|
import { a as renameObjectField, i as objectValue, l as resolveUiLanguage, n as isJsonValue, o as setObjectField, r as jsonDataTypes, s as valueType$1, t as initialValue } from "./value-DL_poNiC.js";
|
|
8
8
|
import { n as compile, r as validate } from "./flowRunInputEditorStore-Dsxyfwae.js";
|
|
9
|
+
import { t as WorkbenchSelect } from "./workbenchSelect-BqUPacsr.js";
|
|
9
10
|
import * as React from "react";
|
|
10
11
|
import reactExports, { Children, Fragment, Suspense, createContext, forwardRef, isValidElement, lazy, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
11
12
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -3445,11 +3446,13 @@ function connectorAccessPermissionLabel(candidate, t) {
|
|
|
3445
3446
|
const prefix = `${candidate.providerId}.`;
|
|
3446
3447
|
const actions = permissions.actionIds.map((actionId) => actionId.startsWith(prefix) ? actionId.slice(prefix.length) : actionId);
|
|
3447
3448
|
const shown = actions.slice(0, 3).join(", ");
|
|
3449
|
+
const label = permissions.allActions ? t("connectorAccess.permissionAllActions") : actions.length > 3 ? t("connectorAccess.permissionActionsMore", {
|
|
3450
|
+
actions: shown,
|
|
3451
|
+
count: actions.length - 3
|
|
3452
|
+
}) : t("connectorAccess.permissionActions", { actions: shown });
|
|
3448
3453
|
return [
|
|
3449
|
-
permissions.allActions
|
|
3450
|
-
|
|
3451
|
-
count: actions.length - 3
|
|
3452
|
-
}) : t("connectorAccess.permissionActions", { actions: shown }),
|
|
3454
|
+
permissions.allActions || actions.length > 0 ? label : void 0,
|
|
3455
|
+
permissions.allTriggers ? t("connectorAccess.permissionAllTriggers") : permissions.triggerIds.length > 0 ? t("connectorAccess.permissionTriggers", { triggers: permissions.triggerIds.map((id) => id.startsWith(prefix) ? id.slice(prefix.length) : id).join(", ") }) : void 0,
|
|
3453
3456
|
permissions.proxy ? t("connectorAccess.permissionProxy") : void 0,
|
|
3454
3457
|
permissions.configured ? t("connectorAccess.permissionConfigured") : void 0
|
|
3455
3458
|
].filter(Boolean).join(" · ");
|
|
@@ -3659,6 +3662,9 @@ function ProviderGroupHeading({ group, container, onClick }) {
|
|
|
3659
3662
|
}
|
|
3660
3663
|
//#endregion
|
|
3661
3664
|
//#region src/workbench/browser/runtime/editor/nodePicker.tsx
|
|
3665
|
+
function pickerViewKey(appId, term, page) {
|
|
3666
|
+
return `${page}:${appId ?? "catalog"}:${term}`;
|
|
3667
|
+
}
|
|
3662
3668
|
function NodePickerContent({ options, connections, loadConnections, browseOptions, searchOptions, provideChoices, onAdd, onDragStart, onDragEnd, onRegisterDragOption, draggable = true, disabled, isOptionDisabled, catalogFailed, initialQuery = "", initialTab = "nodes" }) {
|
|
3663
3669
|
const t = useTranslate();
|
|
3664
3670
|
const [page, setPage] = useState(initialTab);
|
|
@@ -3666,6 +3672,7 @@ function NodePickerContent({ options, connections, loadConnections, browseOption
|
|
|
3666
3672
|
const [appQuery, setAppQuery] = useState("");
|
|
3667
3673
|
const searchInput = useRef(null);
|
|
3668
3674
|
const searchSession = useRef(null);
|
|
3675
|
+
const scrollPositions = useRef(/* @__PURE__ */ new Map());
|
|
3669
3676
|
useEffect(() => {
|
|
3670
3677
|
const controller = new AbortController();
|
|
3671
3678
|
searchSession.current = controller;
|
|
@@ -3678,6 +3685,7 @@ function NodePickerContent({ options, connections, loadConnections, browseOption
|
|
|
3678
3685
|
const [appId, setAppId] = useState();
|
|
3679
3686
|
const [navigation, setNavigation] = useState();
|
|
3680
3687
|
const navigateApp = (id) => {
|
|
3688
|
+
if (list.current) scrollPositions.current.set(pickerViewKey(appId, term, page), list.current.scrollTop);
|
|
3681
3689
|
setNavigation(id ? "forward" : "back");
|
|
3682
3690
|
setAppId(id);
|
|
3683
3691
|
setAppQuery("");
|
|
@@ -3763,7 +3771,7 @@ function NodePickerContent({ options, connections, loadConnections, browseOption
|
|
|
3763
3771
|
return [...entries.values()].toSorted(comparePickerApps);
|
|
3764
3772
|
}, [catalog, connections]);
|
|
3765
3773
|
const app = apps.find((item) => item.id == appId);
|
|
3766
|
-
const directoryId = app?.directory?.id;
|
|
3774
|
+
const directoryId = app?.directory?.id ?? (app == null ? void 0 : `connector-provider:${app.id}`);
|
|
3767
3775
|
const searching = term != "" && app == null;
|
|
3768
3776
|
const [choicesLoading, setChoicesLoading] = useState(false);
|
|
3769
3777
|
const [choicesFailed, setChoicesFailed] = useState(false);
|
|
@@ -3783,12 +3791,15 @@ function NodePickerContent({ options, connections, loadConnections, browseOption
|
|
|
3783
3791
|
provideChoices,
|
|
3784
3792
|
t
|
|
3785
3793
|
]);
|
|
3786
|
-
|
|
3787
|
-
list.current?.scrollTo(0, 0);
|
|
3794
|
+
useLayoutEffect(() => {
|
|
3795
|
+
list.current?.scrollTo(0, scrollPositions.current.get(pickerViewKey(appId, term, page)) ?? 0);
|
|
3788
3796
|
}, [
|
|
3789
3797
|
appId,
|
|
3790
3798
|
term,
|
|
3791
|
-
page
|
|
3799
|
+
page,
|
|
3800
|
+
catalog.length,
|
|
3801
|
+
results.length,
|
|
3802
|
+
actions.length
|
|
3792
3803
|
]);
|
|
3793
3804
|
const add = async (item) => {
|
|
3794
3805
|
if (busy.current || disabled || isOptionDisabled?.(item)) return;
|
|
@@ -3921,7 +3932,7 @@ function NodePickerContent({ options, connections, loadConnections, browseOption
|
|
|
3921
3932
|
/* @__PURE__ */ jsx("div", {
|
|
3922
3933
|
ref: mount,
|
|
3923
3934
|
className: "shrink-0 px-3 pb-2 pt-3",
|
|
3924
|
-
children: /* @__PURE__ */ jsxs(InputGroup
|
|
3935
|
+
children: /* @__PURE__ */ jsxs(InputGroup, { children: [
|
|
3925
3936
|
/* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx(Icon, {
|
|
3926
3937
|
name: "search",
|
|
3927
3938
|
size: 16
|
|
@@ -4163,6 +4174,7 @@ function fallbackIcon$1(item) {
|
|
|
4163
4174
|
switch (item.type) {
|
|
4164
4175
|
case "agent": return "llm";
|
|
4165
4176
|
case "condition": return "condition";
|
|
4177
|
+
case "openapi":
|
|
4166
4178
|
case "connector":
|
|
4167
4179
|
case "connector-group": return "connection";
|
|
4168
4180
|
case "llm": return "llm";
|
|
@@ -4585,7 +4597,7 @@ function SidebarBlockLibrary({ catalogFailed, refreshCatalog, browseOptions, dis
|
|
|
4585
4597
|
children: [
|
|
4586
4598
|
/* @__PURE__ */ jsx("div", {
|
|
4587
4599
|
className: cn$1("mb-2 flex-none", presentation == "actions" || presentation == "providers" ? "mt-1" : "mx-3.5 mt-3"),
|
|
4588
|
-
children: /* @__PURE__ */ jsxs(InputGroup
|
|
4600
|
+
children: /* @__PURE__ */ jsxs(InputGroup, { children: [
|
|
4589
4601
|
/* @__PURE__ */ jsx("span", {
|
|
4590
4602
|
className: "sr-only",
|
|
4591
4603
|
children: searchLabel
|
|
@@ -6797,7 +6809,7 @@ var IconPicker = ({ className, emoji, carbon = true, defaultTab = rememberLastTa
|
|
|
6797
6809
|
children: [
|
|
6798
6810
|
/* @__PURE__ */ jsxs("div", {
|
|
6799
6811
|
className: IconPicker_module_default.filter,
|
|
6800
|
-
children: [/* @__PURE__ */ jsxs(InputGroup
|
|
6812
|
+
children: [/* @__PURE__ */ jsxs(InputGroup, {
|
|
6801
6813
|
className: "h-6",
|
|
6802
6814
|
children: [/* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx("i", {
|
|
6803
6815
|
"aria-hidden": "true",
|
|
@@ -7150,44 +7162,44 @@ function FlowNodeList({ nodes, onFocusNode, onSelect, groupTriggers = false }) {
|
|
|
7150
7162
|
});
|
|
7151
7163
|
}
|
|
7152
7164
|
var valueEditor_module_default = {
|
|
7153
|
-
root: "
|
|
7154
|
-
errorAnchor: "
|
|
7155
|
-
valueTools: "
|
|
7156
|
-
body: "
|
|
7157
|
-
options: "
|
|
7158
|
-
toolbar: "
|
|
7159
|
-
presence: "
|
|
7160
|
-
actions: "
|
|
7161
|
-
collection: "
|
|
7162
|
-
fieldName: "
|
|
7163
|
-
fieldType: "
|
|
7164
|
-
json: "
|
|
7165
|
-
description: "
|
|
7166
|
-
error: "
|
|
7167
|
-
summary: "
|
|
7168
|
-
summaryError: "
|
|
7169
|
-
srOnly: "
|
|
7170
|
-
option: "
|
|
7171
|
-
header: "
|
|
7172
|
-
leadingControl: "
|
|
7173
|
-
toggleControl: "
|
|
7174
|
-
valueAddon: "
|
|
7175
|
-
summaryText: "
|
|
7176
|
-
clearValue: "
|
|
7177
|
-
resetValue: "
|
|
7178
|
-
unsetValue: "
|
|
7179
|
-
arrayIndex: "
|
|
7180
|
-
nullValue: "
|
|
7181
|
-
nullChip: "
|
|
7182
|
-
collectionActions: "
|
|
7183
|
-
emptyObjectContent: "
|
|
7184
|
-
emptyObjectConstraint: "
|
|
7185
|
-
jsonCode: "
|
|
7186
|
-
emptyString: "
|
|
7187
|
-
booleanControl: "
|
|
7188
|
-
booleanIndicator: "
|
|
7189
|
-
objectNotice: "
|
|
7190
|
-
valuePrefix: "
|
|
7165
|
+
root: "valueEditor_root_d4b23",
|
|
7166
|
+
errorAnchor: "valueEditor_errorAnchor_d4b23",
|
|
7167
|
+
valueTools: "valueEditor_valueTools_d4b23",
|
|
7168
|
+
body: "valueEditor_body_d4b23",
|
|
7169
|
+
options: "valueEditor_options_d4b23",
|
|
7170
|
+
toolbar: "valueEditor_toolbar_d4b23",
|
|
7171
|
+
presence: "valueEditor_presence_d4b23",
|
|
7172
|
+
actions: "valueEditor_actions_d4b23",
|
|
7173
|
+
collection: "valueEditor_collection_d4b23",
|
|
7174
|
+
fieldName: "valueEditor_fieldName_d4b23",
|
|
7175
|
+
fieldType: "valueEditor_fieldType_d4b23",
|
|
7176
|
+
json: "valueEditor_json_d4b23",
|
|
7177
|
+
description: "valueEditor_description_d4b23",
|
|
7178
|
+
error: "valueEditor_error_d4b23",
|
|
7179
|
+
summary: "valueEditor_summary_d4b23",
|
|
7180
|
+
summaryError: "valueEditor_summaryError_d4b23",
|
|
7181
|
+
srOnly: "valueEditor_srOnly_d4b23",
|
|
7182
|
+
option: "valueEditor_option_d4b23",
|
|
7183
|
+
header: "valueEditor_header_d4b23",
|
|
7184
|
+
leadingControl: "valueEditor_leadingControl_d4b23",
|
|
7185
|
+
toggleControl: "valueEditor_toggleControl_d4b23",
|
|
7186
|
+
valueAddon: "valueEditor_valueAddon_d4b23",
|
|
7187
|
+
summaryText: "valueEditor_summaryText_d4b23",
|
|
7188
|
+
clearValue: "valueEditor_clearValue_d4b23",
|
|
7189
|
+
resetValue: "valueEditor_resetValue_d4b23",
|
|
7190
|
+
unsetValue: "valueEditor_unsetValue_d4b23",
|
|
7191
|
+
arrayIndex: "valueEditor_arrayIndex_d4b23",
|
|
7192
|
+
nullValue: "valueEditor_nullValue_d4b23",
|
|
7193
|
+
nullChip: "valueEditor_nullChip_d4b23",
|
|
7194
|
+
collectionActions: "valueEditor_collectionActions_d4b23",
|
|
7195
|
+
emptyObjectContent: "valueEditor_emptyObjectContent_d4b23",
|
|
7196
|
+
emptyObjectConstraint: "valueEditor_emptyObjectConstraint_d4b23",
|
|
7197
|
+
jsonCode: "valueEditor_jsonCode_d4b23",
|
|
7198
|
+
emptyString: "valueEditor_emptyString_d4b23",
|
|
7199
|
+
booleanControl: "valueEditor_booleanControl_d4b23",
|
|
7200
|
+
booleanIndicator: "valueEditor_booleanIndicator_d4b23",
|
|
7201
|
+
objectNotice: "valueEditor_objectNotice_d4b23",
|
|
7202
|
+
valuePrefix: "valueEditor_valuePrefix_d4b23"
|
|
7191
7203
|
};
|
|
7192
7204
|
//#endregion
|
|
7193
7205
|
//#region src/form/browser/fieldControl.tsx
|
|
@@ -7285,18 +7297,21 @@ function agentFixedValuesValid(config, notificationInputs = []) {
|
|
|
7285
7297
|
//#region src/ui/browser/icon-stack.tsx
|
|
7286
7298
|
/** A visual summary; the caller supplies an accessible label and tooltip. */
|
|
7287
7299
|
function IconStack({ icons, count, limit = 3, size = "default", countClassName }) {
|
|
7288
|
-
const
|
|
7300
|
+
const frame = cn$1("relative flex shrink-0 items-center justify-center rounded-[6px] border border-border/50 bg-popover", size === "sm" ? "size-5" : "size-6");
|
|
7289
7301
|
return /* @__PURE__ */ jsxs("span", {
|
|
7290
7302
|
"aria-hidden": "true",
|
|
7291
|
-
className: "inline-flex shrink-0 items-center -
|
|
7292
|
-
children: [
|
|
7293
|
-
className:
|
|
7294
|
-
children: /* @__PURE__ */ jsx(
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7303
|
+
className: "inline-flex shrink-0 items-center gap-1",
|
|
7304
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
7305
|
+
className: "inline-flex items-center -space-x-0.5",
|
|
7306
|
+
children: icons.slice(0, limit).map((item) => /* @__PURE__ */ jsx("span", {
|
|
7307
|
+
className: frame,
|
|
7308
|
+
children: /* @__PURE__ */ jsx(ContentIcon, {
|
|
7309
|
+
src: item.icon,
|
|
7310
|
+
className: size === "sm" ? "size-3.5" : "size-4"
|
|
7311
|
+
})
|
|
7312
|
+
}, item.id))
|
|
7313
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
7314
|
+
className: cn$1("text-[10px] font-normal tabular-nums text-muted-foreground", countClassName),
|
|
7300
7315
|
children: ["+", count]
|
|
7301
7316
|
})]
|
|
7302
7317
|
});
|
|
@@ -7321,17 +7336,20 @@ var PickerVirtualItem = forwardRef(({ children, style, index }, ref) => {
|
|
|
7321
7336
|
function ActionPicker(props) {
|
|
7322
7337
|
const [provider, setProvider] = useState();
|
|
7323
7338
|
const [navigation, setNavigation] = useState();
|
|
7339
|
+
const scrollPositions = useRef(/* @__PURE__ */ new Map());
|
|
7324
7340
|
return /* @__PURE__ */ jsx(ActionPickerPage, {
|
|
7325
7341
|
...props,
|
|
7326
7342
|
provider,
|
|
7343
|
+
initialScrollTop: scrollPositions.current.get(provider?.id ?? "providers") ?? 0,
|
|
7327
7344
|
navigation,
|
|
7328
|
-
onNavigate: (next) => {
|
|
7345
|
+
onNavigate: (next, scrollTop) => {
|
|
7346
|
+
scrollPositions.current.set(provider?.id ?? "providers", scrollTop);
|
|
7329
7347
|
setNavigation(next == null ? "back" : "forward");
|
|
7330
7348
|
setProvider(next);
|
|
7331
7349
|
}
|
|
7332
7350
|
}, provider?.id ?? "providers");
|
|
7333
7351
|
}
|
|
7334
|
-
function ActionPickerPage({ portalRoot, connectors, disabled, selected, onToggle, provider, onNavigate, navigation }) {
|
|
7352
|
+
function ActionPickerPage({ portalRoot, connectors, disabled, selected, onToggle, provider, onNavigate, navigation, initialScrollTop }) {
|
|
7335
7353
|
const t = useTranslate();
|
|
7336
7354
|
const id = useId();
|
|
7337
7355
|
const [query, setQuery] = useState("");
|
|
@@ -7414,11 +7432,20 @@ function ActionPickerPage({ portalRoot, connectors, disabled, selected, onToggle
|
|
|
7414
7432
|
virtualizer.current?.scrollTo(0);
|
|
7415
7433
|
setVisibleIndex(0);
|
|
7416
7434
|
}, [term]);
|
|
7435
|
+
useLayoutEffect(() => {
|
|
7436
|
+
if (viewport == null) return;
|
|
7437
|
+
virtualizer.current?.scrollTo(initialScrollTop);
|
|
7438
|
+
viewport.scrollTop = initialScrollTop;
|
|
7439
|
+
}, [
|
|
7440
|
+
viewport,
|
|
7441
|
+
initialScrollTop,
|
|
7442
|
+
rows.length
|
|
7443
|
+
]);
|
|
7417
7444
|
return /* @__PURE__ */ jsxs("div", {
|
|
7418
7445
|
className: "flex min-h-0 min-w-0 flex-1 flex-col gap-3",
|
|
7419
7446
|
children: [/* @__PURE__ */ jsx("div", {
|
|
7420
7447
|
className: "flex shrink-0 items-center gap-2 px-4",
|
|
7421
|
-
children: /* @__PURE__ */ jsxs(InputGroup
|
|
7448
|
+
children: /* @__PURE__ */ jsxs(InputGroup, { children: [/* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx("i", {
|
|
7422
7449
|
"aria-hidden": "true",
|
|
7423
7450
|
className: "i-lucide-light:search size-4"
|
|
7424
7451
|
}) }), /* @__PURE__ */ jsx(InputGroupInput, {
|
|
@@ -7439,7 +7466,7 @@ function ActionPickerPage({ portalRoot, connectors, disabled, selected, onToggle
|
|
|
7439
7466
|
variant: "ghost",
|
|
7440
7467
|
size: "icon-sm",
|
|
7441
7468
|
"aria-label": t("actionPicker.back"),
|
|
7442
|
-
onClick: () => onNavigate(void 0),
|
|
7469
|
+
onClick: () => onNavigate(void 0, viewport?.scrollTop ?? 0),
|
|
7443
7470
|
children: /* @__PURE__ */ jsx("i", {
|
|
7444
7471
|
"aria-hidden": "true",
|
|
7445
7472
|
className: "i-lucide-light:chevron-left size-4"
|
|
@@ -7511,7 +7538,7 @@ function ActionPickerPage({ portalRoot, connectors, disabled, selected, onToggle
|
|
|
7511
7538
|
variant: "ghost",
|
|
7512
7539
|
size: "lg",
|
|
7513
7540
|
className: "group/app h-auto min-w-0 w-full justify-start gap-2.5 rounded-lg px-2.5 py-1.5 text-[13px] font-normal hover:bg-accent focus-visible:bg-accent",
|
|
7514
|
-
onClick: () => onNavigate(item),
|
|
7541
|
+
onClick: () => onNavigate(item, viewport?.scrollTop ?? 0),
|
|
7515
7542
|
children: [
|
|
7516
7543
|
/* @__PURE__ */ jsx(ProviderAppIcon, { src: item.icon }),
|
|
7517
7544
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -7733,6 +7760,7 @@ function AccountSelect({ connections, disabled, loading = false, id, invalid, wa
|
|
|
7733
7760
|
const t = useTranslate();
|
|
7734
7761
|
const [container, setContainer] = useState(null);
|
|
7735
7762
|
const selected = selectedConnection ?? connections.find((candidate) => candidate.connectionId == selectedId);
|
|
7763
|
+
const showLoading = loading && selected == null;
|
|
7736
7764
|
const builtInName = t("inspector.account.oomolBuiltIn");
|
|
7737
7765
|
const displayName = (connection) => accountDisplayName(connection, connection.displayName, builtInName);
|
|
7738
7766
|
const selectedLabel = selected == null ? selectedId == null ? void 0 : `${selectedId} (${t("inspector.account.unavailable")})` : `${displayName(selected)}${selected.isDefault ? ` (${t("inspector.account.teamDefault")})` : ""}`;
|
|
@@ -7781,18 +7809,18 @@ function AccountSelect({ connections, disabled, loading = false, id, invalid, wa
|
|
|
7781
7809
|
children: /* @__PURE__ */ jsx(SelectValue, {
|
|
7782
7810
|
className: !loading && selectedId != null ? "mr-5" : void 0,
|
|
7783
7811
|
placeholder: t("inspector.account.chooseAccount"),
|
|
7784
|
-
children:
|
|
7812
|
+
children: showLoading ? /* @__PURE__ */ jsxs("span", {
|
|
7785
7813
|
role: "status",
|
|
7786
7814
|
className: "flex min-w-0 items-center gap-2 text-muted-foreground",
|
|
7787
7815
|
children: [/* @__PURE__ */ jsx(Spinner, {}), /* @__PURE__ */ jsx("span", {
|
|
7788
7816
|
className: "truncate",
|
|
7789
7817
|
children: t("inspector.account.loading")
|
|
7790
7818
|
})]
|
|
7791
|
-
}) : selected == null ? selectedLabel : /* @__PURE__ */
|
|
7819
|
+
}) : selected == null ? selectedLabel : /* @__PURE__ */ jsx(AccountName, {
|
|
7792
7820
|
name: displayName(selected),
|
|
7793
7821
|
builtIn: selected.builtInAccount,
|
|
7794
7822
|
truncate: true
|
|
7795
|
-
})
|
|
7823
|
+
})
|
|
7796
7824
|
})
|
|
7797
7825
|
}), /* @__PURE__ */ jsxs(SelectContent, {
|
|
7798
7826
|
container,
|
|
@@ -8082,6 +8110,8 @@ function ActionSelectionDialog({ title, entries, connectors, prepareAction, disa
|
|
|
8082
8110
|
function ActionSelectionEditor({ entries, connectors, prepareAction, disabled, createEntry, onSave, onCancel, settings }) {
|
|
8083
8111
|
const t = useTranslate();
|
|
8084
8112
|
const [draft, setDraft] = useState(entries);
|
|
8113
|
+
const actions = useVal(connectors.$.actions);
|
|
8114
|
+
const connections = useVal(connectors.$.connections);
|
|
8085
8115
|
const [initialEntries] = useState(entries);
|
|
8086
8116
|
const [displayOrder, setDisplayOrder] = useState(entries.length === 0 ? [] : null);
|
|
8087
8117
|
const [prepared, setPrepared] = useState({});
|
|
@@ -8286,10 +8316,10 @@ function ActionSelectionEditor({ entries, connectors, prepareAction, disabled, c
|
|
|
8286
8316
|
className: "flex flex-col divide-y divide-border/50 px-4",
|
|
8287
8317
|
children: sortedEntries.map(({ entry, index }) => {
|
|
8288
8318
|
const resolved = prepared[entry.action];
|
|
8289
|
-
const action = resolved?.action ?? discovered.current.get(entry.action) ??
|
|
8319
|
+
const action = resolved?.action ?? discovered.current.get(entry.action) ?? actions[entry.action];
|
|
8290
8320
|
const accounts = resolved?.connections ?? [];
|
|
8291
|
-
const selected =
|
|
8292
|
-
const accountInvalid = action?.authenticated && entry.connectionId != null &&
|
|
8321
|
+
const selected = connections.find((account) => account.connectionId == entry.connectionId);
|
|
8322
|
+
const accountInvalid = resolved != null && action?.authenticated && entry.connectionId != null && !accounts.some((account) => account.connectionId == entry.connectionId && account.status == "active");
|
|
8293
8323
|
return /* @__PURE__ */ jsxs("section", {
|
|
8294
8324
|
className: "grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-2.5 gap-y-1 py-4 first:pt-1 last:pb-1",
|
|
8295
8325
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -8368,29 +8398,27 @@ function ActionSelectionEditor({ entries, connectors, prepareAction, disabled, c
|
|
|
8368
8398
|
]
|
|
8369
8399
|
}), /* @__PURE__ */ jsx("div", {
|
|
8370
8400
|
className: "open-flow-property-panel col-start-2 flex min-h-[30px] min-w-0 items-center [&>*]:w-full",
|
|
8371
|
-
children: resolved == null
|
|
8401
|
+
children: resolved == null && preparationErrors[entry.action] != null ? /* @__PURE__ */ jsx(AccountControlButton, {
|
|
8372
8402
|
status: "danger",
|
|
8373
8403
|
disabled,
|
|
8374
8404
|
label: t("inspector.account.retry"),
|
|
8375
8405
|
hint: preparationErrors[entry.action],
|
|
8376
|
-
onClick: () =>
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
onChange: () => {},
|
|
8382
|
-
onManage: void 0
|
|
8383
|
-
}) : !resolved.action.authenticated ? /* @__PURE__ */ jsx("div", {
|
|
8406
|
+
onClick: () => {
|
|
8407
|
+
connectors.retryAction(entry.action);
|
|
8408
|
+
setAttempt((value) => value + 1);
|
|
8409
|
+
}
|
|
8410
|
+
}) : action?.authenticated === false ? /* @__PURE__ */ jsx("div", {
|
|
8384
8411
|
className: "text-muted-foreground",
|
|
8385
8412
|
children: t("actionPicker.noAccount")
|
|
8386
8413
|
}) : /* @__PURE__ */ jsx(AccountSelect, {
|
|
8414
|
+
loading: resolved == null,
|
|
8387
8415
|
connections: accounts.filter((account) => account.status == "active"),
|
|
8388
8416
|
selectedConnection: selected,
|
|
8389
8417
|
selectedId: entry.connectionId,
|
|
8390
8418
|
invalid: accountInvalid === true,
|
|
8391
8419
|
warning: entry.connectionId == null,
|
|
8392
8420
|
addWhenEmpty: true,
|
|
8393
|
-
label: t("actionPicker.accountFor", { action:
|
|
8421
|
+
label: t("actionPicker.accountFor", { action: action?.name ?? entry.action }),
|
|
8394
8422
|
disabled,
|
|
8395
8423
|
onChange: (connectionId) => {
|
|
8396
8424
|
const { connectionId: _previous, ...rest } = entry;
|
|
@@ -8399,7 +8427,7 @@ function ActionSelectionEditor({ entries, connectors, prepareAction, disabled, c
|
|
|
8399
8427
|
connectionId
|
|
8400
8428
|
});
|
|
8401
8429
|
},
|
|
8402
|
-
onManage: () => void connectors.connect(resolved.action.serviceId).catch((cause) => setError(String(cause)))
|
|
8430
|
+
onManage: resolved == null ? void 0 : () => void connectors.connect(resolved.action.serviceId).catch((cause) => setError(String(cause)))
|
|
8403
8431
|
})
|
|
8404
8432
|
})]
|
|
8405
8433
|
}, entry.id ?? entry.action);
|
|
@@ -8751,11 +8779,15 @@ function MenuHeader({ children }) {
|
|
|
8751
8779
|
}
|
|
8752
8780
|
//#endregion
|
|
8753
8781
|
//#region src/form/browser/editorComponentSelect.tsx
|
|
8754
|
-
function EditorComponentSelect({ schema, id, name, disabled, invalid, readOnly, compact = true, showIcon = true, readOnlySurface = false, showArrayItemType = false, menuTitle, addon = false, disclosure, onChange }) {
|
|
8782
|
+
function EditorComponentSelect({ schema, id, name, disabled, invalid, readOnly, compact = true, showIcon = true, readOnlySurface = false, showArrayItemType = false, menuTitle, addon = false, valueOnly = false, disclosure, onChange }) {
|
|
8755
8783
|
const t = useTranslate();
|
|
8756
8784
|
const [container, setContainer] = useState(null);
|
|
8757
8785
|
const selectedComponent = editorComponent(schema);
|
|
8758
|
-
const label = t(`valueEditor.components.${selectedComponent}`);
|
|
8786
|
+
const label = t(valueOnly && selectedComponent === "json" ? "valueEditor.any" : `valueEditor.components.${selectedComponent}`);
|
|
8787
|
+
const accessibleLabel = valueOnly ? t("valueEditor.valueDataType", {
|
|
8788
|
+
name,
|
|
8789
|
+
type: label
|
|
8790
|
+
}) : `${t("valueEditor.type", { name })}: ${label}`;
|
|
8759
8791
|
if (showArrayItemType && selectedComponent === "array" && !Array.isArray(objectValue(schema)?.items)) {
|
|
8760
8792
|
const source = objectValue(schema) ?? {};
|
|
8761
8793
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -8800,7 +8832,7 @@ function EditorComponentSelect({ schema, id, name, disabled, invalid, readOnly,
|
|
|
8800
8832
|
if (readOnly) return /* @__PURE__ */ jsx(FieldTypeDisplay, {
|
|
8801
8833
|
id,
|
|
8802
8834
|
label,
|
|
8803
|
-
accessibleLabel
|
|
8835
|
+
accessibleLabel,
|
|
8804
8836
|
icon: showIcon && /* @__PURE__ */ jsx(EditorComponentIcon, { component: selectedComponent }),
|
|
8805
8837
|
compact,
|
|
8806
8838
|
addon,
|
|
@@ -8809,7 +8841,7 @@ function EditorComponentSelect({ schema, id, name, disabled, invalid, readOnly,
|
|
|
8809
8841
|
});
|
|
8810
8842
|
const items = Object.values(editorGroups).flat().map((value) => ({
|
|
8811
8843
|
value,
|
|
8812
|
-
label: t(`valueEditor.components.${value}`)
|
|
8844
|
+
label: t(valueOnly && value === "json" ? "valueEditor.any" : `valueEditor.components.${value}`)
|
|
8813
8845
|
}));
|
|
8814
8846
|
return /* @__PURE__ */ jsx("div", {
|
|
8815
8847
|
ref: setContainer,
|
|
@@ -8826,7 +8858,7 @@ function EditorComponentSelect({ schema, id, name, disabled, invalid, readOnly,
|
|
|
8826
8858
|
id,
|
|
8827
8859
|
size: "field",
|
|
8828
8860
|
"aria-invalid": invalid,
|
|
8829
|
-
"aria-label":
|
|
8861
|
+
"aria-label": accessibleLabel,
|
|
8830
8862
|
variant: addon ? "addon" : "default",
|
|
8831
8863
|
className: addon ? void 0 : fieldSelectTriggerClass
|
|
8832
8864
|
}),
|
|
@@ -8848,15 +8880,23 @@ function EditorComponentSelect({ schema, id, name, disabled, invalid, readOnly,
|
|
|
8848
8880
|
children: /* @__PURE__ */ jsxs(SelectGroup, {
|
|
8849
8881
|
className: "p-0",
|
|
8850
8882
|
"aria-label": menuTitle ?? t("valueEditor.typeTitle"),
|
|
8851
|
-
children: [
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8883
|
+
children: [
|
|
8884
|
+
/* @__PURE__ */ jsx(MenuHeader, { children: menuTitle ?? t("valueEditor.typeTitle") }),
|
|
8885
|
+
valueOnly && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(SelectItem, {
|
|
8886
|
+
value: "json",
|
|
8887
|
+
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",
|
|
8888
|
+
children: [showIcon && /* @__PURE__ */ jsx(EditorComponentIcon, { component: "json" }), t("valueEditor.any")]
|
|
8889
|
+
}), /* @__PURE__ */ jsx(SelectSeparator, { className: "mx-2 bg-border/50" })] }),
|
|
8890
|
+
Object.entries(editorGroups).map(([group, components], index) => /* @__PURE__ */ jsxs(Fragment, { children: [index > 0 && /* @__PURE__ */ jsx(SelectSeparator, { className: "mx-2 bg-border/50" }), /* @__PURE__ */ jsx(SelectGroup, {
|
|
8891
|
+
"aria-label": t(`valueEditor.componentGroups.${group}`),
|
|
8892
|
+
className: "p-0",
|
|
8893
|
+
children: components.filter((component) => !valueOnly || component !== "json").map((component) => /* @__PURE__ */ jsxs(SelectItem, {
|
|
8894
|
+
value: component,
|
|
8895
|
+
className: selectionMenuItemClass,
|
|
8896
|
+
children: [showIcon && /* @__PURE__ */ jsx(EditorComponentIcon, { component }), t(`valueEditor.components.${component}`)]
|
|
8897
|
+
}, component))
|
|
8898
|
+
})] }, group))
|
|
8899
|
+
]
|
|
8860
8900
|
})
|
|
8861
8901
|
})]
|
|
8862
8902
|
})
|
|
@@ -11382,7 +11422,7 @@ function ColorEditor({ value, schema, label, disabled, onChange, path, onDraftIs
|
|
|
11382
11422
|
return /* @__PURE__ */ jsxs("div", {
|
|
11383
11423
|
ref: setContainer,
|
|
11384
11424
|
className: valueEditor_module_default.errorAnchor,
|
|
11385
|
-
children: [/* @__PURE__ */ jsxs(InputGroup
|
|
11425
|
+
children: [/* @__PURE__ */ jsxs(InputGroup, {
|
|
11386
11426
|
className: "h-[30px]",
|
|
11387
11427
|
children: [/* @__PURE__ */ jsx(InputGroupInput, {
|
|
11388
11428
|
className: "h-full min-w-0 px-2 text-xs md:text-xs",
|
|
@@ -21477,7 +21517,7 @@ function DateEditor({ value, onChange, label, disabled, invalid, format }) {
|
|
|
21477
21517
|
return /* @__PURE__ */ jsx("div", {
|
|
21478
21518
|
ref: setContainer,
|
|
21479
21519
|
className: "min-w-0",
|
|
21480
|
-
children: /* @__PURE__ */ jsxs(InputGroup
|
|
21520
|
+
children: /* @__PURE__ */ jsxs(InputGroup, {
|
|
21481
21521
|
className: "h-[30px]",
|
|
21482
21522
|
children: [/* @__PURE__ */ jsx(InputGroupInput, {
|
|
21483
21523
|
className: "h-full min-w-0 px-2 text-xs md:text-xs",
|
|
@@ -21565,6 +21605,7 @@ function ValueEditor(props) {
|
|
|
21565
21605
|
const source = objectValue(schema) ?? {};
|
|
21566
21606
|
const type = valueType$1(schema, value);
|
|
21567
21607
|
const presence = value === void 0 ? "unset" : value === null ? "null" : "value";
|
|
21608
|
+
const textValue = typeof value === "string" ? value : value === void 0 ? "" : JSON.stringify(value);
|
|
21568
21609
|
return type === "boolean" ? /* @__PURE__ */ jsxs("div", {
|
|
21569
21610
|
className: valueEditor_module_default.booleanControl,
|
|
21570
21611
|
children: [/* @__PURE__ */ jsx(Button$1, {
|
|
@@ -21636,7 +21677,7 @@ function ValueEditor(props) {
|
|
|
21636
21677
|
className: value === "" ? valueEditor_module_default.emptyString : void 0,
|
|
21637
21678
|
placeholder: t(value === "" ? "valueEditor.emptyStringValue" : "valueEditor.unset"),
|
|
21638
21679
|
readOnly: disabled,
|
|
21639
|
-
value:
|
|
21680
|
+
value: textValue,
|
|
21640
21681
|
onChange: (event) => onChange(event.target.value)
|
|
21641
21682
|
}) : /* @__PURE__ */ jsx(Input$1, {
|
|
21642
21683
|
id,
|
|
@@ -21645,7 +21686,7 @@ function ValueEditor(props) {
|
|
|
21645
21686
|
className: value === "" ? valueEditor_module_default.emptyString : void 0,
|
|
21646
21687
|
placeholder: t(value === "" ? "valueEditor.emptyStringValue" : "valueEditor.unset"),
|
|
21647
21688
|
readOnly: disabled,
|
|
21648
|
-
value:
|
|
21689
|
+
value: textValue,
|
|
21649
21690
|
onChange: (event) => onChange(event.target.value)
|
|
21650
21691
|
})] });
|
|
21651
21692
|
}
|
|
@@ -21799,98 +21840,6 @@ function ValueTools({ label, container, raw, danger, onReset, onClear, onToggleJ
|
|
|
21799
21840
|
});
|
|
21800
21841
|
}
|
|
21801
21842
|
//#endregion
|
|
21802
|
-
//#region src/form/browser/valueTypeAddon.tsx
|
|
21803
|
-
/** Selects the stored data type of an unconstrained schema without changing the schema itself. */
|
|
21804
|
-
function DataTypeAddon({ name, value, any, disabled, onChange }) {
|
|
21805
|
-
const t = useTranslate();
|
|
21806
|
-
const [container, setContainer] = useState(null);
|
|
21807
|
-
const [open, setOpen] = useState(false);
|
|
21808
|
-
const selected = any || value === void 0 ? "any" : valueType$1({}, value);
|
|
21809
|
-
const label = t(selected === "any" ? "valueEditor.any" : `valueEditor.${selected}`);
|
|
21810
|
-
const accessibleLabel = t("valueEditor.valueDataType", {
|
|
21811
|
-
name,
|
|
21812
|
-
type: label
|
|
21813
|
-
});
|
|
21814
|
-
const icon = selected === "any" ? editorComponentIcons.json : editorComponentIcons[selected];
|
|
21815
|
-
if (disabled || !onChange) return /* @__PURE__ */ jsx(FieldTypeDisplay, {
|
|
21816
|
-
label,
|
|
21817
|
-
accessibleLabel,
|
|
21818
|
-
icon: /* @__PURE__ */ jsx("i", {
|
|
21819
|
-
"aria-hidden": "true",
|
|
21820
|
-
className: `${icon} inline-block shrink-0 text-base`
|
|
21821
|
-
}),
|
|
21822
|
-
addon: true
|
|
21823
|
-
});
|
|
21824
|
-
const items = [{
|
|
21825
|
-
value: "any",
|
|
21826
|
-
label: t("valueEditor.any")
|
|
21827
|
-
}, ...jsonDataTypes.map((type) => ({
|
|
21828
|
-
value: type,
|
|
21829
|
-
label: t(`valueEditor.${type}`)
|
|
21830
|
-
}))];
|
|
21831
|
-
return /* @__PURE__ */ jsx("div", {
|
|
21832
|
-
ref: setContainer,
|
|
21833
|
-
className: "min-w-0",
|
|
21834
|
-
children: /* @__PURE__ */ jsxs(Select$1, {
|
|
21835
|
-
open,
|
|
21836
|
-
onOpenChange: setOpen,
|
|
21837
|
-
value: selected,
|
|
21838
|
-
items,
|
|
21839
|
-
onValueChange: (next) => {
|
|
21840
|
-
if (next != null) onChange(next === "any" ? void 0 : next);
|
|
21841
|
-
},
|
|
21842
|
-
children: [/* @__PURE__ */ jsxs(Tooltip, {
|
|
21843
|
-
disabled: open,
|
|
21844
|
-
children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
21845
|
-
render: /* @__PURE__ */ jsx(SelectTrigger, {
|
|
21846
|
-
variant: "addon",
|
|
21847
|
-
"aria-label": accessibleLabel
|
|
21848
|
-
}),
|
|
21849
|
-
children: /* @__PURE__ */ jsx(SelectValue, {
|
|
21850
|
-
className: "flex-none justify-center",
|
|
21851
|
-
children: /* @__PURE__ */ jsx("i", {
|
|
21852
|
-
"aria-hidden": "true",
|
|
21853
|
-
className: `${icon} inline-block shrink-0 text-base`
|
|
21854
|
-
})
|
|
21855
|
-
})
|
|
21856
|
-
}), /* @__PURE__ */ jsx(TooltipContent, {
|
|
21857
|
-
container,
|
|
21858
|
-
children: label
|
|
21859
|
-
})]
|
|
21860
|
-
}), /* @__PURE__ */ jsx(SelectContent, {
|
|
21861
|
-
container,
|
|
21862
|
-
align: "start",
|
|
21863
|
-
alignItemWithTrigger: false,
|
|
21864
|
-
className: `min-w-36 ${selectionMenuContentClass}`,
|
|
21865
|
-
children: /* @__PURE__ */ jsxs(SelectGroup, {
|
|
21866
|
-
className: "p-0",
|
|
21867
|
-
"aria-label": t("valueEditor.dataTypeTitle"),
|
|
21868
|
-
children: [
|
|
21869
|
-
/* @__PURE__ */ jsx(MenuHeader, { children: t("valueEditor.dataTypeTitle") }),
|
|
21870
|
-
/* @__PURE__ */ jsxs(SelectItem, {
|
|
21871
|
-
value: "any",
|
|
21872
|
-
className: selectionMenuItemClass,
|
|
21873
|
-
children: [/* @__PURE__ */ jsx("i", {
|
|
21874
|
-
"aria-hidden": "true",
|
|
21875
|
-
className: `${editorComponentIcons.json} inline-block shrink-0 text-base`
|
|
21876
|
-
}), t("valueEditor.any")]
|
|
21877
|
-
}),
|
|
21878
|
-
/* @__PURE__ */ jsx(SelectSeparator, { className: "mx-2 bg-border/50" }),
|
|
21879
|
-
jsonDataTypes.map((type) => /* @__PURE__ */ jsxs(SelectItem, {
|
|
21880
|
-
value: type,
|
|
21881
|
-
className: selectionMenuItemClass,
|
|
21882
|
-
children: [/* @__PURE__ */ jsx("i", {
|
|
21883
|
-
"aria-hidden": "true",
|
|
21884
|
-
className: `${editorComponentIcons[type]} inline-block shrink-0 text-base`
|
|
21885
|
-
}), t(`valueEditor.${type}`)]
|
|
21886
|
-
}, type))
|
|
21887
|
-
]
|
|
21888
|
-
})
|
|
21889
|
-
})]
|
|
21890
|
-
})
|
|
21891
|
-
});
|
|
21892
|
-
}
|
|
21893
|
-
//#endregion
|
|
21894
21843
|
//#region src/form/browser/fieldValueEditor.tsx
|
|
21895
21844
|
/** Controlled JSON value editing. It has no graph, port, persistence, or theme context. */
|
|
21896
21845
|
function FieldValueEditor(suppliedProps) {
|
|
@@ -21902,24 +21851,29 @@ function FieldValueEditor(suppliedProps) {
|
|
|
21902
21851
|
const { schema, value, onChange, label, nullable, disabled, onDraftIssue, depth = 0 } = props;
|
|
21903
21852
|
const t = useTranslate();
|
|
21904
21853
|
const id = useId();
|
|
21905
|
-
const source = objectValue(schema) ?? {};
|
|
21906
21854
|
const valueEditable = props.valueEditable !== false;
|
|
21907
21855
|
const unconstrained = isUnconstrainedSchema(schema);
|
|
21908
21856
|
const definitionEditable = props.onDefinitionChange != null && !disabled;
|
|
21909
|
-
const showDataType =
|
|
21857
|
+
const showDataType = editorComponent(schema) === "json" && !definitionEditable && valueEditable && props.valueSuffix == null && props.editor == null;
|
|
21858
|
+
const [selectedEditorSchema, setSelectedEditorSchema] = useState();
|
|
21859
|
+
const editorSchema = showDataType ? selectedEditorSchema ?? defaultValueEditorSchema(schema) : schema;
|
|
21860
|
+
const editorProps = {
|
|
21861
|
+
...props,
|
|
21862
|
+
schema: editorSchema
|
|
21863
|
+
};
|
|
21864
|
+
const source = objectValue(editorSchema) ?? {};
|
|
21910
21865
|
const compactValue = props.compact === true || props.header != null || props.valueAddon != null || props.valueSuffix != null || showDataType;
|
|
21911
21866
|
const state = fieldValueState(schema, value, nullable);
|
|
21912
21867
|
const { presence, missing, invalidNull } = state;
|
|
21913
|
-
const shape = fieldValueShape(
|
|
21914
|
-
compactCollection: compactValue && props.header == null,
|
|
21868
|
+
const shape = fieldValueShape(editorSchema, value, {
|
|
21869
|
+
compactCollection: compactValue && props.header == null && !showDataType,
|
|
21915
21870
|
objectChild: props.objectChild,
|
|
21916
21871
|
depth
|
|
21917
21872
|
});
|
|
21918
21873
|
const { type, enumeration, choiceOptions } = shape;
|
|
21919
21874
|
const complex = shape.complex || unconstrained && definitionEditable;
|
|
21920
21875
|
const [container, setContainer] = useState(null);
|
|
21921
|
-
const [
|
|
21922
|
-
const jsonMode = raw || showDataType && value === void 0;
|
|
21876
|
+
const [jsonMode, setJsonMode] = useState(false);
|
|
21923
21877
|
const focusCreatedValue = useRef(false);
|
|
21924
21878
|
const [editorFocusRequest, setEditorFocusRequest] = useState(0);
|
|
21925
21879
|
const [optionsOpen, setOptionsOpen] = useState(false);
|
|
@@ -22033,25 +21987,29 @@ function FieldValueEditor(suppliedProps) {
|
|
|
22033
21987
|
const canReset = inlineTools && props.onReset != null && (showUnset || !!nullable && nullControl);
|
|
22034
21988
|
const canClear = inlineTools && state.canClear;
|
|
22035
21989
|
const canToggleJson = inlineTools && expanded && shape.collection && presence === "value";
|
|
22036
|
-
const arrayDefinition = props.header != null && source.type === "array" && !Array.isArray(source.items) && !choiceOptions;
|
|
22037
|
-
const
|
|
22038
|
-
if (
|
|
22039
|
-
|
|
21990
|
+
const arrayDefinition = !showDataType && props.header != null && source.type === "array" && !Array.isArray(source.items) && !choiceOptions;
|
|
21991
|
+
const changeValueEditor = (nextSchema) => {
|
|
21992
|
+
if (isUnconstrainedSchema(nextSchema)) {
|
|
21993
|
+
setSelectedEditorSchema(void 0);
|
|
21994
|
+
setJsonMode(true);
|
|
22040
21995
|
setExpanded(true);
|
|
22041
21996
|
setEditorFocusRequest((request) => request + 1);
|
|
22042
21997
|
} else {
|
|
22043
|
-
|
|
22044
|
-
|
|
21998
|
+
setSelectedEditorSchema(nextSchema);
|
|
21999
|
+
onChange(valueForEditor(nextSchema, value, { createIfUnset: true }));
|
|
22000
|
+
setJsonMode(false);
|
|
22045
22001
|
setExpanded(false);
|
|
22046
22002
|
setEditorFocusRequest(0);
|
|
22047
22003
|
}
|
|
22048
22004
|
};
|
|
22049
|
-
const dataTypeAddon = showDataType ? /* @__PURE__ */ jsx(
|
|
22005
|
+
const dataTypeAddon = showDataType ? /* @__PURE__ */ jsx(EditorComponentSelect, {
|
|
22006
|
+
schema: jsonMode ? {} : editorSchema,
|
|
22050
22007
|
name: label,
|
|
22051
|
-
|
|
22052
|
-
|
|
22053
|
-
|
|
22054
|
-
|
|
22008
|
+
menuTitle: t("valueEditor.dataTypeTitle"),
|
|
22009
|
+
addon: true,
|
|
22010
|
+
valueOnly: true,
|
|
22011
|
+
readOnly: disabled,
|
|
22012
|
+
onChange: changeValueEditor
|
|
22055
22013
|
}) : void 0;
|
|
22056
22014
|
const startAddon = props.valueAddon ?? dataTypeAddon;
|
|
22057
22015
|
const endAddon = props.valueSuffix ?? (props.valueAddon != null && dataTypeAddon != null ? dataTypeAddon : arrayDefinition ? /* @__PURE__ */ jsx(FieldTypeAddon, {
|
|
@@ -22070,7 +22028,7 @@ function FieldValueEditor(suppliedProps) {
|
|
|
22070
22028
|
const createValue = uncreatedText && valueEditable && !disabled ? () => {
|
|
22071
22029
|
onChange("");
|
|
22072
22030
|
setEditorFocusRequest((request) => request + 1);
|
|
22073
|
-
} : emptyCollection ? collectionCreateAction(
|
|
22031
|
+
} : emptyCollection ? collectionCreateAction(editorProps) : void 0;
|
|
22074
22032
|
const toggleExpanded = () => {
|
|
22075
22033
|
restorePreviewFocus.current = !!inlineExpansion && expanded;
|
|
22076
22034
|
setExpanded(!expanded);
|
|
@@ -22080,7 +22038,7 @@ function FieldValueEditor(suppliedProps) {
|
|
|
22080
22038
|
const clearTextItem = props.arrayChild && shape.text && !jsonMode && !complex;
|
|
22081
22039
|
onChange(clearTextItem ? "" : void 0);
|
|
22082
22040
|
setExpanded(shape.expandable);
|
|
22083
|
-
|
|
22041
|
+
setJsonMode(false);
|
|
22084
22042
|
setEditorFocusRequest((request) => clearTextItem ? request + 1 : 0);
|
|
22085
22043
|
};
|
|
22086
22044
|
const toolbar = /* @__PURE__ */ jsxs("div", {
|
|
@@ -22111,7 +22069,8 @@ function FieldValueEditor(suppliedProps) {
|
|
|
22111
22069
|
variant: "ghost",
|
|
22112
22070
|
disabled,
|
|
22113
22071
|
onClick: () => {
|
|
22114
|
-
|
|
22072
|
+
if (showDataType) setSelectedEditorSchema(void 0);
|
|
22073
|
+
setJsonMode(!jsonMode);
|
|
22115
22074
|
setExpanded(true);
|
|
22116
22075
|
},
|
|
22117
22076
|
"aria-pressed": jsonMode || complex,
|
|
@@ -22189,15 +22148,19 @@ function FieldValueEditor(suppliedProps) {
|
|
|
22189
22148
|
"data-field-prompt": invalid || void 0,
|
|
22190
22149
|
"data-field-control": true,
|
|
22191
22150
|
"aria-invalid": invalid || void 0,
|
|
22192
|
-
"aria-label": `${label} ${t("valueEditor.setValue")}`,
|
|
22193
|
-
disabled: disabled || !valueEditable,
|
|
22151
|
+
"aria-label": `${label} ${customUnset ? props.unset.label : t("valueEditor.setValue")}`,
|
|
22152
|
+
disabled: disabled || !valueEditable && props.unset?.onActivate == null,
|
|
22194
22153
|
onClick: () => {
|
|
22195
|
-
|
|
22154
|
+
if (customUnset && props.unset?.onActivate != null) {
|
|
22155
|
+
props.unset.onActivate();
|
|
22156
|
+
return;
|
|
22157
|
+
}
|
|
22158
|
+
const next = getDefaultValue(typeOfSchema(editorSchema), editorSchema);
|
|
22196
22159
|
focusCreatedValue.current = true;
|
|
22197
22160
|
onChange(next === void 0 ? getDefaultValue(type) : next);
|
|
22198
22161
|
if (type === "object" || type === "array" || source["ui:widget"] === "text") setExpanded(true);
|
|
22199
22162
|
},
|
|
22200
|
-
children: [/* @__PURE__ */ jsx("span", { children: customUnset ? props.unset.label : t("valueEditor.setValue") }), /* @__PURE__ */ jsx("i", {
|
|
22163
|
+
children: [/* @__PURE__ */ jsx("span", { children: customUnset ? props.unset.label : t("valueEditor.setValue") }), props.unset?.onActivate == null && /* @__PURE__ */ jsx("i", {
|
|
22201
22164
|
"aria-hidden": "true",
|
|
22202
22165
|
className: "i-lucide-light:pencil"
|
|
22203
22166
|
})]
|
|
@@ -22208,10 +22171,10 @@ function FieldValueEditor(suppliedProps) {
|
|
|
22208
22171
|
invalid,
|
|
22209
22172
|
focusRequest: expanded ? editorFocusRequest : 0
|
|
22210
22173
|
}) : props.editor !== void 0 ? props.editor : structured ? type === "object" ? /* @__PURE__ */ jsx(ObjectValueFields, {
|
|
22211
|
-
...
|
|
22174
|
+
...editorProps,
|
|
22212
22175
|
empty: presence !== "value"
|
|
22213
22176
|
}) : /* @__PURE__ */ jsx(ArrayValueFields, {
|
|
22214
|
-
...
|
|
22177
|
+
...editorProps,
|
|
22215
22178
|
empty: presence !== "value"
|
|
22216
22179
|
}) : (state.display === "null" || presence === "null") && !choiceOptions && !enumeration ? /* @__PURE__ */ jsx(Button$1, {
|
|
22217
22180
|
type: "button",
|
|
@@ -22223,7 +22186,7 @@ function FieldValueEditor(suppliedProps) {
|
|
|
22223
22186
|
"aria-invalid": invalid,
|
|
22224
22187
|
"aria-label": `${label} null`,
|
|
22225
22188
|
onClick: () => {
|
|
22226
|
-
const next = initialValue(
|
|
22189
|
+
const next = initialValue(editorSchema);
|
|
22227
22190
|
onChange(next == null && type !== "null" ? getDefaultValue(type) : next);
|
|
22228
22191
|
},
|
|
22229
22192
|
children: /* @__PURE__ */ jsx("span", {
|
|
@@ -22239,7 +22202,7 @@ function FieldValueEditor(suppliedProps) {
|
|
|
22239
22202
|
invalid,
|
|
22240
22203
|
multiple: !Array.isArray(source.enum),
|
|
22241
22204
|
onChange,
|
|
22242
|
-
onOptionsChange: props.onDefinitionChange ? (options, deletion) => {
|
|
22205
|
+
onOptionsChange: props.onDefinitionChange || showDataType ? (options, deletion) => {
|
|
22243
22206
|
const nextSchema = Array.isArray(source.enum) ? {
|
|
22244
22207
|
...source,
|
|
22245
22208
|
enum: options
|
|
@@ -22250,7 +22213,12 @@ function FieldValueEditor(suppliedProps) {
|
|
|
22250
22213
|
enum: options
|
|
22251
22214
|
}
|
|
22252
22215
|
};
|
|
22253
|
-
|
|
22216
|
+
const nextValue = valueForEditor(nextSchema, value);
|
|
22217
|
+
if (props.onDefinitionChange) props.onDefinitionChange(nextSchema, nextValue, deletion);
|
|
22218
|
+
else {
|
|
22219
|
+
setSelectedEditorSchema(nextSchema);
|
|
22220
|
+
onChange(nextValue);
|
|
22221
|
+
}
|
|
22254
22222
|
} : void 0
|
|
22255
22223
|
}) : enumeration ? /* @__PURE__ */ jsxs(FieldSelect, {
|
|
22256
22224
|
"aria-label": label,
|
|
@@ -22268,7 +22236,7 @@ function FieldValueEditor(suppliedProps) {
|
|
|
22268
22236
|
children: Array.isArray(optionLabels) && typeof optionLabels[index] === "string" ? optionLabels[index] : typeof item === "string" ? item : JSON.stringify(item)
|
|
22269
22237
|
}, index))]
|
|
22270
22238
|
}) : /* @__PURE__ */ jsx(ValueEditor, {
|
|
22271
|
-
...
|
|
22239
|
+
...editorProps,
|
|
22272
22240
|
onDraftIssue: reportDraftIssue,
|
|
22273
22241
|
invalid
|
|
22274
22242
|
}),
|
|
@@ -22365,7 +22333,8 @@ function FieldValueEditor(suppliedProps) {
|
|
|
22365
22333
|
onReset: canReset ? props.onReset : void 0,
|
|
22366
22334
|
onClear: canClear ? clearValue : void 0,
|
|
22367
22335
|
onToggleJson: canToggleJson ? () => {
|
|
22368
|
-
|
|
22336
|
+
if (showDataType) setSelectedEditorSchema(void 0);
|
|
22337
|
+
setJsonMode(!jsonMode);
|
|
22369
22338
|
if (!jsonMode) setEditorFocusRequest((request) => request + 1);
|
|
22370
22339
|
} : void 0
|
|
22371
22340
|
}),
|
|
@@ -22526,6 +22495,25 @@ function AgentInputSource({ disabled, readOnly, source, port, inputs, onChange,
|
|
|
22526
22495
|
});
|
|
22527
22496
|
}
|
|
22528
22497
|
//#endregion
|
|
22498
|
+
//#region src/workbench/browser/runtime/editor/purposeField.tsx
|
|
22499
|
+
function PurposeField({ compact = false, ...props }) {
|
|
22500
|
+
const t = useTranslate();
|
|
22501
|
+
const id = useId();
|
|
22502
|
+
return /* @__PURE__ */ jsxs(Field, {
|
|
22503
|
+
className: compact ? "gap-1.5" : "inspector-field-section",
|
|
22504
|
+
children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
22505
|
+
className: compact ? "text-xs font-normal text-muted-foreground" : "inspector-section-title",
|
|
22506
|
+
htmlFor: id,
|
|
22507
|
+
children: t("inspector.node.description")
|
|
22508
|
+
}), /* @__PURE__ */ jsx(Textarea, {
|
|
22509
|
+
...props,
|
|
22510
|
+
id,
|
|
22511
|
+
rows: compact ? 2 : void 0,
|
|
22512
|
+
className: cn$1("[--ui-control-hover-background:var(--ui-control-background,var(--ui-muted))] placeholder:opacity-70 placeholder:transition-opacity placeholder:duration-300 hover:placeholder:opacity-50 focus:placeholder:opacity-30 motion-reduce:placeholder:transition-none", compact && "min-h-16 max-h-40 resize-y text-xs md:text-xs")
|
|
22513
|
+
})]
|
|
22514
|
+
});
|
|
22515
|
+
}
|
|
22516
|
+
//#endregion
|
|
22529
22517
|
//#region src/workbench/browser/runtime/editor/agentTools.tsx
|
|
22530
22518
|
function EditableAgentTools({ config, disabled, inputs, connectors, prepareAction, onSave }) {
|
|
22531
22519
|
const t = useTranslate();
|
|
@@ -22548,7 +22536,8 @@ function EditableAgentTools({ config, disabled, inputs, connectors, prepareActio
|
|
|
22548
22536
|
className: "i-lucide-light:plus size-3.5"
|
|
22549
22537
|
}), t("actionPicker.triggerLabel")] }) : /* @__PURE__ */ jsx(IconStack, {
|
|
22550
22538
|
icons: summary.providers,
|
|
22551
|
-
count: summary.count
|
|
22539
|
+
count: summary.count,
|
|
22540
|
+
size: "sm"
|
|
22552
22541
|
})
|
|
22553
22542
|
}),
|
|
22554
22543
|
entries: config.tools,
|
|
@@ -22597,22 +22586,14 @@ function AgentToolSettings({ entry: tool, onChange, disabled, onValidChange, inp
|
|
|
22597
22586
|
})
|
|
22598
22587
|
})]
|
|
22599
22588
|
}),
|
|
22600
|
-
/* @__PURE__ */
|
|
22601
|
-
|
|
22602
|
-
|
|
22603
|
-
|
|
22604
|
-
|
|
22605
|
-
|
|
22606
|
-
|
|
22607
|
-
|
|
22608
|
-
readOnly: disabled,
|
|
22609
|
-
"aria-label": t("inspector.node.description"),
|
|
22610
|
-
value: tool.description,
|
|
22611
|
-
onChange: (event) => onChange?.({
|
|
22612
|
-
...tool,
|
|
22613
|
-
description: event.target.value
|
|
22614
|
-
})
|
|
22615
|
-
})]
|
|
22589
|
+
/* @__PURE__ */ jsx(PurposeField, {
|
|
22590
|
+
compact: true,
|
|
22591
|
+
readOnly: disabled,
|
|
22592
|
+
value: tool.description,
|
|
22593
|
+
onChange: (event) => onChange?.({
|
|
22594
|
+
...tool,
|
|
22595
|
+
description: event.target.value
|
|
22596
|
+
})
|
|
22616
22597
|
}),
|
|
22617
22598
|
tool.inputs.length > 0 && /* @__PURE__ */ jsx("div", { className: "h-px bg-border/50" }),
|
|
22618
22599
|
tool.inputs.map((port) => /* @__PURE__ */ jsx(AgentInputSource, {
|
|
@@ -22664,6 +22645,19 @@ function AgentTools(props) {
|
|
|
22664
22645
|
}) })] });
|
|
22665
22646
|
}
|
|
22666
22647
|
//#endregion
|
|
22648
|
+
//#region src/workbench/browser/runtime/editor/codeEditorPlaceholder.tsx
|
|
22649
|
+
function CodeEditorPlaceholder({ label }) {
|
|
22650
|
+
return /* @__PURE__ */ jsx("div", {
|
|
22651
|
+
className: "code-editor-placeholder",
|
|
22652
|
+
role: "status",
|
|
22653
|
+
"aria-label": label,
|
|
22654
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
22655
|
+
className: "code-editor-placeholder-gutter",
|
|
22656
|
+
"aria-hidden": "true"
|
|
22657
|
+
})
|
|
22658
|
+
});
|
|
22659
|
+
}
|
|
22660
|
+
//#endregion
|
|
22667
22661
|
//#region src/workbench/browser/runtime/editor/promptEditor.tsx
|
|
22668
22662
|
function PromptEditor({ ariaDescribedBy, invalid, value, inputs, disabled, theme, onChange, onSave }) {
|
|
22669
22663
|
const t = useTranslate();
|
|
@@ -22791,14 +22785,18 @@ function PromptEditor({ ariaDescribedBy, invalid, value, inputs, disabled, theme
|
|
|
22791
22785
|
if (!disabled) onSave();
|
|
22792
22786
|
}
|
|
22793
22787
|
},
|
|
22794
|
-
children: [
|
|
22795
|
-
|
|
22796
|
-
|
|
22797
|
-
|
|
22798
|
-
|
|
22799
|
-
|
|
22800
|
-
|
|
22801
|
-
|
|
22788
|
+
children: [
|
|
22789
|
+
/* @__PURE__ */ jsx("div", {
|
|
22790
|
+
className: "code-editor-host",
|
|
22791
|
+
ref: host
|
|
22792
|
+
}),
|
|
22793
|
+
state == "loading" && /* @__PURE__ */ jsx(CodeEditorPlaceholder, { label: t("inspector.task.editorLoading") }),
|
|
22794
|
+
state == "failed" && /* @__PURE__ */ jsx("span", {
|
|
22795
|
+
className: "code-editor-state",
|
|
22796
|
+
role: "alert",
|
|
22797
|
+
children: t("inspector.task.editorUnavailable")
|
|
22798
|
+
})
|
|
22799
|
+
]
|
|
22802
22800
|
});
|
|
22803
22801
|
}
|
|
22804
22802
|
//#endregion
|
|
@@ -23796,10 +23794,7 @@ function CodeEditor({ ariaDescribedBy, ariaLabel, diagnostics, disabled, errorLa
|
|
|
23796
23794
|
className: "code-editor-host",
|
|
23797
23795
|
ref: host
|
|
23798
23796
|
}),
|
|
23799
|
-
loading && /* @__PURE__ */ jsx(
|
|
23800
|
-
className: "code-editor-state",
|
|
23801
|
-
children: loadingLabel
|
|
23802
|
-
}),
|
|
23797
|
+
loading && /* @__PURE__ */ jsx(CodeEditorPlaceholder, { label: loadingLabel }),
|
|
23803
23798
|
failed && /* @__PURE__ */ jsx("span", {
|
|
23804
23799
|
className: "code-editor-state error",
|
|
23805
23800
|
children: errorLabel
|
|
@@ -24102,7 +24097,8 @@ function EditableCodeTaskSection({ connectorAccess, connectorCandidates, connect
|
|
|
24102
24097
|
className: "i-lucide-light:plus size-3.5"
|
|
24103
24098
|
}), t("actionPicker.triggerLabel")] }) : /* @__PURE__ */ jsx(IconStack, {
|
|
24104
24099
|
icons: summary.providers,
|
|
24105
|
-
count: summary.count
|
|
24100
|
+
count: summary.count,
|
|
24101
|
+
size: "sm"
|
|
24106
24102
|
})]
|
|
24107
24103
|
}),
|
|
24108
24104
|
entries: selectedActions,
|
|
@@ -24318,7 +24314,7 @@ function NativeSelect({ className, size = "default", ...props }) {
|
|
|
24318
24314
|
children: [/* @__PURE__ */ jsx("select", {
|
|
24319
24315
|
"data-slot": "native-select",
|
|
24320
24316
|
"data-size": size,
|
|
24321
|
-
className: "h-8 w-full min-w-0 appearance-none rounded-
|
|
24317
|
+
className: "h-8 w-full min-w-0 appearance-none rounded-[var(--ui-control-radius,calc(var(--ui-radius)_+_2px))] border border-input bg-[var(--ui-control-background,var(--ui-muted))] py-1 pr-8 pl-2.5 text-sm transition-colors outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground data-[slot=native-select]:focus-visible:text-field-focus data-[slot=native-select]:focus-visible:aria-invalid:invalid-text-field-focus disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive data-[size=sm]:h-7 data-[size=sm]:rounded-[var(--ui-control-radius,var(--ui-radius))] data-[size=sm]:py-0.5 dark:bg-[var(--ui-control-background,var(--ui-muted))] dark:hover:bg-input/50",
|
|
24322
24318
|
...props
|
|
24323
24319
|
}), /* @__PURE__ */ jsx(ChevronDown, {
|
|
24324
24320
|
className: "pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground select-none",
|
|
@@ -25072,7 +25068,7 @@ function SelectedSourceValue({ bound, readOnly, connected, sourceMissing, onInva
|
|
|
25072
25068
|
children: t("inspector.sources.checkFailed")
|
|
25073
25069
|
})] });
|
|
25074
25070
|
}
|
|
25075
|
-
function SourceValueEditor({ fixed = false, editor: customEditor, schema, label: fieldLabel, nullable, description: fieldDescription, presentation, upstream: providedUpstream, embedded = false, handleNames = [], value, connected, sourceMissing, onInvalidChange, validationError, variableName, variables, disabled, readOnly, onValue, onVariable, onReset }) {
|
|
25071
|
+
function SourceValueEditor({ fixed = false, sourceOnly = false, editor: customEditor, schema, label: fieldLabel, nullable, description: fieldDescription, presentation, upstream: providedUpstream, embedded = false, handleNames = [], value, connected, sourceMissing, onInvalidChange, validationError, variableName, variables, disabled, readOnly, onValue, onVariable, onReset }) {
|
|
25076
25072
|
const t = useTranslate();
|
|
25077
25073
|
const [sourceOpen, setSourceOpen] = useState(false);
|
|
25078
25074
|
const candidates = useInputSourceQuery(providedUpstream?.query?.candidates, sourceOpen);
|
|
@@ -25150,6 +25146,7 @@ function SourceValueEditor({ fixed = false, editor: customEditor, schema, label:
|
|
|
25150
25146
|
ref: setSourceContainer,
|
|
25151
25147
|
className: "flex items-center",
|
|
25152
25148
|
children: /* @__PURE__ */ jsxs(DropdownMenu, {
|
|
25149
|
+
open: sourceOpen,
|
|
25153
25150
|
onOpenChange: (open) => {
|
|
25154
25151
|
setSourceOpen(open);
|
|
25155
25152
|
if (open && variables.enabled) variables.onOpen?.();
|
|
@@ -25179,7 +25176,7 @@ function SourceValueEditor({ fixed = false, editor: customEditor, schema, label:
|
|
|
25179
25176
|
container: sourcePortal,
|
|
25180
25177
|
children: [
|
|
25181
25178
|
/* @__PURE__ */ jsx(MenuHeader, { children: t("inspector.sources.title") }),
|
|
25182
|
-
/* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
|
|
25179
|
+
!sourceOnly && /* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
|
|
25183
25180
|
value: sourceKind === "literal" ? literalSource : "",
|
|
25184
25181
|
onValueChange: () => {
|
|
25185
25182
|
if (bound) onVariable(void 0);
|
|
@@ -25348,7 +25345,7 @@ function SourceValueEditor({ fixed = false, editor: customEditor, schema, label:
|
|
|
25348
25345
|
variableCompatible,
|
|
25349
25346
|
variableName,
|
|
25350
25347
|
variables
|
|
25351
|
-
}) : llm ? /* @__PURE__ */ jsx(LlmInputEditor, {
|
|
25348
|
+
}) : llm && !sourceOnly ? /* @__PURE__ */ jsx(LlmInputEditor, {
|
|
25352
25349
|
readOnly,
|
|
25353
25350
|
addon: sourceControl,
|
|
25354
25351
|
schema,
|
|
@@ -25365,16 +25362,24 @@ function SourceValueEditor({ fixed = false, editor: customEditor, schema, label:
|
|
|
25365
25362
|
...presentation,
|
|
25366
25363
|
validationError,
|
|
25367
25364
|
onInvalidChange: connected || bound || sourceMissing ? void 0 : onInvalidChange,
|
|
25368
|
-
valueAddon: llm && !connected && !bound ? void 0 : sourceControl,
|
|
25365
|
+
valueAddon: llm && !sourceOnly && !connected && !bound ? void 0 : sourceControl,
|
|
25369
25366
|
description: presentation?.description ?? fieldDescription,
|
|
25370
25367
|
schema,
|
|
25371
25368
|
nullable,
|
|
25372
|
-
value,
|
|
25369
|
+
value: sourceOnly && !connected && !bound && !sourceMissing ? void 0 : value,
|
|
25370
|
+
unset: sourceOnly && !connected && !bound && !sourceMissing ? {
|
|
25371
|
+
label: t("inspector.sources.select"),
|
|
25372
|
+
required: true,
|
|
25373
|
+
onActivate: fixed ? void 0 : () => {
|
|
25374
|
+
setSourceOpen(true);
|
|
25375
|
+
if (variables.enabled) variables.onOpen?.();
|
|
25376
|
+
}
|
|
25377
|
+
} : void 0,
|
|
25373
25378
|
label: fieldLabel,
|
|
25374
25379
|
path: `/${fieldLabel.replaceAll("~", "~0").replaceAll("/", "~1")}`,
|
|
25375
25380
|
disabled,
|
|
25376
25381
|
onReset,
|
|
25377
|
-
valueEditable: !connected && !bound && !sourceMissing,
|
|
25382
|
+
valueEditable: !sourceOnly && !connected && !bound && !sourceMissing,
|
|
25378
25383
|
editor: customEditor ?? editor,
|
|
25379
25384
|
onDraftIssue: draftIssue,
|
|
25380
25385
|
onChange: (next, deletion) => onValue(next, deletion)
|
|
@@ -25894,21 +25899,13 @@ function ConditionBranchesEditor({ value: configuration, disabled, readOnly, onC
|
|
|
25894
25899
|
disabled: false,
|
|
25895
25900
|
onChange: renameOutput
|
|
25896
25901
|
})]
|
|
25897
|
-
}), /* @__PURE__ */
|
|
25898
|
-
|
|
25899
|
-
|
|
25900
|
-
|
|
25901
|
-
|
|
25902
|
-
|
|
25903
|
-
|
|
25904
|
-
rows: 2,
|
|
25905
|
-
className: "min-h-16 max-h-40 resize-y text-xs md:text-xs",
|
|
25906
|
-
value: item.description ?? "",
|
|
25907
|
-
onChange: (event) => save({
|
|
25908
|
-
...item,
|
|
25909
|
-
description: event.target.value
|
|
25910
|
-
})
|
|
25911
|
-
})]
|
|
25902
|
+
}), /* @__PURE__ */ jsx(PurposeField, {
|
|
25903
|
+
compact: true,
|
|
25904
|
+
value: item.description ?? "",
|
|
25905
|
+
onChange: (event) => save({
|
|
25906
|
+
...item,
|
|
25907
|
+
description: event.target.value
|
|
25908
|
+
})
|
|
25912
25909
|
})]
|
|
25913
25910
|
})
|
|
25914
25911
|
})
|
|
@@ -26775,23 +26772,14 @@ function PortSettingsFields({ port, names, disabled, showNullable, onChange }) {
|
|
|
26775
26772
|
})
|
|
26776
26773
|
})]
|
|
26777
26774
|
}),
|
|
26778
|
-
/* @__PURE__ */
|
|
26779
|
-
|
|
26780
|
-
|
|
26781
|
-
|
|
26782
|
-
|
|
26783
|
-
|
|
26784
|
-
|
|
26785
|
-
|
|
26786
|
-
rows: 2,
|
|
26787
|
-
className: "min-h-16 max-h-40 resize-y text-xs md:text-xs",
|
|
26788
|
-
value: port.description ?? "",
|
|
26789
|
-
readOnly: disabled,
|
|
26790
|
-
onChange: (event) => onChange({
|
|
26791
|
-
...port,
|
|
26792
|
-
description: event.target.value
|
|
26793
|
-
})
|
|
26794
|
-
})]
|
|
26775
|
+
/* @__PURE__ */ jsx(PurposeField, {
|
|
26776
|
+
compact: true,
|
|
26777
|
+
value: port.description ?? "",
|
|
26778
|
+
readOnly: disabled,
|
|
26779
|
+
onChange: (event) => onChange({
|
|
26780
|
+
...port,
|
|
26781
|
+
description: event.target.value
|
|
26782
|
+
})
|
|
26795
26783
|
}),
|
|
26796
26784
|
/* @__PURE__ */ jsxs(Field, {
|
|
26797
26785
|
className: "gap-1.5",
|
|
@@ -28093,26 +28081,533 @@ function LlmTaskSection({ selection, disabled, store }) {
|
|
|
28093
28081
|
//#endregion
|
|
28094
28082
|
//#region src/workbench/browser/runtime/editor/nodeDescription.tsx
|
|
28095
28083
|
/** The draft belongs to this field; the product revision owns the saved description. */
|
|
28096
|
-
function NodeDescription({ value, disabled = false, readOnly = false, onSave }) {
|
|
28084
|
+
function NodeDescription({ value, placeholder, disabled = false, readOnly = false, onSave }) {
|
|
28097
28085
|
const t = useTranslate();
|
|
28098
|
-
const id = useId();
|
|
28099
28086
|
const [draft, setDraft] = useState(value ?? "");
|
|
28100
28087
|
useEffect(() => setDraft(value ?? ""), [value]);
|
|
28101
|
-
return /* @__PURE__ */
|
|
28088
|
+
return /* @__PURE__ */ jsx(PurposeField, {
|
|
28089
|
+
readOnly: disabled || readOnly,
|
|
28090
|
+
placeholder: placeholder?.trim() || t("inspector.node.describe"),
|
|
28091
|
+
value: draft,
|
|
28092
|
+
onChange: (event) => setDraft(event.target.value),
|
|
28093
|
+
onBlur: () => {
|
|
28094
|
+
if (!disabled && !readOnly && draft !== (value ?? "")) onSave?.(draft === "" ? void 0 : draft);
|
|
28095
|
+
}
|
|
28096
|
+
});
|
|
28097
|
+
}
|
|
28098
|
+
//#endregion
|
|
28099
|
+
//#region src/openapi/common/documentSession.ts
|
|
28100
|
+
/** Owned by one mounted panel, never shared across nodes or persisted. */
|
|
28101
|
+
var OpenApiDocumentSession = class {
|
|
28102
|
+
#controller;
|
|
28103
|
+
#request;
|
|
28104
|
+
#value;
|
|
28105
|
+
#url;
|
|
28106
|
+
constructor(load) {
|
|
28107
|
+
this.load = load;
|
|
28108
|
+
}
|
|
28109
|
+
read(url, refresh = false) {
|
|
28110
|
+
if (this.#url == url && !refresh) {
|
|
28111
|
+
if (this.#value != null) return Promise.resolve(this.#value);
|
|
28112
|
+
if (this.#request != null) return this.#request;
|
|
28113
|
+
}
|
|
28114
|
+
this.clear();
|
|
28115
|
+
this.#url = url;
|
|
28116
|
+
const controller = new AbortController();
|
|
28117
|
+
this.#controller = controller;
|
|
28118
|
+
const request = this.load(url, controller.signal).then((value) => {
|
|
28119
|
+
if (controller.signal.aborted || this.#controller != controller) throw new Error("Document loading was cancelled.");
|
|
28120
|
+
listOperations(value);
|
|
28121
|
+
this.#value = value;
|
|
28122
|
+
return value;
|
|
28123
|
+
}).finally(() => {
|
|
28124
|
+
if (this.#controller == controller) this.#request = void 0;
|
|
28125
|
+
});
|
|
28126
|
+
this.#request = request;
|
|
28127
|
+
return request;
|
|
28128
|
+
}
|
|
28129
|
+
clear() {
|
|
28130
|
+
this.#controller?.abort();
|
|
28131
|
+
this.#controller = void 0;
|
|
28132
|
+
this.#value = void 0;
|
|
28133
|
+
this.#request = void 0;
|
|
28134
|
+
this.#url = void 0;
|
|
28135
|
+
}
|
|
28136
|
+
};
|
|
28137
|
+
//#endregion
|
|
28138
|
+
//#region src/workbench/browser/runtime/editor/openApiSection.tsx
|
|
28139
|
+
function OpenApiSection({ task, disabled, load, onSave, credentials }) {
|
|
28140
|
+
const t = useTranslate();
|
|
28141
|
+
const config = task.executor;
|
|
28142
|
+
const [url, setUrl] = useState(config.sourceUrl);
|
|
28143
|
+
const [address, setAddress] = useState(config.serverUrl);
|
|
28144
|
+
const [document, setDocument] = useState();
|
|
28145
|
+
const [serverError, setServerError] = useState("");
|
|
28146
|
+
const [operationFailure, setOperationFailure] = useState("");
|
|
28147
|
+
const [documentError, setDocumentError] = useState("");
|
|
28148
|
+
const [container, setContainer] = useState(null);
|
|
28149
|
+
const [operationsOpen, setOperationsOpen] = useState(false);
|
|
28150
|
+
const [loading, setLoading] = useState(false);
|
|
28151
|
+
const [search, setSearch] = useState("");
|
|
28152
|
+
const [serverIndex, setServerIndex] = useState();
|
|
28153
|
+
const [serversOpen, setServersOpen] = useState(false);
|
|
28154
|
+
const [serverVariables, setServerVariables] = useState({});
|
|
28155
|
+
const [keyName, setKeyName] = useState(config.auth.find((item) => item.id == "manual")?.name ?? "X-API-Key");
|
|
28156
|
+
const keyLocation = config.auth.find((item) => item.id == "manual")?.in ?? "header";
|
|
28157
|
+
const loadRef = useRef(load);
|
|
28158
|
+
loadRef.current = load;
|
|
28159
|
+
const [session] = useState(() => new OpenApiDocumentSession((source, signal) => loadRef.current(source, signal)));
|
|
28160
|
+
const generation = useRef(0);
|
|
28161
|
+
useEffect(() => () => {
|
|
28162
|
+
generation.current++;
|
|
28163
|
+
session.clear();
|
|
28164
|
+
}, [session]);
|
|
28165
|
+
useEffect(() => {
|
|
28166
|
+
setAddress(config.serverUrl);
|
|
28167
|
+
}, [config.serverUrl]);
|
|
28168
|
+
async function read(refresh = false) {
|
|
28169
|
+
const current = ++generation.current;
|
|
28170
|
+
if (!url.trim()) return;
|
|
28171
|
+
setLoading(true);
|
|
28172
|
+
setDocumentError("");
|
|
28173
|
+
try {
|
|
28174
|
+
const result = await session.read(url, refresh);
|
|
28175
|
+
if (generation.current != current) return;
|
|
28176
|
+
setDocument(result);
|
|
28177
|
+
return result;
|
|
28178
|
+
} catch (error) {
|
|
28179
|
+
if (generation.current == current) {
|
|
28180
|
+
setDocument(void 0);
|
|
28181
|
+
setOperationsOpen(false);
|
|
28182
|
+
setDocumentError(error.message);
|
|
28183
|
+
}
|
|
28184
|
+
} finally {
|
|
28185
|
+
if (generation.current == current) setLoading(false);
|
|
28186
|
+
}
|
|
28187
|
+
}
|
|
28188
|
+
async function save(next, field = "operation") {
|
|
28189
|
+
const report = field == "serverUrl" ? setServerError : setOperationFailure;
|
|
28190
|
+
try {
|
|
28191
|
+
if (next.serverUrl) {
|
|
28192
|
+
const server = new URL(next.serverUrl);
|
|
28193
|
+
if (!["http:", "https:"].includes(server.protocol) || server.username || server.password || server.search || server.hash) throw new Error("Enter an HTTP(S) server URL without credentials, query or fragment.");
|
|
28194
|
+
}
|
|
28195
|
+
if (await onSave(task, openApiTask(next, task.name))) {
|
|
28196
|
+
report("");
|
|
28197
|
+
setOperationsOpen(false);
|
|
28198
|
+
} else report(t("openapi.saveFailed"));
|
|
28199
|
+
} catch (error) {
|
|
28200
|
+
report(error.message);
|
|
28201
|
+
}
|
|
28202
|
+
}
|
|
28203
|
+
const savedSelection = !!config.path && url == config.sourceUrl;
|
|
28204
|
+
const issues = openApiFieldIssues({
|
|
28205
|
+
...task,
|
|
28206
|
+
executor: {
|
|
28207
|
+
...config,
|
|
28208
|
+
sourceUrl: url,
|
|
28209
|
+
serverUrl: address
|
|
28210
|
+
}
|
|
28211
|
+
});
|
|
28212
|
+
const sourceIssue = issues.find((issue) => issue.field == "sourceUrl");
|
|
28213
|
+
const showOperations = savedSelection || !!url.trim() && !documentError && document != null;
|
|
28214
|
+
const urlError = loading ? void 0 : documentError || (sourceIssue ? !url.trim() ? t("openapi.urlRequired") : sourceIssue.message : !savedSelection && document == null ? t("openapi.loadRequired") : void 0);
|
|
28215
|
+
const operationError = operationFailure || (!savedSelection ? t("openapi.operationRequired") : issues.find((issue) => issue.field == "operation")?.message);
|
|
28216
|
+
const addressError = serverError || issues.find((issue) => issue.field == "serverUrl")?.message;
|
|
28217
|
+
const operations = document == null ? [] : listOperations(document);
|
|
28218
|
+
const grouped = operations.some((op) => op.tag.trim() != "");
|
|
28219
|
+
const query = search.toLowerCase();
|
|
28220
|
+
const choices = operations.filter((op) => `${op.tag} ${op.label} ${op.method} ${op.path}`.toLowerCase().includes(query));
|
|
28221
|
+
const groups = Map.groupBy(choices, (op) => op.tag.trim());
|
|
28222
|
+
const untagged = groups.get("");
|
|
28223
|
+
if (untagged != null) {
|
|
28224
|
+
groups.delete("");
|
|
28225
|
+
groups.set("", untagged);
|
|
28226
|
+
}
|
|
28227
|
+
const availableServers = config.path ? (() => {
|
|
28228
|
+
try {
|
|
28229
|
+
return servers(document ?? config.document, config.path, config.method);
|
|
28230
|
+
} catch {
|
|
28231
|
+
return [];
|
|
28232
|
+
}
|
|
28233
|
+
})() : [];
|
|
28234
|
+
const selectedServer = serverIndex == null ? void 0 : availableServers[serverIndex];
|
|
28235
|
+
const security = config.path ? securityOptions(config.document, config.path, config.method) : [];
|
|
28236
|
+
const declaredAuth = security.findIndex((entry) => dequal(entry.auth, config.auth));
|
|
28237
|
+
const manualAuth = config.auth.find((item) => item.id == "manual");
|
|
28238
|
+
function useServer(index, variables = {}) {
|
|
28239
|
+
try {
|
|
28240
|
+
const serverUrl = serverAddress(availableServers[index], url, variables);
|
|
28241
|
+
setServerIndex(index);
|
|
28242
|
+
setServerVariables(variables);
|
|
28243
|
+
setAddress(serverUrl);
|
|
28244
|
+
setServersOpen(false);
|
|
28245
|
+
save({
|
|
28246
|
+
...config,
|
|
28247
|
+
serverUrl
|
|
28248
|
+
}, "serverUrl");
|
|
28249
|
+
} catch (error) {
|
|
28250
|
+
setServerError(error.message);
|
|
28251
|
+
}
|
|
28252
|
+
}
|
|
28253
|
+
function useAuth(type, name = keyName, location = keyLocation) {
|
|
28254
|
+
save({
|
|
28255
|
+
...config,
|
|
28256
|
+
auth: [{
|
|
28257
|
+
id: "manual",
|
|
28258
|
+
type,
|
|
28259
|
+
...type == "apiKey" ? {
|
|
28260
|
+
name,
|
|
28261
|
+
in: location
|
|
28262
|
+
} : {}
|
|
28263
|
+
}]
|
|
28264
|
+
});
|
|
28265
|
+
}
|
|
28266
|
+
const renderOperation = (op) => /* @__PURE__ */ jsxs(Button$1, {
|
|
28267
|
+
className: `w-full h-auto justify-start px-2 whitespace-normal text-left ${selectionMenuItemClass}`,
|
|
28268
|
+
variant: "ghost",
|
|
28269
|
+
disabled,
|
|
28270
|
+
onClick: () => {
|
|
28271
|
+
try {
|
|
28272
|
+
save(selectOperation(document, url, op.path, op.method));
|
|
28273
|
+
} catch (error) {
|
|
28274
|
+
setOperationFailure(error.message);
|
|
28275
|
+
}
|
|
28276
|
+
},
|
|
28277
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
28278
|
+
className: "shrink-0 self-start font-mono text-muted-foreground",
|
|
28279
|
+
children: op.method.toUpperCase()
|
|
28280
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
28281
|
+
className: "min-w-0 break-words",
|
|
28282
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
28283
|
+
className: "font-mono text-foreground",
|
|
28284
|
+
children: op.path
|
|
28285
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
28286
|
+
className: "pl-2 text-muted-foreground",
|
|
28287
|
+
children: [" ", op.label]
|
|
28288
|
+
})]
|
|
28289
|
+
})]
|
|
28290
|
+
}, `${op.method} ${op.path}`);
|
|
28291
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Field, {
|
|
28102
28292
|
className: "inspector-field-section",
|
|
28293
|
+
"data-inspector-section": "task",
|
|
28103
28294
|
children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
28104
28295
|
className: "inspector-section-title",
|
|
28105
|
-
|
|
28106
|
-
|
|
28107
|
-
|
|
28108
|
-
|
|
28109
|
-
|
|
28110
|
-
|
|
28111
|
-
|
|
28112
|
-
|
|
28113
|
-
|
|
28114
|
-
|
|
28115
|
-
|
|
28296
|
+
children: "OpenAPI"
|
|
28297
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
28298
|
+
ref: setContainer,
|
|
28299
|
+
className: "node-settings flex flex-col gap-3",
|
|
28300
|
+
children: [
|
|
28301
|
+
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
28302
|
+
htmlFor: "openapi-url",
|
|
28303
|
+
children: t("openapi.document")
|
|
28304
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
28305
|
+
className: "flex items-start gap-2",
|
|
28306
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
28307
|
+
className: "min-w-0 flex-1",
|
|
28308
|
+
children: /* @__PURE__ */ jsx(ValueEditorFeedback, {
|
|
28309
|
+
error: urlError,
|
|
28310
|
+
children: (errorId) => /* @__PURE__ */ jsx(Input$1, {
|
|
28311
|
+
"aria-invalid": urlError != null,
|
|
28312
|
+
"aria-describedby": errorId,
|
|
28313
|
+
id: "openapi-url",
|
|
28314
|
+
disabled,
|
|
28315
|
+
value: url,
|
|
28316
|
+
onChange: (event) => {
|
|
28317
|
+
generation.current++;
|
|
28318
|
+
session.clear();
|
|
28319
|
+
setDocument(void 0);
|
|
28320
|
+
setOperationsOpen(false);
|
|
28321
|
+
setLoading(false);
|
|
28322
|
+
setDocumentError("");
|
|
28323
|
+
setOperationFailure("");
|
|
28324
|
+
setUrl(event.target.value);
|
|
28325
|
+
}
|
|
28326
|
+
})
|
|
28327
|
+
})
|
|
28328
|
+
}), /* @__PURE__ */ jsx(Button$1, {
|
|
28329
|
+
variant: "outline",
|
|
28330
|
+
size: "sm",
|
|
28331
|
+
disabled: disabled || loading || !url.trim(),
|
|
28332
|
+
onClick: async () => {
|
|
28333
|
+
const value = await read(true);
|
|
28334
|
+
if (value != null) {
|
|
28335
|
+
if (!savedSelection) return;
|
|
28336
|
+
try {
|
|
28337
|
+
const next = selectOperation(value, url, config.path, config.method);
|
|
28338
|
+
save({
|
|
28339
|
+
...next,
|
|
28340
|
+
serverUrl: config.serverUrl,
|
|
28341
|
+
auth: securityOptions(next.document, next.path, next.method).some((choice) => dequal(choice.auth, config.auth)) || config.auth.every((item) => item.id == "manual") ? config.auth : next.auth
|
|
28342
|
+
});
|
|
28343
|
+
} catch (error) {
|
|
28344
|
+
setOperationFailure(error.message);
|
|
28345
|
+
}
|
|
28346
|
+
}
|
|
28347
|
+
},
|
|
28348
|
+
children: t(loading ? "openapi.loading" : "openapi.update")
|
|
28349
|
+
})]
|
|
28350
|
+
})] }),
|
|
28351
|
+
showOperations && (document != null && operations.length == 0 ? /* @__PURE__ */ jsx("p", {
|
|
28352
|
+
role: "status",
|
|
28353
|
+
className: "m-0 px-2 py-1 text-xs text-muted-foreground",
|
|
28354
|
+
children: t("openapi.noOperations")
|
|
28355
|
+
}) : /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: t("openapi.operation") }), /* @__PURE__ */ jsxs(Popover, {
|
|
28356
|
+
open: operationsOpen,
|
|
28357
|
+
onOpenChange: (open) => {
|
|
28358
|
+
setOperationsOpen(open);
|
|
28359
|
+
if (open) {
|
|
28360
|
+
setSearch("");
|
|
28361
|
+
read();
|
|
28362
|
+
}
|
|
28363
|
+
},
|
|
28364
|
+
children: [/* @__PURE__ */ jsx(ValueEditorFeedback, {
|
|
28365
|
+
error: operationsOpen ? void 0 : operationError,
|
|
28366
|
+
children: (errorId) => /* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
28367
|
+
render: /* @__PURE__ */ jsx(Button$1, {
|
|
28368
|
+
variant: "field",
|
|
28369
|
+
size: "field"
|
|
28370
|
+
}),
|
|
28371
|
+
className: "w-full justify-between",
|
|
28372
|
+
"aria-label": savedSelection ? `${config.method.toUpperCase()} ${config.path}` : t("openapi.operation"),
|
|
28373
|
+
"aria-expanded": operationsOpen,
|
|
28374
|
+
"aria-invalid": operationError != null,
|
|
28375
|
+
"aria-describedby": errorId,
|
|
28376
|
+
disabled,
|
|
28377
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
28378
|
+
className: "min-w-0 truncate",
|
|
28379
|
+
children: savedSelection ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
28380
|
+
className: "mr-2 font-mono text-muted-foreground",
|
|
28381
|
+
children: config.method.toUpperCase()
|
|
28382
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
28383
|
+
className: "font-mono",
|
|
28384
|
+
children: config.path
|
|
28385
|
+
})] }) : t("openapi.operation")
|
|
28386
|
+
}), /* @__PURE__ */ jsx(SelectChevron, {})]
|
|
28387
|
+
})
|
|
28388
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
28389
|
+
container,
|
|
28390
|
+
align: "start",
|
|
28391
|
+
className: `w-(--anchor-width) max-w-[calc(100vw-24px)] gap-0 rounded-[calc(var(--ui-control-radius,var(--ui-radius))_+_2px)] p-1`,
|
|
28392
|
+
"aria-label": t("openapi.operation"),
|
|
28393
|
+
children: [
|
|
28394
|
+
/* @__PURE__ */ jsx("div", {
|
|
28395
|
+
className: "p-1",
|
|
28396
|
+
children: /* @__PURE__ */ jsx(Input$1, {
|
|
28397
|
+
"aria-label": t("openapi.search"),
|
|
28398
|
+
placeholder: t("openapi.search"),
|
|
28399
|
+
value: search,
|
|
28400
|
+
onChange: (event) => setSearch(event.target.value)
|
|
28401
|
+
})
|
|
28402
|
+
}),
|
|
28403
|
+
loading && /* @__PURE__ */ jsx("span", {
|
|
28404
|
+
role: "status",
|
|
28405
|
+
children: t("openapi.loading")
|
|
28406
|
+
}),
|
|
28407
|
+
!loading && choices.length == 0 && /* @__PURE__ */ jsx("p", {
|
|
28408
|
+
role: "status",
|
|
28409
|
+
className: "m-0 px-2 py-1 text-xs text-muted-foreground",
|
|
28410
|
+
children: t("openapi.noMatches")
|
|
28411
|
+
}),
|
|
28412
|
+
/* @__PURE__ */ jsx("div", {
|
|
28413
|
+
className: "flex max-h-64 flex-col overflow-auto px-1 pb-1",
|
|
28414
|
+
children: grouped ? [...groups].map(([tag, entries]) => /* @__PURE__ */ jsxs("div", {
|
|
28415
|
+
role: "group",
|
|
28416
|
+
"aria-label": tag || t("openapi.untagged"),
|
|
28417
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
28418
|
+
className: "px-2 py-0.5 text-xs font-normal leading-5 text-muted-foreground",
|
|
28419
|
+
children: tag || t("openapi.untagged")
|
|
28420
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
28421
|
+
className: "ml-2 flex flex-col",
|
|
28422
|
+
children: entries.map(renderOperation)
|
|
28423
|
+
})]
|
|
28424
|
+
}, tag)) : choices.map(renderOperation)
|
|
28425
|
+
})
|
|
28426
|
+
]
|
|
28427
|
+
})]
|
|
28428
|
+
})] })),
|
|
28429
|
+
savedSelection && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
28430
|
+
htmlFor: "openapi-server",
|
|
28431
|
+
children: t("openapi.server")
|
|
28432
|
+
}), /* @__PURE__ */ jsx(ValueEditorFeedback, {
|
|
28433
|
+
error: addressError,
|
|
28434
|
+
children: (errorId) => /* @__PURE__ */ jsxs("div", {
|
|
28435
|
+
className: "flex min-w-0 items-center gap-1",
|
|
28436
|
+
children: [/* @__PURE__ */ jsx(Input$1, {
|
|
28437
|
+
"aria-invalid": addressError != null,
|
|
28438
|
+
"aria-describedby": errorId,
|
|
28439
|
+
id: "openapi-server",
|
|
28440
|
+
disabled,
|
|
28441
|
+
value: address,
|
|
28442
|
+
onChange: (event) => {
|
|
28443
|
+
setAddress(event.target.value);
|
|
28444
|
+
setServerIndex(void 0);
|
|
28445
|
+
setServerError("");
|
|
28446
|
+
},
|
|
28447
|
+
onBlur: () => {
|
|
28448
|
+
if (address != config.serverUrl) save({
|
|
28449
|
+
...config,
|
|
28450
|
+
serverUrl: address
|
|
28451
|
+
}, "serverUrl");
|
|
28452
|
+
}
|
|
28453
|
+
}), /* @__PURE__ */ jsxs(Popover, {
|
|
28454
|
+
open: serversOpen,
|
|
28455
|
+
onOpenChange: (open) => {
|
|
28456
|
+
setServersOpen(open);
|
|
28457
|
+
if (open) read();
|
|
28458
|
+
},
|
|
28459
|
+
children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
28460
|
+
render: /* @__PURE__ */ jsx(Button$1, {
|
|
28461
|
+
variant: "field",
|
|
28462
|
+
size: "icon-sm"
|
|
28463
|
+
}),
|
|
28464
|
+
disabled,
|
|
28465
|
+
"aria-label": t("openapi.servers"),
|
|
28466
|
+
children: /* @__PURE__ */ jsx(SelectChevron, {})
|
|
28467
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
28468
|
+
container,
|
|
28469
|
+
align: "end",
|
|
28470
|
+
"aria-label": t("openapi.servers"),
|
|
28471
|
+
children: [loading && /* @__PURE__ */ jsx("span", {
|
|
28472
|
+
role: "status",
|
|
28473
|
+
children: t("openapi.loading")
|
|
28474
|
+
}), availableServers.map((server, index) => {
|
|
28475
|
+
let label;
|
|
28476
|
+
try {
|
|
28477
|
+
label = serverAddress(server, url);
|
|
28478
|
+
} catch {
|
|
28479
|
+
label = String(server.url);
|
|
28480
|
+
}
|
|
28481
|
+
return /* @__PURE__ */ jsx(Button$1, {
|
|
28482
|
+
variant: "ghost",
|
|
28483
|
+
className: "justify-start whitespace-normal break-all text-left h-auto",
|
|
28484
|
+
onClick: () => useServer(index),
|
|
28485
|
+
children: label
|
|
28486
|
+
}, index);
|
|
28487
|
+
})]
|
|
28488
|
+
})]
|
|
28489
|
+
})]
|
|
28490
|
+
})
|
|
28491
|
+
})] }), selectedServer != null && Object.entries(object(selectedServer.variables ?? {})).map(([name, definition]) => /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: name }), /* @__PURE__ */ jsx(Input$1, {
|
|
28492
|
+
"aria-label": name,
|
|
28493
|
+
value: serverVariables[name] ?? String(object(definition).default ?? ""),
|
|
28494
|
+
disabled,
|
|
28495
|
+
onChange: (event) => setServerVariables({
|
|
28496
|
+
...serverVariables,
|
|
28497
|
+
[name]: event.target.value
|
|
28498
|
+
}),
|
|
28499
|
+
onBlur: () => useServer(serverIndex, serverVariables)
|
|
28500
|
+
})] }, name))] })
|
|
28501
|
+
]
|
|
28502
|
+
})]
|
|
28503
|
+
}), savedSelection && /* @__PURE__ */ jsx(AuthenticationDisclosure, {
|
|
28504
|
+
title: t("openapi.auth"),
|
|
28505
|
+
children: (onInvalidChange) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
28506
|
+
/* @__PURE__ */ jsx(Field, { children: /* @__PURE__ */ jsxs(NativeSelect, {
|
|
28507
|
+
"aria-label": t("openapi.auth"),
|
|
28508
|
+
id: "openapi-auth",
|
|
28509
|
+
className: "w-full",
|
|
28510
|
+
disabled,
|
|
28511
|
+
value: declaredAuth >= 0 ? `declared:${declaredAuth}` : manualAuth?.type ?? "none",
|
|
28512
|
+
onChange: (event) => {
|
|
28513
|
+
const value = event.target.value;
|
|
28514
|
+
if (value.startsWith("declared:")) {
|
|
28515
|
+
const auth = security[Number(value.slice(9))]?.auth;
|
|
28516
|
+
if (auth != null) save({
|
|
28517
|
+
...config,
|
|
28518
|
+
auth
|
|
28519
|
+
});
|
|
28520
|
+
} else if (value == "none") save({
|
|
28521
|
+
...config,
|
|
28522
|
+
auth: []
|
|
28523
|
+
});
|
|
28524
|
+
else useAuth(value);
|
|
28525
|
+
},
|
|
28526
|
+
children: [
|
|
28527
|
+
security.map((entry, index) => /* @__PURE__ */ jsxs(NativeSelectOption, {
|
|
28528
|
+
value: `declared:${index}`,
|
|
28529
|
+
disabled: entry.auth == null,
|
|
28530
|
+
children: [entry.auth?.length == 0 ? t("openapi.none") : entry.label, entry.error ? ` (${t("openapi.unsupported")})` : ""]
|
|
28531
|
+
}, index)),
|
|
28532
|
+
!security.some((entry) => entry.auth?.length == 0) && /* @__PURE__ */ jsx(NativeSelectOption, {
|
|
28533
|
+
value: "none",
|
|
28534
|
+
children: t("openapi.none")
|
|
28535
|
+
}),
|
|
28536
|
+
/* @__PURE__ */ jsx(NativeSelectOption, {
|
|
28537
|
+
value: "bearer",
|
|
28538
|
+
children: "Bearer"
|
|
28539
|
+
}),
|
|
28540
|
+
/* @__PURE__ */ jsx(NativeSelectOption, {
|
|
28541
|
+
value: "basic",
|
|
28542
|
+
children: "Basic"
|
|
28543
|
+
}),
|
|
28544
|
+
/* @__PURE__ */ jsx(NativeSelectOption, {
|
|
28545
|
+
value: "apiKey",
|
|
28546
|
+
children: "API Key"
|
|
28547
|
+
})
|
|
28548
|
+
]
|
|
28549
|
+
}) }),
|
|
28550
|
+
manualAuth?.type == "apiKey" && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
28551
|
+
htmlFor: "openapi-key-name",
|
|
28552
|
+
children: t("openapi.keyName")
|
|
28553
|
+
}), /* @__PURE__ */ jsx(Input$1, {
|
|
28554
|
+
id: "openapi-key-name",
|
|
28555
|
+
value: keyName,
|
|
28556
|
+
disabled,
|
|
28557
|
+
onChange: (event) => setKeyName(event.target.value),
|
|
28558
|
+
onBlur: () => {
|
|
28559
|
+
if (keyName != manualAuth.name) useAuth("apiKey");
|
|
28560
|
+
}
|
|
28561
|
+
})] }), /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
28562
|
+
htmlFor: "openapi-key-location",
|
|
28563
|
+
children: t("openapi.keyLocation")
|
|
28564
|
+
}), /* @__PURE__ */ jsxs(NativeSelect, {
|
|
28565
|
+
id: "openapi-key-location",
|
|
28566
|
+
className: "w-full",
|
|
28567
|
+
value: keyLocation,
|
|
28568
|
+
disabled,
|
|
28569
|
+
onChange: (event) => useAuth("apiKey", keyName, event.target.value),
|
|
28570
|
+
children: [/* @__PURE__ */ jsx(NativeSelectOption, {
|
|
28571
|
+
value: "header",
|
|
28572
|
+
children: "Header"
|
|
28573
|
+
}), /* @__PURE__ */ jsx(NativeSelectOption, {
|
|
28574
|
+
value: "query",
|
|
28575
|
+
children: "Query"
|
|
28576
|
+
})]
|
|
28577
|
+
})] })] }),
|
|
28578
|
+
credentials?.(onInvalidChange)
|
|
28579
|
+
] })
|
|
28580
|
+
}, JSON.stringify(config.auth))] });
|
|
28581
|
+
}
|
|
28582
|
+
/** Initial validation can reveal errors; subsequent checks respect manual disclosure. */
|
|
28583
|
+
function AuthenticationDisclosure({ title, children }) {
|
|
28584
|
+
const [open, setOpen] = useState(false);
|
|
28585
|
+
const interacted = useRef(false);
|
|
28586
|
+
const onInvalidChange = useCallback((invalid) => {
|
|
28587
|
+
if (invalid && !interacted.current) setOpen(true);
|
|
28588
|
+
}, []);
|
|
28589
|
+
return /* @__PURE__ */ jsxs("details", {
|
|
28590
|
+
className: "inspector-disclosure",
|
|
28591
|
+
"data-inspector-section": "inputs",
|
|
28592
|
+
open,
|
|
28593
|
+
onToggle: (event) => setOpen(event.currentTarget.open),
|
|
28594
|
+
children: [/* @__PURE__ */ jsxs("summary", {
|
|
28595
|
+
onClick: () => {
|
|
28596
|
+
interacted.current = true;
|
|
28597
|
+
},
|
|
28598
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
28599
|
+
name: "chevron-down",
|
|
28600
|
+
size: 14
|
|
28601
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
28602
|
+
className: "inspector-disclosure-summary",
|
|
28603
|
+
children: /* @__PURE__ */ jsx("strong", {
|
|
28604
|
+
className: "inspector-section-title-text",
|
|
28605
|
+
children: title
|
|
28606
|
+
})
|
|
28607
|
+
})]
|
|
28608
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
28609
|
+
className: "inspector-disclosure-content node-settings flex flex-col gap-3",
|
|
28610
|
+
children: children(onInvalidChange)
|
|
28116
28611
|
})]
|
|
28117
28612
|
});
|
|
28118
28613
|
}
|
|
@@ -32652,9 +33147,43 @@ function inspectorIcon(node, target) {
|
|
|
32652
33147
|
if (node?.kind == "approval") return "check";
|
|
32653
33148
|
if (node?.kind == "wait") return "wait";
|
|
32654
33149
|
if (node?.kind == "subflow" || node == null && target.kind == "subflow") return "subflow";
|
|
32655
|
-
if (node?.kind == "task" && node.definition != null && "executor" in node.definition)
|
|
33150
|
+
if (node?.kind == "task" && node.definition != null && "executor" in node.definition) {
|
|
33151
|
+
if (node.definition.executor.kind == "openapi") return "task";
|
|
33152
|
+
return node.definition.executor.kind == "connector" ? "connection" : "llm";
|
|
33153
|
+
}
|
|
32656
33154
|
return "task";
|
|
32657
33155
|
}
|
|
33156
|
+
function nodePurposePlaceholder(selection, t, action, displays) {
|
|
33157
|
+
switch (selection.kind) {
|
|
33158
|
+
case "condition": return t("addNode.conditionDescription");
|
|
33159
|
+
case "value": return t("addNode.valueDescription");
|
|
33160
|
+
case "approval": return t("addNode.approvalDescription");
|
|
33161
|
+
case "wait": return t("addNode.waitDescription");
|
|
33162
|
+
case "subflow": return t("addNode.subflowDescription");
|
|
33163
|
+
case "trigger": {
|
|
33164
|
+
const node = selection.node;
|
|
33165
|
+
switch (node.kind) {
|
|
33166
|
+
case "manual": return t("addNode.manualDescription");
|
|
33167
|
+
case "error": return t("errorWorkflow.description");
|
|
33168
|
+
case "cron": return t("addNode.cronDescription");
|
|
33169
|
+
case "webhook": return t("addNode.webhookDescription");
|
|
33170
|
+
case "integration":
|
|
33171
|
+
case "poll": return displays?.[node.definition.key]?.description ?? node.definition.description;
|
|
33172
|
+
}
|
|
33173
|
+
}
|
|
33174
|
+
case "task": {
|
|
33175
|
+
const definition = selection.definition;
|
|
33176
|
+
if (definition == null) return;
|
|
33177
|
+
if (!("executor" in definition)) return t("addNode.javascriptDescription");
|
|
33178
|
+
switch (definition.executor.kind) {
|
|
33179
|
+
case "agent": return t("addNode.agentDescription");
|
|
33180
|
+
case "openapi": return t("openapi.description");
|
|
33181
|
+
case "connector": return action?.description;
|
|
33182
|
+
case "llm": return t(definition.executor.mode == "json" ? "addNode.llmStructuredDescription" : "addNode.llmChatDescription");
|
|
33183
|
+
}
|
|
33184
|
+
}
|
|
33185
|
+
}
|
|
33186
|
+
}
|
|
32658
33187
|
function inputUpstreamSources({ revision, sourceNodeIcons, target, selection, store, handleName, t, triggerDisplays }) {
|
|
32659
33188
|
const graph = revision.graph(target);
|
|
32660
33189
|
const mapping = nodeInputMappings(selection.node)[handleName];
|
|
@@ -32704,6 +33233,8 @@ function NodeInspector({ variables = {
|
|
|
32704
33233
|
const content = useRef(null);
|
|
32705
33234
|
const task = selection?.kind == "task" ? selection.definition : void 0;
|
|
32706
33235
|
const isAgent = task != null && "executor" in task && task.executor.kind == "agent";
|
|
33236
|
+
const isOpenApi = task != null && "executor" in task && task.executor.kind == "openapi";
|
|
33237
|
+
const unconfiguredOpenApi = task != null && "executor" in task && task.executor.kind == "openapi" && !task.executor.path;
|
|
32707
33238
|
const isLlm = task != null && "executor" in task && task.executor.kind == "llm";
|
|
32708
33239
|
const connector = task != null && "executor" in task && task.executor.kind == "connector" ? task.executor : void 0;
|
|
32709
33240
|
const taskId = selection?.kind == "task" && selection.node.task == null ? selection.node.taskId : void 0;
|
|
@@ -32727,7 +33258,7 @@ function NodeInspector({ variables = {
|
|
|
32727
33258
|
selection?.id,
|
|
32728
33259
|
selection?.kind
|
|
32729
33260
|
]);
|
|
32730
|
-
const panel = /* @__PURE__ */ jsx(
|
|
33261
|
+
const panel = /* @__PURE__ */ jsx(ScrollArea, {
|
|
32731
33262
|
className: "inspector-scroll",
|
|
32732
33263
|
tabIndex: -1,
|
|
32733
33264
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -32772,6 +33303,7 @@ function NodeInspector({ variables = {
|
|
|
32772
33303
|
}),
|
|
32773
33304
|
selection != null && /* @__PURE__ */ jsx(NodeDescription, {
|
|
32774
33305
|
value: selection.node.description,
|
|
33306
|
+
placeholder: nodePurposePlaceholder(selection, t, connectorAction, triggerDisplays),
|
|
32775
33307
|
disabled,
|
|
32776
33308
|
onSave: (description) => {
|
|
32777
33309
|
store?.saveNodeDescription(selection.id, description);
|
|
@@ -32860,7 +33392,56 @@ function NodeInspector({ variables = {
|
|
|
32860
33392
|
store?.saveTriggerSchedule(selection.id, schedule);
|
|
32861
33393
|
}
|
|
32862
33394
|
}, `schedule:${selection.id}`),
|
|
32863
|
-
|
|
33395
|
+
isOpenApi && task != null && "executor" in task && /* @__PURE__ */ jsx(OpenApiSection, {
|
|
33396
|
+
task,
|
|
33397
|
+
credentials: (onInvalidChange) => selection?.kind === "task" && task.inputs.filter((port) => "handle" in port && port.handle.startsWith("auth.")).map((definition) => {
|
|
33398
|
+
const mapping = selection.node.inputs[definition.handle];
|
|
33399
|
+
const source = mapping?.kind === "sources" ? mapping.sources.find((item) => item.kind === "binding") : void 0;
|
|
33400
|
+
const binding = source?.kind === "binding" ? revision.binding(source.bindingId) : void 0;
|
|
33401
|
+
return /* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: definition.handle.slice(5).replace(/^manual\./, "").replaceAll(".", " · ") }), /* @__PURE__ */ jsx(NodeInputValue, {
|
|
33402
|
+
embedded: true,
|
|
33403
|
+
definition,
|
|
33404
|
+
label: task.executor.kind == "openapi" && task.executor.auth.length == 1 ? definition.handle.split(".").at(-1) : definition.handle.slice(5).replaceAll(".", " · "),
|
|
33405
|
+
presentation: {
|
|
33406
|
+
compact: true,
|
|
33407
|
+
hideOptions: true
|
|
33408
|
+
},
|
|
33409
|
+
onInvalidChange,
|
|
33410
|
+
sourceOnly: true,
|
|
33411
|
+
readOnly,
|
|
33412
|
+
disabled,
|
|
33413
|
+
value: inputValue(mapping, definition.value),
|
|
33414
|
+
connected: mapping?.kind === "sources" && binding?.kind !== "variable",
|
|
33415
|
+
variableName: binding?.kind === "variable" ? binding.target : void 0,
|
|
33416
|
+
upstream: inputUpstreamSources({
|
|
33417
|
+
revision,
|
|
33418
|
+
sourceNodeIcons,
|
|
33419
|
+
target,
|
|
33420
|
+
selection,
|
|
33421
|
+
store,
|
|
33422
|
+
handleName: definition.handle,
|
|
33423
|
+
t,
|
|
33424
|
+
triggerDisplays
|
|
33425
|
+
}),
|
|
33426
|
+
variables,
|
|
33427
|
+
onValue: (value, deletion) => {
|
|
33428
|
+
store?.setInputValue(selection.id, definition.handle, value, deletion);
|
|
33429
|
+
},
|
|
33430
|
+
onVariable: (name) => {
|
|
33431
|
+
store?.setInputVariable(selection.id, definition.handle, name);
|
|
33432
|
+
}
|
|
33433
|
+
})] }, definition.handle);
|
|
33434
|
+
}),
|
|
33435
|
+
disabled,
|
|
33436
|
+
load: (url, signal) => store.loadOpenApiDocument(url, signal),
|
|
33437
|
+
onSave: (before, value) => store?.saveTaskSettings(selection.id, {
|
|
33438
|
+
kind: "openapi",
|
|
33439
|
+
name: task.name,
|
|
33440
|
+
before,
|
|
33441
|
+
task: value
|
|
33442
|
+
}) ?? Promise.resolve(false)
|
|
33443
|
+
}, `openapi:${selection?.id}`),
|
|
33444
|
+
!unconfiguredOpenApi && (selection?.kind === "approval" || selection?.kind === "wait" || selection?.kind === "subflow" || selection?.kind === "task") && (() => {
|
|
32864
33445
|
const definitions = selection.kind === "task" ? [...selection.definition?.inputs ?? []] : selection.kind === "subflow" ? [...selection.definition?.inputs ?? []] : [...selection.node.inputDefinitions];
|
|
32865
33446
|
const handles = new Set(definitions.flatMap((definition) => "handle" in definition ? [definition.handle] : []));
|
|
32866
33447
|
for (const handle of Object.keys(selection.node.inputs)) if (!handles.has(handle) && !(selection.kind === "task" && selection.node.additionalInputs?.some((port) => port.handle === handle))) definitions.push({
|
|
@@ -32868,7 +33449,7 @@ function NodeInspector({ variables = {
|
|
|
32868
33449
|
jsonSchema: {},
|
|
32869
33450
|
nullable: true
|
|
32870
33451
|
});
|
|
32871
|
-
const entries = definitions.map((definition) => {
|
|
33452
|
+
const entries = definitions.filter((definition) => !isOpenApi || !("handle" in definition) || !definition.handle.startsWith("auth.")).map((definition) => {
|
|
32872
33453
|
if ("group" in definition) return definition;
|
|
32873
33454
|
const mapping = selection.node.inputs[definition.handle];
|
|
32874
33455
|
const source = mapping?.kind === "sources" ? mapping.sources.find((item) => item.kind === "binding") : void 0;
|
|
@@ -33003,7 +33584,7 @@ function NodeInspector({ variables = {
|
|
|
33003
33584
|
}
|
|
33004
33585
|
})
|
|
33005
33586
|
}),
|
|
33006
|
-
selection?.kind === "task" && selection.definition != null && /* @__PURE__ */ jsx("section", {
|
|
33587
|
+
!unconfiguredOpenApi && selection?.kind === "task" && selection.definition != null && /* @__PURE__ */ jsx("section", {
|
|
33007
33588
|
className: "inspector-port-section",
|
|
33008
33589
|
children: /* @__PURE__ */ jsx(PortDefinitionEditor, {
|
|
33009
33590
|
readOnly,
|
|
@@ -54380,7 +54961,7 @@ function RunLog({ presentation, resultClient, events, eventsExpiresAt, eventNode
|
|
|
54380
54961
|
tabIndex: -1,
|
|
54381
54962
|
data: rows,
|
|
54382
54963
|
item: RunVirtualItem,
|
|
54383
|
-
ssrCount: Math.min(20, rows.length),
|
|
54964
|
+
ssrCount: typeof window == "undefined" ? Math.min(20, rows.length) : void 0,
|
|
54384
54965
|
keepMounted: focusIndex >= 0 ? [focusIndex] : [],
|
|
54385
54966
|
onScrollIntent: beginManualScroll,
|
|
54386
54967
|
onKeyDown: (event) => {
|
|
@@ -54663,16 +55244,6 @@ function InputFields({ store, showErrors, labelledBy }) {
|
|
|
54663
55244
|
}
|
|
54664
55245
|
//#endregion
|
|
54665
55246
|
//#region src/workbench/browser/runtime/runs/runInputPanel.tsx
|
|
54666
|
-
function InputGroup({ attempted, group, title, theme }) {
|
|
54667
|
-
return /* @__PURE__ */ jsxs("section", {
|
|
54668
|
-
className: "run-input-group",
|
|
54669
|
-
children: [/* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsx("strong", { children: title }) }), /* @__PURE__ */ jsx(FlowRunInputEditor, {
|
|
54670
|
-
store: group.editor,
|
|
54671
|
-
theme,
|
|
54672
|
-
showErrors: attempted
|
|
54673
|
-
})]
|
|
54674
|
-
});
|
|
54675
|
-
}
|
|
54676
55247
|
function Form({ onStarted, request, store, theme }) {
|
|
54677
55248
|
const t = useTranslate();
|
|
54678
55249
|
const valid = useVal(request.valid);
|
|
@@ -54706,12 +55277,14 @@ function Form({ onStarted, request, store, theme }) {
|
|
|
54706
55277
|
variant: "destructive",
|
|
54707
55278
|
children: [/* @__PURE__ */ jsx(Icon, { name: "alert" }), /* @__PURE__ */ jsx(AlertDescription, { children: t("runInput.invalid") })]
|
|
54708
55279
|
}),
|
|
54709
|
-
request.
|
|
54710
|
-
|
|
54711
|
-
|
|
54712
|
-
|
|
54713
|
-
|
|
54714
|
-
|
|
55280
|
+
request.editor && /* @__PURE__ */ jsxs("section", {
|
|
55281
|
+
className: "run-input-group",
|
|
55282
|
+
children: [/* @__PURE__ */ jsx("header", { children: /* @__PURE__ */ jsx("strong", { children: t("inspector.ports.outputsTitle") }) }), /* @__PURE__ */ jsx(FlowRunInputEditor, {
|
|
55283
|
+
store: request.editor,
|
|
55284
|
+
theme,
|
|
55285
|
+
showErrors: request.attempted
|
|
55286
|
+
})]
|
|
55287
|
+
})
|
|
54715
55288
|
]
|
|
54716
55289
|
}),
|
|
54717
55290
|
/* @__PURE__ */ jsxs("footer", { children: [/* @__PURE__ */ jsx(Button$1, {
|
|
@@ -55961,6 +56534,7 @@ var NodeInspectorContainer = memo(function NodeInspectorContainer({ store, focus
|
|
|
55961
56534
|
const accessState = useVal(store.connectorAccess.$);
|
|
55962
56535
|
const connectorAccess = accessState.access;
|
|
55963
56536
|
const providerId = connectorAction?.authenticated ? connectorAction.serviceId : void 0;
|
|
56537
|
+
const triggerId = selection?.kind == "trigger" && (selection.trigger.kind == "poll" || selection.trigger.kind == "integration") ? selection.trigger.definition.key : void 0;
|
|
55964
56538
|
const triggerProviderId = selection?.kind == "trigger" && (selection.trigger.kind == "poll" || selection.trigger.kind == "integration") ? selection.trigger.definition.provider : void 0;
|
|
55965
56539
|
useEffect(() => {
|
|
55966
56540
|
if (connectorAccess?.mode == "selectable") {
|
|
@@ -55978,7 +56552,7 @@ var NodeInspectorContainer = memo(function NodeInspectorContainer({ store, focus
|
|
|
55978
56552
|
selection,
|
|
55979
56553
|
store
|
|
55980
56554
|
]);
|
|
55981
|
-
const triggerCandidates = triggerProviderId == null ? void 0 :
|
|
56555
|
+
const triggerCandidates = triggerProviderId == null ? void 0 : store.connectorAccess.allowedTriggerCandidates(triggerProviderId, triggerId);
|
|
55982
56556
|
const allowedCandidates = (providerId == null ? void 0 : accessState.candidates[providerId]?.candidates)?.filter((candidate) => candidate.permissions == null || candidate.permissions.allActions || candidate.permissions.actionIds.includes(connectorAction.actionId));
|
|
55983
56557
|
const accessError = providerId != null && connectorAccess?.mode == "selectable" && allowedCandidates?.length == 0 ? t("connectorAccess.noAvailablePermissions") : void 0;
|
|
55984
56558
|
const connectorActionError = useVal(store.connectors.$.selectedActionError);
|