@oomol-lab/open-flow 0.1.0-beta.68 → 0.1.0-beta.69
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/{ContentIcon-Sx9bywU-.js → ContentIcon-CsECY5id.js} +14 -7
- package/dist/browser/{FlowCanvas-CXpaeurx.js → FlowCanvas-C5X22xQ7.js} +18 -18
- package/dist/browser/{createResourceDialog-BKmimKA_.js → createResourceDialog-Di5BBrQv.js} +2 -2
- package/dist/browser/{dialog-ZmfcwuMS.js → dialog-Bjo-r9B0.js} +85 -8
- package/dist/browser/event-sources.d.ts +4 -2
- package/dist/browser/{exportSvg-D4CqCcx2.js → exportSvg-Cj6Spxx-.js} +2 -2
- package/dist/browser/flow-authoring-node.d.ts +3 -1
- package/dist/browser/flow-authoring.js +68 -7
- package/dist/browser/flow-change-schema.d.ts +3 -1
- package/dist/browser/flow-change.d.ts +17 -2
- package/dist/browser/flow-change.js +82 -9
- package/dist/browser/{flowChanges-B5tZMcGr.js → flowChanges-Dp-rcEJ6.js} +737 -1180
- package/dist/browser/{flowWorkspace-zFBFtZPo.js → flowWorkspace-CB1QACku.js} +440 -70
- package/dist/browser/preview.css +49 -41
- package/dist/browser/preview.js +2229 -2359
- package/dist/browser/{typeScriptSession-D0bjYDeg.js → typeScriptSession-B0hC-C8y.js} +1 -1
- package/dist/browser/ui.css +8 -0
- package/dist/browser/workbench.css +53 -41
- package/dist/browser/workbench.js +74 -32
- package/dist/browser/{workbenchSelect-CChdgugI.js → workbenchSelect-C3hxUcYm.js} +1 -1
- package/dist/command/index.js +55 -51
- package/dist/common/authoring.d.ts +20 -0
- package/dist/common/authoringSchema.d.ts +243 -0
- package/dist/common/connector-proxy.d.ts +4 -0
- package/dist/common/control-api-conformance.js +147 -33
- package/dist/common/control-api.d.ts +14 -7
- package/dist/common/control-api.js +130 -15
- package/dist/common/control-requests.d.ts +32 -19
- package/dist/common/control-requests.js +2854 -152
- package/dist/common/decision.js +27 -3
- package/dist/common/engine-contract.d.ts +2 -2
- package/dist/common/event-source-definition.d.ts +34 -16
- package/dist/common/event-source.d.ts +63 -5
- package/dist/common/event-source.js +5744 -261
- package/dist/common/event-sources.d.ts +99 -6
- package/dist/common/flow-encoding.js +49 -10
- package/dist/common/flow-errorHandling.d.ts +36 -0
- package/dist/common/flow-graph.d.ts +4 -2
- package/dist/common/flow-retry.d.ts +19 -0
- package/dist/common/flow-semantics.js +94 -10
- package/dist/common/{fr-Du5gv3kM.js → fr-CNTSedYU.js} +259 -18
- package/dist/common/integration-trigger.d.ts +1 -1
- package/dist/common/integration-trigger.js +27 -3
- package/dist/common/{ja-D2wyPdTF.js → ja-CxQBHr2J.js} +259 -18
- package/dist/common/{ko-Cuu2AOaC.js → ko-D1Exiv1h.js} +259 -18
- package/dist/common/mcp.d.ts +30 -0
- package/dist/common/mcp.js +132 -17
- package/dist/common/openapi.js +27 -3
- package/dist/common/poll-trigger.js +27 -3
- package/dist/common/provider-triggers.d.ts +0 -2
- package/dist/common/provider-triggers.js +358 -155
- package/dist/common/{ru-BjI_JSsx.js → ru-BzLZv0B7.js} +259 -18
- package/dist/common/run-events.d.ts +2 -0
- package/dist/common/run-events.js +4 -2
- package/dist/common/runtime-contract.d.ts +1 -0
- package/dist/common/runtime-contract.js +4 -4
- package/dist/common/scheduler.d.ts +13 -2
- package/dist/common/scheduler.js +288 -98
- package/dist/common/webhook-trigger.js +27 -3
- package/dist/common/workflow.js +27 -3
- package/dist/common/{zh-CN-CnnXkzLh.js → zh-CN-Dg_xSGde.js} +259 -18
- package/dist/common/{zh-TW-CJnR2dgF.js → zh-TW-oxuLwsV0.js} +259 -18
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/common/event-source-feishu.d.ts +0 -3
- package/dist/common/feishu-events.d.ts +0 -19
- package/dist/common/feishu-subscriptions.d.ts +0 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as DropdownMenuContent, N as DropdownMenuTrigger, T as DropdownMenuItem, d as PopoverContent, g as PopoverTrigger, h as PopoverTitle, it as providerIconAppearance, k as DropdownMenuSeparator, st as IconThemeContext, u as Popover, x as DropdownMenu } from "./ContentIcon-
|
|
1
|
+
import { C as DropdownMenuContent, N as DropdownMenuTrigger, T as DropdownMenuItem, d as PopoverContent, g as PopoverTrigger, h as PopoverTitle, it as providerIconAppearance, k as DropdownMenuSeparator, st as IconThemeContext, u as Popover, x as DropdownMenu } from "./ContentIcon-CsECY5id.js";
|
|
2
2
|
import { a as derive, i as compute, l as val } from "./dist-bO8nvHFH.js";
|
|
3
3
|
import { c as useLang, l as useTranslate, o as I18nProvider, u as useVal } from "./dist-BFmpkX4P.js";
|
|
4
4
|
import { gr as cn, i as TooltipTrigger, mr as Button, n as TooltipContent, t as Tooltip } from "./tooltip-CJjYs_2I.js";
|
|
5
|
-
import {
|
|
6
|
-
import { $ as providerIcon, An as
|
|
5
|
+
import { A as upgradeRevisionContent, C as isTriggerNode, Et as Input, L as mapConditionSources, O as resourceNameIssue, R as nodeInputMappings, a as DialogFooter, b as FlowChangeError, d as Field, h as FieldLabel, i as DialogDescription, k as upgradeManualTrigger, l as Icon, m as FieldGroup, o as DialogHeader, ot as dequal$1, p as FieldError, r as DialogContent, s as DialogTitle, t as Dialog, u as Spinner, x as applyFlowChanges } from "./dialog-Bjo-r9B0.js";
|
|
6
|
+
import { $ as providerIcon, An as record, At as WorkflowExportMenuItem, Bt as EmptyMedia, Ct as resetInputValues, Dt as setServiceConnections, Et as setInputSources, Ft as InputGroupInput, Ht as Badge, It as Empty, J as connectorActionPorts, K as resourceData, Kt as createI18n, Lt as EmptyContent, Mn as ApiError, Mt as followWorkbenchLink, Nn as controlErrorCode, Nt as InputGroup, On as invalidResponse, Ot as updateStartInputDefs, Pt as InputGroupAddon, Qt as allConnectorConnectionsQuery, R as addNodeIntent, Rt as EmptyDescription, S as updateWebhook, St as repairNodeNames, Tt as setConnectorConnection, U as scopedValue, Ut as EventSourcesPage, V as combineSources, Vt as EmptyTitle, W as CacheResource, Xt as WorkbenchClient, Y as designerGraph, Yt as errorNotice, Zt as randomId, _ as updateTask, _t as restoreCanvasPresentation, a as nameCreatedNodes, an as sampleErrorOutputs, at as Latest, b as updateTriggerConfig, bt as setNodeContentHidden, c as setTriggerConnection, cn as connection, d as updateNodeDescription, dn as parseWorkflowFile, dt as actionWithConnections, en as decodeTriggerCatalog, et as RunStore, f as updateNodeIcon, fn as workflowFileName, ft as connectionCatalog, g as updateResolution, gt as removeComments, h as updateOutputPorts, ht as flowPresentation, i as deleteSelection, in as normalizeTriggerOutputs, it as flowResourceReferences, jn as string, jt as IdTooltip, kn as jsonValue, kt as updateTriggerSchedule, l as setTriggerEventSource, ln as connectorActionMetadata, m as updateNodeSettings, mt as commentIds, o as setInputValue, on as triggerOutputDefinitions, ot as deriveInspectorDiagnostics, p as updateNodeName, pn as workflowNameFromFile, pt as canvasPresentationChange, q as resourceValue, r as applyFlowChanges$1, rt as revisionView, s as setInputVariable, st as diagnosticItems, t as addNode, u as updateCondition, un as encodeWorkflowFile, v as updateTaskAdditionalInputs, vt as setComment, wn as workflowCandidate, wt as setCodeActions, x as updateValue, xt as setNodePositions, y as updateTaskPorts, yt as setFlowViewport, z as deriveAddNodeOptions, zt as EmptyHeader } from "./flowChanges-Dp-rcEJ6.js";
|
|
7
7
|
import { a as uiLanguages, i as uiLanguageNames, n as isUiLanguage, r as resolveUiLanguage, t as importedWorkflowName } from "./languages-gYzoQqCi.js";
|
|
8
8
|
import { Suspense, forwardRef, lazy, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
|
|
9
9
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -516,7 +516,7 @@ function FlowDeletionDialog({ flow, workspace, container, busy, finalFocus, onCl
|
|
|
516
516
|
}
|
|
517
517
|
//#endregion
|
|
518
518
|
//#region src/workbench/browser/runtime/shell/resourceBrowser.tsx
|
|
519
|
-
var CreateResourceDialog = lazy(() => import("./createResourceDialog-
|
|
519
|
+
var CreateResourceDialog = lazy(() => import("./createResourceDialog-Di5BBrQv.js"));
|
|
520
520
|
var flowIdTooltipAlignOffset = 44;
|
|
521
521
|
var renamePopoverAlignOffset = -12;
|
|
522
522
|
function compactFlowId(flowId) {
|
|
@@ -4515,6 +4515,14 @@ function inverseFlowChanges(content, operations) {
|
|
|
4515
4515
|
});
|
|
4516
4516
|
break;
|
|
4517
4517
|
case "graph.node.field.set":
|
|
4518
|
+
if (operation.field == "retry") {
|
|
4519
|
+
restore.push({
|
|
4520
|
+
...operation,
|
|
4521
|
+
before: operation.value,
|
|
4522
|
+
value: operation.before
|
|
4523
|
+
});
|
|
4524
|
+
break;
|
|
4525
|
+
}
|
|
4518
4526
|
restore.push({
|
|
4519
4527
|
...operation,
|
|
4520
4528
|
before: operation.value,
|
|
@@ -4852,6 +4860,17 @@ var CanvasHistory = class {
|
|
|
4852
4860
|
this.#redo.length = 0;
|
|
4853
4861
|
this.publish();
|
|
4854
4862
|
}
|
|
4863
|
+
completeNodeCreation(nodeId, changes) {
|
|
4864
|
+
const index = this.#undo.findIndex((entry) => entry.forward.some((operation) => operation.kind == "graph.node.create" && operation.nodeId == nodeId));
|
|
4865
|
+
if (index < 0 || this.applying || this.failed) return false;
|
|
4866
|
+
const entry = this.#undo[index];
|
|
4867
|
+
this.#undo[index] = {
|
|
4868
|
+
...entry,
|
|
4869
|
+
forward: [...entry.forward, ...changes]
|
|
4870
|
+
};
|
|
4871
|
+
this.publish();
|
|
4872
|
+
return true;
|
|
4873
|
+
}
|
|
4855
4874
|
rebaseModuleCreation(moduleId, module) {
|
|
4856
4875
|
for (const [index, entry] of this.#undo.entries()) {
|
|
4857
4876
|
if (!entry.forward.some((operation) => operation.kind == "module.create" && operation.moduleId == moduleId)) continue;
|
|
@@ -4916,6 +4935,11 @@ function mergeChanges(before, after) {
|
|
|
4916
4935
|
const last = after[0];
|
|
4917
4936
|
if (first?.kind == "graph.node.field.set" && last?.kind == "graph.node.field.set") {
|
|
4918
4937
|
if (first.nodeId != last.nodeId || first.field != last.field) return;
|
|
4938
|
+
if (first.field == "retry" && last.field == "retry") return [{
|
|
4939
|
+
...last,
|
|
4940
|
+
before: first.before
|
|
4941
|
+
}];
|
|
4942
|
+
if (first.field == "retry" || last.field == "retry") return;
|
|
4919
4943
|
return [{
|
|
4920
4944
|
before: first.before,
|
|
4921
4945
|
field: last.field,
|
|
@@ -5982,9 +6006,13 @@ var WorkspaceStore = class {
|
|
|
5982
6006
|
this.#flows.dispose();
|
|
5983
6007
|
}
|
|
5984
6008
|
async start(flowId) {
|
|
5985
|
-
const current = this.#draftSession.capture();
|
|
5986
|
-
let initialLoad;
|
|
5987
6009
|
this.#started = false;
|
|
6010
|
+
await this.selectFlow(flowId);
|
|
6011
|
+
this.#started = !this.#disposed;
|
|
6012
|
+
}
|
|
6013
|
+
async #loadFlowCatalog() {
|
|
6014
|
+
if (this.#flows.loaded && this.#stopCatalogWatch != null) return;
|
|
6015
|
+
let initialLoad;
|
|
5988
6016
|
if (this.#stopCatalogWatch == null) {
|
|
5989
6017
|
const subscription = this.#client.watchFlowCatalog((event) => {
|
|
5990
6018
|
if (this.#disposed) return;
|
|
@@ -6002,8 +6030,6 @@ var WorkspaceStore = class {
|
|
|
6002
6030
|
if (this.#disposed) return;
|
|
6003
6031
|
initialLoad = this.reloadFlows();
|
|
6004
6032
|
await initialLoad;
|
|
6005
|
-
if (!this.#disposed && current()) await this.selectFlow(flowId);
|
|
6006
|
-
this.#started = !this.#disposed;
|
|
6007
6033
|
}
|
|
6008
6034
|
async reloadFlows() {
|
|
6009
6035
|
await this.#flows.reload();
|
|
@@ -6048,7 +6074,10 @@ var WorkspaceStore = class {
|
|
|
6048
6074
|
workspaceLoading: flowId != null,
|
|
6049
6075
|
workspaceRepairing: false
|
|
6050
6076
|
});
|
|
6051
|
-
if (flowId == null)
|
|
6077
|
+
if (flowId == null) {
|
|
6078
|
+
await this.#loadFlowCatalog();
|
|
6079
|
+
return true;
|
|
6080
|
+
}
|
|
6052
6081
|
try {
|
|
6053
6082
|
let invalidated = false;
|
|
6054
6083
|
let pendingRevision;
|
|
@@ -6128,22 +6157,28 @@ var WorkspaceStore = class {
|
|
|
6128
6157
|
}
|
|
6129
6158
|
async repairWorkspace() {
|
|
6130
6159
|
const flowId = this.#model.value.flowId;
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
const repair = this.#pendingRepair ??= {
|
|
6134
|
-
changeId: this.#identity(),
|
|
6135
|
-
expectedRevisionId: flow.draftRevisionId
|
|
6136
|
-
};
|
|
6160
|
+
if (flowId == null || this.#model.value.workspaceRepairing) return;
|
|
6161
|
+
const current = this.#draftSession.capture();
|
|
6137
6162
|
this.#set({
|
|
6138
6163
|
workspaceRepairing: true,
|
|
6139
6164
|
workspaceLoadProblem: this.#model.value.workspaceLoadProblem
|
|
6140
6165
|
});
|
|
6141
6166
|
try {
|
|
6167
|
+
let repair = this.#pendingRepair;
|
|
6168
|
+
if (repair == null) {
|
|
6169
|
+
const flow = this.#flows.flow(flowId) ?? await this.#client.getFlow(flowId);
|
|
6170
|
+
if (!current()) return;
|
|
6171
|
+
repair = this.#pendingRepair = {
|
|
6172
|
+
changeId: this.#identity(),
|
|
6173
|
+
expectedRevisionId: flow.draftRevisionId
|
|
6174
|
+
};
|
|
6175
|
+
}
|
|
6142
6176
|
await this.#client.repairDraft(flowId, repair.expectedRevisionId, repair.changeId);
|
|
6177
|
+
if (!current()) return;
|
|
6143
6178
|
this.#pendingRepair = void 0;
|
|
6144
6179
|
await this.selectFlow(flowId);
|
|
6145
6180
|
} catch (error) {
|
|
6146
|
-
if (this.#disposed) return;
|
|
6181
|
+
if (this.#disposed || !current()) return;
|
|
6147
6182
|
if (error instanceof ApiError && error.code == controlErrorCode.flowRevisionConflict) {
|
|
6148
6183
|
this.#pendingRepair = void 0;
|
|
6149
6184
|
await this.selectFlow(flowId);
|
|
@@ -6252,21 +6287,8 @@ var WorkspaceStore = class {
|
|
|
6252
6287
|
const nodeId = this.#identity();
|
|
6253
6288
|
if (option.kind == "comment") return await this.#addComment(nodeId, position);
|
|
6254
6289
|
const revision = revisionView(draft);
|
|
6255
|
-
|
|
6290
|
+
const intent = addNodeIntent(option, revision, this.#i18n.t);
|
|
6256
6291
|
if (intent == null) return;
|
|
6257
|
-
if (intent.kind == "provider-trigger" && intent.connectionId == null) {
|
|
6258
|
-
try {
|
|
6259
|
-
const connections = await resourceValue(this.catalogs.connections.get(intent.definition.provider, draft.flowId));
|
|
6260
|
-
const allowed = this.filterTriggerConnections == null ? connections : await this.filterTriggerConnections(draft.flowId, intent.definition, connections);
|
|
6261
|
-
intent = {
|
|
6262
|
-
...intent,
|
|
6263
|
-
connectionId: connectionCatalog(allowed).preferred?.connectionId
|
|
6264
|
-
};
|
|
6265
|
-
} catch (error) {
|
|
6266
|
-
if (!this.#disposed && this.#model.value.draft == draft) this.#setNotice(errorNotice(error, this.#i18n.t));
|
|
6267
|
-
}
|
|
6268
|
-
if (this.#disposed || this.#model.value.draft != draft) return;
|
|
6269
|
-
}
|
|
6270
6292
|
const edge = connection?.(nodeId);
|
|
6271
6293
|
const nodeChanges = addNode(revision, nodeId, intent);
|
|
6272
6294
|
if (nodeChanges == null) return;
|
|
@@ -6281,8 +6303,28 @@ var WorkspaceStore = class {
|
|
|
6281
6303
|
nodeId,
|
|
6282
6304
|
requestId: ++this.#nodeFocusId
|
|
6283
6305
|
} });
|
|
6306
|
+
if (intent.kind == "provider-trigger" && intent.connectionId == null) this.#configureAddedTrigger(draft.flowId, nodeId, intent.definition);
|
|
6284
6307
|
return nodeId;
|
|
6285
6308
|
}
|
|
6309
|
+
async #configureAddedTrigger(flowId, nodeId, definition) {
|
|
6310
|
+
const current = this.#draftSession.capture();
|
|
6311
|
+
const original = this.$.revision.value?.graph().nodes[nodeId];
|
|
6312
|
+
const unchanged = () => current() && !this.#disposed && this.$.revision.value?.graph().nodes[nodeId] === original;
|
|
6313
|
+
try {
|
|
6314
|
+
const connections = await resourceValue(this.catalogs.connections.get(definition.provider, flowId));
|
|
6315
|
+
if (!unchanged()) return;
|
|
6316
|
+
const allowed = this.filterTriggerConnections == null ? connections : await this.filterTriggerConnections(flowId, definition, connections);
|
|
6317
|
+
if (!unchanged()) return;
|
|
6318
|
+
const connection = connectionCatalog(allowed).preferred;
|
|
6319
|
+
if (connection == null) return;
|
|
6320
|
+
const revision = this.$.revision.value;
|
|
6321
|
+
if (revision == null) return;
|
|
6322
|
+
const changes = setTriggerConnection(revision, nodeId, connection.connectionId);
|
|
6323
|
+
if (changes != null && this.#history.completeNodeCreation(nodeId, changes)) await this.#changeDraft(changes, false, "canvas");
|
|
6324
|
+
} catch (error) {
|
|
6325
|
+
if (unchanged()) this.#setNotice(errorNotice(error, this.#i18n.t));
|
|
6326
|
+
}
|
|
6327
|
+
}
|
|
6286
6328
|
async connect(edge) {
|
|
6287
6329
|
const revision = this.$.revision.value;
|
|
6288
6330
|
if (revision == null) return;
|
|
@@ -6988,7 +7030,7 @@ var WorkbenchStore = class {
|
|
|
6988
7030
|
const model = this.$.designer.value;
|
|
6989
7031
|
const title = this.workspace.$.flow.value?.name ?? this.workspace.$.flowId.value ?? "Workflow";
|
|
6990
7032
|
try {
|
|
6991
|
-
const { downloadFlowSvg } = await import("./exportSvg-
|
|
7033
|
+
const { downloadFlowSvg } = await import("./exportSvg-Cj6Spxx-.js");
|
|
6992
7034
|
await downloadFlowSvg(model, title, language, options);
|
|
6993
7035
|
if (!this.#disposed) this.#notice.set({
|
|
6994
7036
|
kind: "success",
|
|
@@ -7242,7 +7284,7 @@ var WorkbenchStore = class {
|
|
|
7242
7284
|
};
|
|
7243
7285
|
//#endregion
|
|
7244
7286
|
//#region src/workbench/browser/runtime/openFlowWorkbench.tsx
|
|
7245
|
-
var FlowWorkspace = lazy(() => import("./flowWorkspace-
|
|
7287
|
+
var FlowWorkspace = lazy(() => import("./flowWorkspace-CB1QACku.js"));
|
|
7246
7288
|
function OpenFlowSessionGate({ action, description, error, onSubmit, onTokenChange, pending = false, title, token, tokenLabel }) {
|
|
7247
7289
|
const hasToken = token != null && tokenLabel != null && onTokenChange != null;
|
|
7248
7290
|
const tokenValue = token ?? "";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { gr as cn } from "./tooltip-CJjYs_2I.js";
|
|
2
|
-
import {
|
|
2
|
+
import { dt as SelectItem, lt as SelectContent, mt as SelectValue, pt as SelectTrigger, st as Select, ut as SelectGroup } from "./dialog-Bjo-r9B0.js";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
//#region src/workbench/browser/runtime/shell/workbenchSelect.tsx
|
|
5
5
|
function WorkbenchSelect({ ariaLabel, className, disabled = false, id, onValueChange, options, portalRoot, size, value, variant }) {
|