@oomol-lab/open-flow 0.1.0-beta.50 → 0.1.0-beta.51

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.
Files changed (33) hide show
  1. package/dist/browser/{createResourceDialog-CSltk-qY.js → createResourceDialog-BDtXpRSt.js} +1 -1
  2. package/dist/browser/flow-authoring-node.d.ts +3 -1
  3. package/dist/browser/flow-authoring.js +39 -3
  4. package/dist/browser/flow-change-schema.d.ts +1 -1
  5. package/dist/browser/flow-change.d.ts +9 -1
  6. package/dist/browser/flow-change.js +38 -3
  7. package/dist/browser/{flowChanges-DbYrpHnS.js → flowChanges-BWSXSnMX.js} +431 -27
  8. package/dist/browser/{flowWorkspace-CjwpbVBR.js → flowWorkspace-DBaq2Eks.js} +459 -190
  9. package/dist/browser/preview.css +20 -0
  10. package/dist/browser/preview.js +556 -21
  11. package/dist/browser/ui.css +20 -0
  12. package/dist/browser/ui.js +4 -3
  13. package/dist/browser/workbench-contract.d.ts +1 -0
  14. package/dist/browser/workbench.css +20 -0
  15. package/dist/browser/workbench.js +133 -22
  16. package/dist/browser/{workbenchSelect-oVujN2z6.js → workbenchSelect-C9kwcUmN.js} +47 -6
  17. package/dist/common/authoringExamples.d.ts +3 -2
  18. package/dist/common/control-api-conformance.js +82 -10
  19. package/dist/common/control-api.d.ts +34 -5
  20. package/dist/common/control-api.js +147 -10
  21. package/dist/common/control-requests.js +23 -1
  22. package/dist/common/flow-encoding.js +30 -5
  23. package/dist/common/flow-semantics.js +87 -2
  24. package/dist/common/integration-trigger.js +16 -1
  25. package/dist/common/mcp.js +82 -10
  26. package/dist/common/poll-trigger.js +16 -1
  27. package/dist/common/provider-triggers.js +16 -1
  28. package/dist/common/run-events.js +25 -1
  29. package/dist/common/scheduler.d.ts +3 -0
  30. package/dist/common/scheduler.js +91 -5
  31. package/dist/common/trigger-contract.d.ts +2 -0
  32. package/dist/common/webhook-trigger.js +16 -1
  33. package/package.json +1 -1
@@ -7512,7 +7512,8 @@ var en_default$3 = {
7512
7512
  "triggerSource": {
7513
7513
  "manual": "Manual",
7514
7514
  "cron": "Schedule",
7515
- "webhook": "Webhook"
7515
+ "webhook": "Webhook",
7516
+ "error": "Error Trigger"
7516
7517
  },
7517
7518
  "kind": {
7518
7519
  "task": "Task",
@@ -8150,7 +8151,8 @@ var fr_default$2 = {
8150
8151
  "triggerSource": {
8151
8152
  "manual": "Manuel",
8152
8153
  "cron": "Planification",
8153
- "webhook": "Webhook"
8154
+ "webhook": "Webhook",
8155
+ "error": "Déclencheur d’erreur"
8154
8156
  },
8155
8157
  "kind": {
8156
8158
  "task": "Tâche",
@@ -8788,7 +8790,8 @@ var ja_default$2 = {
8788
8790
  "triggerSource": {
8789
8791
  "manual": "手動",
8790
8792
  "cron": "スケジュール実行",
8791
- "webhook": "Webhook"
8793
+ "webhook": "Webhook",
8794
+ "error": "エラートリガー"
8792
8795
  },
8793
8796
  "kind": {
8794
8797
  "task": "タスク",
@@ -9426,7 +9429,8 @@ var ko_default$2 = {
9426
9429
  "triggerSource": {
9427
9430
  "manual": "수동",
9428
9431
  "cron": "일정",
9429
- "webhook": "Webhook"
9432
+ "webhook": "Webhook",
9433
+ "error": "오류 트리거"
9430
9434
  },
9431
9435
  "kind": {
9432
9436
  "task": "작업",
@@ -10064,7 +10068,8 @@ var ru_default$2 = {
10064
10068
  "triggerSource": {
10065
10069
  "manual": "Вручную",
10066
10070
  "cron": "Расписание",
10067
- "webhook": "Webhook"
10071
+ "webhook": "Webhook",
10072
+ "error": "Триггер ошибки"
10068
10073
  },
10069
10074
  "kind": {
10070
10075
  "task": "Задача",
@@ -10702,7 +10707,8 @@ var zh_CN_default$2 = {
10702
10707
  "triggerSource": {
10703
10708
  "manual": "手动",
10704
10709
  "cron": "定时",
10705
- "webhook": "Webhook"
10710
+ "webhook": "Webhook",
10711
+ "error": "错误触发器"
10706
10712
  },
10707
10713
  "kind": {
10708
10714
  "task": "任务",
@@ -11340,7 +11346,8 @@ var zh_TW_default$2 = {
11340
11346
  "triggerSource": {
11341
11347
  "manual": "手動",
11342
11348
  "cron": "排程",
11343
- "webhook": "Webhook"
11349
+ "webhook": "Webhook",
11350
+ "error": "錯誤觸發器"
11344
11351
  },
11345
11352
  "kind": {
11346
11353
  "task": "任務",
@@ -41933,7 +41940,7 @@ function CanvasNode({ nodeStore, problem, branches, compact = false, compactCont
41933
41940
  const title = node.title;
41934
41941
  const { values, summary, schedules, images, inline, hidden } = nodeCardContent(node);
41935
41942
  const kind = node?.kind ?? "task";
41936
- const triggerSource = node.kind == "trigger" ? node.presentation?.kind == "manual" || node.presentation?.kind == "cron" || node.presentation?.kind == "webhook" ? t(`canvasCard.triggerSource.${node.presentation.kind}`) : node.presentation?.source : void 0;
41943
+ const triggerSource = node.kind == "trigger" ? node.presentation?.kind == "error" || node.presentation?.kind == "manual" || node.presentation?.kind == "cron" || node.presentation?.kind == "webhook" ? t(`canvasCard.triggerSource.${node.presentation.kind}`) : node.presentation?.source : void 0;
41937
41944
  const subtitle = inline ? summary : node.kind == "task" ? node.executorName || t("canvasCard.kind.task") : node.kind == "trigger" && triggerSource ? `${t("canvasCard.kind.trigger")} · ${triggerSource}` : t(`canvasCard.kind.${kind}`);
41938
41945
  const runContent = node?.run == null || node.run.status == "idle" ? void 0 : /* @__PURE__ */ jsx(RunChips, { run: node.run });
41939
41946
  return /* @__PURE__ */ jsx("div", {
@@ -56691,6 +56698,7 @@ var endpoint = object({
56691
56698
  ])),
56692
56699
  successStatus: number()
56693
56700
  });
56701
+ var sourceFlowIds = array(text.min(1)).refine((ids) => new Set(ids).size === ids.length, "Duplicate source Flow ID.");
56694
56702
  var trigger = {
56695
56703
  name: text,
56696
56704
  description: text.optional(),
@@ -56748,6 +56756,11 @@ var node = union$1([
56748
56756
  ...trigger,
56749
56757
  kind: literal("manual")
56750
56758
  }),
56759
+ strictObject({
56760
+ ...trigger,
56761
+ kind: literal("error"),
56762
+ sourceFlowIds: sourceFlowIds.optional()
56763
+ }),
56751
56764
  object({
56752
56765
  ...trigger,
56753
56766
  kind: literal("webhook"),
@@ -56819,7 +56832,11 @@ var document$1 = object({
56819
56832
  tasks: record$1(text, managed)
56820
56833
  });
56821
56834
  var revision = object({
56822
- modelVersion: union$1([literal(2), literal(4)]),
56835
+ modelVersion: union$1([
56836
+ literal(2),
56837
+ literal(4),
56838
+ literal(5)
56839
+ ]),
56823
56840
  document: document$1,
56824
56841
  modules: record$1(text, module$1)
56825
56842
  });
@@ -56829,9 +56846,16 @@ revision.extend({
56829
56846
  });
56830
56847
  function decodeRevisionContent(value) {
56831
56848
  checkJsonDepth(value);
56832
- return revision.parse(value);
56849
+ const content = revision.parse(value);
56850
+ checkErrorModelVersion(content);
56851
+ return content;
56833
56852
  }
56834
56853
  var shapes = {
56854
+ "graph.trigger.sources.set": {
56855
+ nodeId: text,
56856
+ before: sourceFlowIds.optional(),
56857
+ value: sourceFlowIds.optional()
56858
+ },
56835
56859
  "binding.create": {
56836
56860
  bindingId: text,
56837
56861
  binding
@@ -57005,6 +57029,9 @@ array(union$1([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, s
57005
57029
  kind: literal(kind),
57006
57030
  ...shape
57007
57031
  })])).values()])).min(1);
57032
+ function checkErrorModelVersion(content) {
57033
+ if (content.modelVersion < 5 && [content.document.graph, ...Object.values(content.document.subflows).map((item) => item.graph)].some((item) => Object.values(item.nodes).some((itemNode) => itemNode.kind == "error"))) throw new TypeError("Error workflows require Flow model version 5.");
57034
+ }
57008
57035
  //#endregion
57009
57036
  //#region src/flow/common/change.ts
57010
57037
  var schemaKeywords = /* @__PURE__ */ new Set([
@@ -57218,6 +57245,67 @@ function isJsonObject(value) {
57218
57245
  }
57219
57246
  //#endregion
57220
57247
  //#region src/trigger/common/contract.ts
57248
+ var errorOutputs = [
57249
+ {
57250
+ handle: "workflow",
57251
+ nullable: false,
57252
+ jsonSchema: {
57253
+ type: "object",
57254
+ additionalProperties: false,
57255
+ required: [
57256
+ "flowId",
57257
+ "name",
57258
+ "revisionId",
57259
+ "publicationId"
57260
+ ],
57261
+ properties: {
57262
+ flowId: { type: "string" },
57263
+ name: { type: "string" },
57264
+ revisionId: { type: "string" },
57265
+ publicationId: { type: ["string", "null"] }
57266
+ }
57267
+ }
57268
+ },
57269
+ {
57270
+ handle: "execution",
57271
+ nullable: false,
57272
+ jsonSchema: {
57273
+ type: "object",
57274
+ additionalProperties: false,
57275
+ required: [
57276
+ "runId",
57277
+ "status",
57278
+ "startedAt",
57279
+ "finishedAt"
57280
+ ],
57281
+ properties: {
57282
+ runId: { type: "string" },
57283
+ status: { enum: ["failed", "indeterminate"] },
57284
+ startedAt: { type: ["string", "null"] },
57285
+ finishedAt: { type: "string" }
57286
+ }
57287
+ }
57288
+ },
57289
+ {
57290
+ handle: "error",
57291
+ nullable: false,
57292
+ jsonSchema: {
57293
+ type: "object",
57294
+ additionalProperties: false,
57295
+ required: ["code", "message"],
57296
+ properties: {
57297
+ code: { type: "string" },
57298
+ message: { type: "string" },
57299
+ nodeId: { type: "string" },
57300
+ jobId: { type: "string" },
57301
+ path: {
57302
+ type: "array",
57303
+ items: { type: "string" }
57304
+ }
57305
+ }
57306
+ }
57307
+ }
57308
+ ];
57221
57309
  var webhookOutputs = [
57222
57310
  {
57223
57311
  handle: "headers",
@@ -57262,6 +57350,7 @@ var cronOutputs = [{
57262
57350
  }];
57263
57351
  function triggerOutputDefinitions(trigger) {
57264
57352
  switch (trigger.kind) {
57353
+ case "error": return errorOutputs;
57265
57354
  case "manual": return [];
57266
57355
  case "cron": return cronOutputs;
57267
57356
  case "poll":
@@ -57323,6 +57412,7 @@ function nodeInputPorts(document, node) {
57323
57412
  case "cron":
57324
57413
  case "integration":
57325
57414
  case "poll":
57415
+ case "error":
57326
57416
  case "manual":
57327
57417
  case "webhook": return {};
57328
57418
  }
@@ -57373,6 +57463,7 @@ function nodeOutputPorts(document, node) {
57373
57463
  case "cron":
57374
57464
  case "integration":
57375
57465
  case "poll":
57466
+ case "error":
57376
57467
  case "manual":
57377
57468
  case "webhook": return triggerOutputPorts(node);
57378
57469
  }
@@ -58673,6 +58764,7 @@ var RevisionView = class {
58673
58764
  node
58674
58765
  };
58675
58766
  break;
58767
+ case "error":
58676
58768
  case "manual":
58677
58769
  case "cron":
58678
58770
  case "integration":
@@ -67030,6 +67122,7 @@ function executorName(task, providerName, t) {
67030
67122
  }
67031
67123
  function triggerIcon(trigger) {
67032
67124
  switch (trigger.kind) {
67125
+ case "error": return ":carbon:warning-alt:";
67033
67126
  case "manual": return ":carbon:play:";
67034
67127
  case "cron": return ":carbon:time:";
67035
67128
  case "integration": return ":carbon:events:";
@@ -67179,6 +67272,7 @@ function triggerDesignerNode(triggerId, trigger, position, diagnostics, provider
67179
67272
  const provider = trigger.kind == "integration" || trigger.kind == "poll" ? providers[trigger.definition.provider] : void 0;
67180
67273
  let presentation;
67181
67274
  switch (trigger.kind) {
67275
+ case "error":
67182
67276
  case "manual":
67183
67277
  presentation = {
67184
67278
  kind: trigger.kind,
@@ -77710,12 +77804,13 @@ function Dialog(props) {
77710
77804
  ...props
77711
77805
  });
77712
77806
  }
77713
- function DialogTrigger(props) {
77807
+ var DialogTrigger = m$4.forwardRef(function DialogTrigger(props, ref) {
77714
77808
  return /* @__PURE__ */ jsx(DialogTrigger$1, {
77715
77809
  "data-slot": "dialog-trigger",
77716
- ...props
77810
+ ...props,
77811
+ ref
77717
77812
  });
77718
- }
77813
+ });
77719
77814
  function DialogPortal(props) {
77720
77815
  return /* @__PURE__ */ jsx(DialogPortal$1, {
77721
77816
  "data-slot": "dialog-portal",
@@ -96082,7 +96177,7 @@ function EditableAgentSettingsProvider({ children, task, nodeId, store, connecto
96082
96177
  const definition = current?.kind == "task" ? current.definition : void 0;
96083
96178
  if (definition == null || !("executor" in definition) || !dequal(definition.executor, before)) return false;
96084
96179
  const decoded = decodeRevisionContent({
96085
- modelVersion: 4,
96180
+ modelVersion: 5,
96086
96181
  modules: {},
96087
96182
  document: {
96088
96183
  bindings: {},
@@ -96319,6 +96414,7 @@ function withDescriptions$1(ports, descriptionFor) {
96319
96414
  function presentBuiltInTriggerOutputs(trigger, t) {
96320
96415
  const ports = triggerOutputDefinitions(trigger);
96321
96416
  switch (trigger.kind) {
96417
+ case "error": return withDescriptions$1(ports, (handle) => t(`errorWorkflow.${handle}`));
96322
96418
  case "cron": return withDescriptions$1(ports, (handle) => handle === "scheduledAt" ? t("inspector.ports.builtIn.cron.scheduledAt") : void 0);
96323
96419
  case "webhook": return withDescriptions$1(ports, (handle) => {
96324
96420
  switch (handle) {
@@ -96340,6 +96436,7 @@ function presentedBuiltInOutputs(node, t) {
96340
96436
  switch (node.kind) {
96341
96437
  case "approval":
96342
96438
  case "wait": return presentResolutionOutputs(node, t);
96439
+ case "error":
96343
96440
  case "cron":
96344
96441
  case "webhook": return presentBuiltInTriggerOutputs(node, t);
96345
96442
  default: return;
@@ -98783,6 +98880,200 @@ function ConditionBranchesEditor({ value: configuration, disabled, readOnly, onC
98783
98880
  });
98784
98881
  }
98785
98882
  //#endregion
98883
+ //#region src/workbench/browser/runtime/editor/errorTriggerSources.tsx
98884
+ function ErrorTriggerSources({ flows, flowId, value, disabled = false, complete = true, footer, onChange }) {
98885
+ const t = useTranslate();
98886
+ const id = useId();
98887
+ const [query, setQuery] = useState("");
98888
+ const [open, setOpen] = useState(false);
98889
+ const [container, setContainer] = useState(null);
98890
+ const search = useRef(null);
98891
+ const eligible = flows.filter((flow) => flow.flowId != flowId && flow.status == "active" && flow.live != null);
98892
+ const candidates = [.../* @__PURE__ */ new Set([...eligible.map((flow) => flow.flowId), ...value])].map((sourceId) => {
98893
+ const flow = flows.find((item) => item.flowId == sourceId);
98894
+ const issue = sourceId == flowId ? "self" : flow?.status == "retiring" ? "retiring" : flow == null ? complete ? "deleted" : void 0 : flow.live == null ? "unpublished" : void 0;
98895
+ return {
98896
+ id: sourceId,
98897
+ name: flow?.name ?? (issue == "deleted" ? t("errorWorkflow.deletedName") : sourceId),
98898
+ issue
98899
+ };
98900
+ });
98901
+ const visible = candidates.filter((flow) => `${flow.name} ${flow.id}`.toLocaleLowerCase().includes(query.toLocaleLowerCase()));
98902
+ const selected = candidates.filter((flow) => value.includes(flow.id));
98903
+ const summary = selected.map((flow) => flow.name).join(", ");
98904
+ const unavailable = selected.filter((flow) => flow.issue);
98905
+ return /* @__PURE__ */ jsxs(Field, {
98906
+ className: "inspector-field-section",
98907
+ children: [/* @__PURE__ */ jsx(FieldLabel, {
98908
+ className: "inspector-section-title",
98909
+ htmlFor: id,
98910
+ children: t("errorWorkflow.sources")
98911
+ }), /* @__PURE__ */ jsxs("div", {
98912
+ className: "flex flex-col gap-3",
98913
+ children: [
98914
+ /* @__PURE__ */ jsx("div", {
98915
+ ref: setContainer,
98916
+ className: "min-w-0",
98917
+ children: /* @__PURE__ */ jsxs(Popover, {
98918
+ open,
98919
+ onOpenChange: (next) => {
98920
+ setOpen(next);
98921
+ if (!next) setQuery("");
98922
+ },
98923
+ children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
98924
+ render: /* @__PURE__ */ jsx(Button$1, {
98925
+ id,
98926
+ type: "button",
98927
+ variant: "field",
98928
+ size: "field",
98929
+ disabled,
98930
+ "aria-label": `${t("errorWorkflow.sources")}: ${summary || t("errorWorkflow.choose")}`,
98931
+ "aria-describedby": `${id}-hint${unavailable.length > 0 ? ` ${id}-error` : ""}`,
98932
+ "aria-invalid": unavailable.length > 0 || void 0,
98933
+ className: "w-full min-w-0 justify-between"
98934
+ }),
98935
+ children: [/* @__PURE__ */ jsx("span", {
98936
+ className: `min-w-0 flex-1 truncate text-left ${value.length == 0 ? "text-muted-foreground" : ""}`,
98937
+ title: summary || void 0,
98938
+ children: summary || t("errorWorkflow.choose")
98939
+ }), /* @__PURE__ */ jsx(SelectChevron, {})]
98940
+ }), /* @__PURE__ */ jsxs(PopoverContent, {
98941
+ container,
98942
+ align: "start",
98943
+ initialFocus: search,
98944
+ "aria-label": t("errorWorkflow.sources"),
98945
+ className: `w-(--anchor-width) min-w-56 max-w-[calc(100vw-24px)] gap-1 ${selectionMenuContentClass}`,
98946
+ children: [
98947
+ /* @__PURE__ */ jsx("div", {
98948
+ className: "p-1",
98949
+ children: /* @__PURE__ */ jsx(Input, {
98950
+ ref: search,
98951
+ "aria-label": t("errorWorkflow.search"),
98952
+ placeholder: t("errorWorkflow.search"),
98953
+ value: query,
98954
+ onChange: (event) => setQuery(event.target.value)
98955
+ })
98956
+ }),
98957
+ /* @__PURE__ */ jsxs("div", {
98958
+ role: "group",
98959
+ "aria-label": t("errorWorkflow.sources"),
98960
+ className: "max-h-[min(40vh,280px)] overflow-y-auto overscroll-contain",
98961
+ children: [visible.map((flow) => /* @__PURE__ */ jsxs(Label, {
98962
+ className: `flex cursor-default items-center gap-2 px-2 hover:bg-accent focus-within:bg-accent ${selectionMenuItemClass}`,
98963
+ children: [/* @__PURE__ */ jsx(Checkbox, {
98964
+ checked: value.includes(flow.id),
98965
+ disabled,
98966
+ onCheckedChange: (checked) => onChange(checked ? [...value, flow.id] : value.filter((item) => item != flow.id))
98967
+ }), /* @__PURE__ */ jsxs("span", {
98968
+ className: "min-w-0 flex-1 break-words",
98969
+ children: [
98970
+ flow.name,
98971
+ flow.issue == "deleted" && /* @__PURE__ */ jsx("span", {
98972
+ className: "block break-all text-muted-foreground",
98973
+ children: flow.id
98974
+ }),
98975
+ flow.issue && /* @__PURE__ */ jsx("span", {
98976
+ className: "block text-destructive",
98977
+ children: t(`errorWorkflow.${flow.issue}`)
98978
+ })
98979
+ ]
98980
+ })]
98981
+ }, flow.id)), visible.length == 0 && /* @__PURE__ */ jsx("p", {
98982
+ className: "px-2 py-3 text-xs text-muted-foreground",
98983
+ children: t(query ? "errorWorkflow.noMatches" : "errorWorkflow.empty")
98984
+ })]
98985
+ }),
98986
+ footer,
98987
+ /* @__PURE__ */ jsx("div", {
98988
+ role: "separator",
98989
+ className: "mx-2 my-1 h-px bg-border/50"
98990
+ }),
98991
+ /* @__PURE__ */ jsxs("div", {
98992
+ className: "flex items-center justify-between gap-2 px-1 pb-1",
98993
+ children: [/* @__PURE__ */ jsx(Button$1, {
98994
+ variant: "ghost",
98995
+ size: "sm",
98996
+ disabled: disabled || value.length == 0,
98997
+ onClick: () => onChange([]),
98998
+ children: t("errorWorkflow.clear")
98999
+ }), /* @__PURE__ */ jsx(Button$1, {
99000
+ variant: "ghost",
99001
+ size: "sm",
99002
+ onClick: () => {
99003
+ setOpen(false);
99004
+ setQuery("");
99005
+ },
99006
+ children: t("errorWorkflow.done")
99007
+ })]
99008
+ })
99009
+ ]
99010
+ })]
99011
+ })
99012
+ }),
99013
+ /* @__PURE__ */ jsx(FieldDescription, {
99014
+ id: `${id}-hint`,
99015
+ children: t("errorWorkflow.setupHint")
99016
+ }),
99017
+ unavailable.length > 0 && /* @__PURE__ */ jsxs("div", {
99018
+ className: "flex flex-col items-start gap-2",
99019
+ children: [/* @__PURE__ */ jsxs(FieldError, {
99020
+ id: `${id}-error`,
99021
+ children: [/* @__PURE__ */ jsx("ul", { children: unavailable.map((flow) => /* @__PURE__ */ jsxs("li", { children: [
99022
+ flow.name,
99023
+ " · ",
99024
+ t(`errorWorkflow.${flow.issue}`)
99025
+ ] }, flow.id)) }), /* @__PURE__ */ jsx("p", { children: t("errorWorkflow.removeHint") })]
99026
+ }), !disabled && /* @__PURE__ */ jsx(Button$1, {
99027
+ variant: "outline",
99028
+ size: "sm",
99029
+ onClick: () => onChange(value.filter((sourceId) => !unavailable.some((flow) => flow.id == sourceId))),
99030
+ children: t("errorWorkflow.removeUnavailable")
99031
+ })]
99032
+ })
99033
+ ]
99034
+ })]
99035
+ });
99036
+ }
99037
+ function ErrorTriggerSourcesEditor({ store, nodeId, value, disabled }) {
99038
+ const t = useTranslate();
99039
+ const draft = useVal(store.$.draft);
99040
+ const flows = useVal(store.$.flows);
99041
+ const loading = useVal(store.$.flowLoading);
99042
+ const failed = useVal(store.$.flowLoadFailed);
99043
+ const more = useVal(store.$.flowNextCursor);
99044
+ const loadingMore = useVal(store.$.flowLoadingMore);
99045
+ const moreFailed = useVal(store.$.flowLoadMoreFailed);
99046
+ useEffect(() => {
99047
+ store.reloadFlows();
99048
+ }, [store]);
99049
+ return /* @__PURE__ */ jsx("div", {
99050
+ className: "flex flex-col gap-3",
99051
+ "aria-busy": loading || loadingMore,
99052
+ children: /* @__PURE__ */ jsx(ErrorTriggerSources, {
99053
+ flows,
99054
+ flowId: draft?.flowId ?? "",
99055
+ value,
99056
+ disabled: disabled || loading,
99057
+ complete: !loading && !failed && more == null,
99058
+ footer: /* @__PURE__ */ jsxs(Fragment$1, { children: [failed && /* @__PURE__ */ jsx(Button$1, {
99059
+ variant: "outline",
99060
+ size: "sm",
99061
+ onClick: () => void store.reloadFlows(),
99062
+ children: t("errorWorkflow.retry")
99063
+ }), more != null && /* @__PURE__ */ jsx(Button$1, {
99064
+ variant: "outline",
99065
+ size: "sm",
99066
+ disabled: loadingMore,
99067
+ onClick: () => void store.loadMoreFlows(),
99068
+ children: t(moreFailed ? "errorWorkflow.retry" : "errorWorkflow.more")
99069
+ })] }),
99070
+ onChange: (next) => {
99071
+ store.saveErrorSources(nodeId, next);
99072
+ }
99073
+ })
99074
+ });
99075
+ }
99076
+ //#endregion
98786
99077
  //#region src/trigger/providers/feishu/config.ts
98787
99078
  function feishuResourceKind(events) {
98788
99079
  if (events.length == 0) return;
@@ -100864,7 +101155,12 @@ var resources = {
100864
101155
  "renameFlow": "Rename {{name}}",
100865
101156
  "search": "Search",
100866
101157
  "searchResources": "Search {{kind}}",
100867
- "subflows": "Subflows"
101158
+ "subflows": "Subflows",
101159
+ "listenersLoading": "Checking error listeners…",
101160
+ "listenersFailed": "Could not check error listeners. Retry or continue deleting.",
101161
+ "listenersTitle": "These published Error Trigger configurations listen to this workflow:",
101162
+ "listenerDisabled": "Disabled",
101163
+ "listenersImpact": "Deleting stops errors from this workflow reaching these triggers. Other upstream workflows are unaffected. Unavailable references must be removed from their configurations manually."
100868
101164
  },
100869
101165
  diagnostics: {
100870
101166
  "checking": "Checking the current Draft…",
@@ -101456,6 +101752,34 @@ var resources = {
101456
101752
  "loading": "Loading version…",
101457
101753
  "failed": "This version could not be loaded. Its content may no longer be available.",
101458
101754
  "root": "Main flow"
101755
+ },
101756
+ errorWorkflow: {
101757
+ "trigger": "Error Trigger",
101758
+ "description": "Runs when another workflow fails.",
101759
+ "empty": "No published workflows available.",
101760
+ "retry": "Retry",
101761
+ "more": "Load more",
101762
+ "pending": "Waiting for error handling",
101763
+ "dispatched": "Error handling run",
101764
+ "failed": "Error handling could not start",
101765
+ "source": "Source run",
101766
+ "workflow": "Workflow that failed.",
101767
+ "execution": "Failed execution and its final status.",
101768
+ "error": "Error message and available node location.",
101769
+ "setupHint": "Choose published workflows. Publish and enable this workflow to listen for failures in their automatic runs.",
101770
+ "sources": "Upstream workflows",
101771
+ "search": "Search upstream workflows",
101772
+ "noMatches": "No matching workflows",
101773
+ "choose": "Select upstream workflows",
101774
+ "done": "Done",
101775
+ "clear": "Clear selection",
101776
+ "deletedName": "Deleted workflow",
101777
+ "deleted": "Deleted",
101778
+ "retiring": "Being deleted",
101779
+ "unpublished": "Not published",
101780
+ "self": "Cannot listen to this workflow itself",
101781
+ "removeHint": "Remove unavailable upstream workflows before publishing again.",
101782
+ "removeUnavailable": "Remove unavailable upstreams"
101459
101783
  }
101460
101784
  },
101461
101785
  "zh-CN": {
@@ -102214,7 +102538,12 @@ var resources = {
102214
102538
  "renameFlow": "重命名 {{name}}",
102215
102539
  "search": "搜索",
102216
102540
  "searchResources": "搜索{{kind}}",
102217
- "subflows": "Subflow"
102541
+ "subflows": "Subflow",
102542
+ "listenersLoading": "正在查询错误触发器…",
102543
+ "listenersFailed": "无法确认哪些错误触发器正在监听。可重试,或继续删除。",
102544
+ "listenersTitle": "以下已发布的错误触发器配置正在监听此工作流:",
102545
+ "listenerDisabled": "已停用",
102546
+ "listenersImpact": "删除后将停止接收此工作流的错误,其他上游的监听不受影响。配置中的失效引用需手动移除。"
102218
102547
  },
102219
102548
  diagnostics: {
102220
102549
  "checking": "正在检查当前草稿…",
@@ -102806,6 +103135,34 @@ var resources = {
102806
103135
  "loading": "正在加载版本…",
102807
103136
  "failed": "无法加载此版本,其内容可能已不可用。",
102808
103137
  "root": "主流程"
103138
+ },
103139
+ errorWorkflow: {
103140
+ "trigger": "错误触发器",
103141
+ "description": "其他工作流失败时运行。",
103142
+ "empty": "暂无可选的已发布工作流。",
103143
+ "retry": "重试",
103144
+ "more": "加载更多",
103145
+ "pending": "等待错误处理",
103146
+ "dispatched": "错误处理运行",
103147
+ "failed": "无法启动错误处理",
103148
+ "source": "来源运行",
103149
+ "workflow": "发生错误的工作流。",
103150
+ "execution": "失败运行及其最终状态。",
103151
+ "error": "错误消息及可用的节点位置。",
103152
+ "setupHint": "可多选已发布的其他工作流。发布并启用当前工作流后生效,仅监听自动运行失败。",
103153
+ "sources": "监听的上游工作流",
103154
+ "search": "搜索上游工作流",
103155
+ "noMatches": "没有匹配的工作流",
103156
+ "choose": "选择上游工作流",
103157
+ "done": "完成",
103158
+ "clear": "清空选择",
103159
+ "deletedName": "已删除的工作流",
103160
+ "deleted": "已删除",
103161
+ "retiring": "删除中",
103162
+ "unpublished": "未发布",
103163
+ "self": "不能监听当前工作流",
103164
+ "removeHint": "请移除失效上游后重新发布。",
103165
+ "removeUnavailable": "移除失效上游"
102809
103166
  }
102810
103167
  },
102811
103168
  "zh-TW": {
@@ -103564,7 +103921,12 @@ var resources = {
103564
103921
  "renameFlow": "重新命名 {{name}}",
103565
103922
  "search": "搜尋",
103566
103923
  "searchResources": "搜尋 {{kind}}",
103567
- "subflows": "Subflow"
103924
+ "subflows": "Subflow",
103925
+ "listenersLoading": "正在查詢錯誤觸發器…",
103926
+ "listenersFailed": "無法確認哪些錯誤觸發器正在監聽。可重試,或繼續刪除。",
103927
+ "listenersTitle": "以下已發佈的錯誤觸發器設定正在監聽此工作流程:",
103928
+ "listenerDisabled": "已停用",
103929
+ "listenersImpact": "刪除後將停止接收此工作流程的錯誤,其他上游的監聽不受影響。設定中的失效引用需手動移除。"
103568
103930
  },
103569
103931
  diagnostics: {
103570
103932
  "checking": "正在檢查目前的草稿…",
@@ -104156,6 +104518,34 @@ var resources = {
104156
104518
  "loading": "正在載入版本…",
104157
104519
  "failed": "無法載入此版本,其內容可能已無法使用。",
104158
104520
  "root": "主流程"
104521
+ },
104522
+ errorWorkflow: {
104523
+ "trigger": "錯誤觸發器",
104524
+ "description": "其他工作流程失敗時執行。",
104525
+ "empty": "暫無可選的已發布工作流程。",
104526
+ "retry": "重試",
104527
+ "more": "載入更多",
104528
+ "pending": "等待錯誤處理",
104529
+ "dispatched": "錯誤處理執行",
104530
+ "failed": "無法啟動錯誤處理",
104531
+ "source": "來源執行",
104532
+ "workflow": "發生錯誤的工作流程。",
104533
+ "execution": "失敗執行及其最終狀態。",
104534
+ "error": "錯誤訊息及可用的節點位置。",
104535
+ "setupHint": "可複選已發布的其他工作流程。發布並啟用目前工作流程後生效,僅監聽自動執行失敗。",
104536
+ "sources": "監聽的上游工作流程",
104537
+ "search": "搜尋上游工作流程",
104538
+ "noMatches": "沒有符合的工作流程",
104539
+ "choose": "選擇上游工作流程",
104540
+ "done": "完成",
104541
+ "clear": "清空選取",
104542
+ "deletedName": "已刪除的工作流程",
104543
+ "deleted": "已刪除",
104544
+ "retiring": "刪除中",
104545
+ "unpublished": "未發佈",
104546
+ "self": "不能監聽目前工作流程",
104547
+ "removeHint": "請移除失效上游後重新發佈。",
104548
+ "removeUnavailable": "移除失效上游"
104159
104549
  }
104160
104550
  },
104161
104551
  "ja": {
@@ -104702,7 +105092,12 @@ var resources = {
104702
105092
  "renameFlow": "{{name}} の名前を変更",
104703
105093
  "search": "検索",
104704
105094
  "searchResources": "{{kind}} を検索",
104705
- "subflows": "Subflow"
105095
+ "subflows": "Subflow",
105096
+ "listenersLoading": "エラートリガーを確認中…",
105097
+ "listenersFailed": "エラートリガーを確認できませんでした。再試行するか、削除を続行できます。",
105098
+ "listenersTitle": "次の公開済みエラートリガー設定がこのワークフローを監視しています:",
105099
+ "listenerDisabled": "無効",
105100
+ "listenersImpact": "削除すると、このワークフローのエラーは届かなくなります。他の上流の監視には影響しません。無効な参照は設定から手動で削除してください。"
104706
105101
  },
104707
105102
  diagnostics: {
104708
105103
  "checking": "現在のドラフトを検査中…",
@@ -105294,6 +105689,34 @@ var resources = {
105294
105689
  "loading": "バージョンを読み込み中…",
105295
105690
  "failed": "このバージョンを読み込めません。内容が利用できなくなった可能性があります。",
105296
105691
  "root": "メインフロー"
105692
+ },
105693
+ errorWorkflow: {
105694
+ "trigger": "エラートリガー",
105695
+ "description": "別のワークフローが失敗したときに実行します。",
105696
+ "empty": "選択できる公開済みワークフローがありません。",
105697
+ "retry": "再試行",
105698
+ "more": "さらに読み込む",
105699
+ "pending": "エラー処理を待機中",
105700
+ "dispatched": "エラー処理の実行",
105701
+ "failed": "エラー処理を開始できませんでした",
105702
+ "source": "元の実行",
105703
+ "workflow": "失敗したワークフロー。",
105704
+ "execution": "失敗した実行と最終状態。",
105705
+ "error": "エラーメッセージと利用可能なノード位置。",
105706
+ "setupHint": "公開済みの他のワークフローを複数選択できます。このワークフローを公開して有効にすると、自動実行の失敗を監視します。",
105707
+ "sources": "監視する上流ワークフロー",
105708
+ "search": "上流ワークフローを検索",
105709
+ "noMatches": "一致するワークフローがありません",
105710
+ "choose": "上流ワークフローを選択",
105711
+ "done": "完了",
105712
+ "clear": "選択をクリア",
105713
+ "deletedName": "削除済みのワークフロー",
105714
+ "deleted": "削除済み",
105715
+ "retiring": "削除中",
105716
+ "unpublished": "未公開",
105717
+ "self": "このワークフロー自身は監視できません",
105718
+ "removeHint": "利用できない上流ワークフローを削除してから再公開してください。",
105719
+ "removeUnavailable": "利用できない上流を削除"
105297
105720
  }
105298
105721
  },
105299
105722
  "ko": {
@@ -105840,7 +106263,12 @@ var resources = {
105840
106263
  "renameFlow": "{{name}} 이름 바꾸기",
105841
106264
  "search": "검색",
105842
106265
  "searchResources": "{{kind}} 검색",
105843
- "subflows": "Subflow"
106266
+ "subflows": "Subflow",
106267
+ "listenersLoading": "오류 트리거 확인 중…",
106268
+ "listenersFailed": "오류 트리거를 확인하지 못했습니다. 다시 시도하거나 삭제를 계속할 수 있습니다.",
106269
+ "listenersTitle": "다음 게시된 오류 트리거 설정이 이 워크플로를 감시합니다:",
106270
+ "listenerDisabled": "비활성화됨",
106271
+ "listenersImpact": "삭제하면 이 워크플로의 오류 전달이 중단됩니다. 다른 상위 워크플로에는 영향이 없습니다. 설정에서 사용할 수 없는 참조를 직접 제거해야 합니다."
105844
106272
  },
105845
106273
  diagnostics: {
105846
106274
  "checking": "현재 초안을 검사하는 중…",
@@ -106432,6 +106860,34 @@ var resources = {
106432
106860
  "loading": "버전 불러오는 중…",
106433
106861
  "failed": "이 버전을 불러올 수 없습니다. 내용을 더 이상 사용할 수 없을 수 있습니다.",
106434
106862
  "root": "메인 플로"
106863
+ },
106864
+ errorWorkflow: {
106865
+ "trigger": "오류 트리거",
106866
+ "description": "다른 워크플로가 실패하면 실행합니다.",
106867
+ "empty": "선택할 수 있는 게시된 워크플로가 없습니다.",
106868
+ "retry": "다시 시도",
106869
+ "more": "더 불러오기",
106870
+ "pending": "오류 처리 대기 중",
106871
+ "dispatched": "오류 처리 실행",
106872
+ "failed": "오류 처리를 시작할 수 없음",
106873
+ "source": "원본 실행",
106874
+ "workflow": "실패한 워크플로입니다.",
106875
+ "execution": "실패한 실행 및 최종 상태입니다.",
106876
+ "error": "오류 메시지 및 확인 가능한 노드 위치입니다.",
106877
+ "setupHint": "게시된 다른 워크플로를 여러 개 선택하세요. 현재 워크플로를 게시하고 활성화하면 자동 실행 실패를 감시합니다.",
106878
+ "sources": "감시할 상위 워크플로",
106879
+ "search": "상위 워크플로 검색",
106880
+ "noMatches": "일치하는 워크플로가 없습니다",
106881
+ "choose": "상위 워크플로 선택",
106882
+ "done": "완료",
106883
+ "clear": "선택 해제",
106884
+ "deletedName": "삭제된 워크플로",
106885
+ "deleted": "삭제됨",
106886
+ "retiring": "삭제 중",
106887
+ "unpublished": "게시되지 않음",
106888
+ "self": "현재 워크플로 자체는 감시할 수 없습니다",
106889
+ "removeHint": "사용할 수 없는 상위 워크플로를 제거한 후 다시 게시하세요.",
106890
+ "removeUnavailable": "사용 불가 상위 제거"
106435
106891
  }
106436
106892
  },
106437
106893
  "ru": {
@@ -106978,7 +107434,12 @@ var resources = {
106978
107434
  "renameFlow": "Переименовать {{name}}",
106979
107435
  "search": "Поиск",
106980
107436
  "searchResources": "Поиск {{kind}}",
106981
- "subflows": "Subflow"
107437
+ "subflows": "Subflow",
107438
+ "listenersLoading": "Проверка обработчиков ошибок…",
107439
+ "listenersFailed": "Не удалось проверить обработчики. Повторите попытку или продолжите удаление.",
107440
+ "listenersTitle": "Эти опубликованные настройки триггеров ошибок отслеживают процесс:",
107441
+ "listenerDisabled": "Отключён",
107442
+ "listenersImpact": "После удаления ошибки этого процесса больше не будут поступать. Другие исходные процессы не затрагиваются. Недоступные ссылки нужно удалить из настроек вручную."
106982
107443
  },
106983
107444
  diagnostics: {
106984
107445
  "checking": "Проверка текущего черновика…",
@@ -107429,6 +107890,34 @@ var resources = {
107429
107890
  "loading": "Загрузка версии…",
107430
107891
  "failed": "Не удалось загрузить версию. Её содержимое может быть недоступно.",
107431
107892
  "root": "Основной процесс"
107893
+ },
107894
+ errorWorkflow: {
107895
+ "trigger": "Триггер ошибки",
107896
+ "description": "Запускается при сбое другого процесса.",
107897
+ "empty": "Нет доступных опубликованных процессов.",
107898
+ "retry": "Повторить",
107899
+ "more": "Загрузить ещё",
107900
+ "pending": "Ожидание обработки ошибки",
107901
+ "dispatched": "Запуск обработки ошибки",
107902
+ "failed": "Не удалось запустить обработку ошибки",
107903
+ "source": "Исходный запуск",
107904
+ "workflow": "Процесс, завершившийся ошибкой.",
107905
+ "execution": "Неудачный запуск и его итоговый статус.",
107906
+ "error": "Сообщение об ошибке и доступное расположение узла.",
107907
+ "setupHint": "Выберите опубликованные процессы. Опубликуйте и включите текущий процесс для обработки сбоев их автоматических запусков.",
107908
+ "sources": "Отслеживаемые процессы",
107909
+ "search": "Поиск отслеживаемых процессов",
107910
+ "noMatches": "Подходящих процессов нет",
107911
+ "choose": "Выбрать отслеживаемые процессы",
107912
+ "done": "Готово",
107913
+ "clear": "Снять выбор",
107914
+ "deletedName": "Удалённый процесс",
107915
+ "deleted": "Удалён",
107916
+ "retiring": "Удаляется",
107917
+ "unpublished": "Не опубликован",
107918
+ "self": "Нельзя отслеживать этот же процесс",
107919
+ "removeHint": "Удалите недоступные исходные процессы перед повторной публикацией.",
107920
+ "removeUnavailable": "Убрать недоступные процессы"
107432
107921
  }
107433
107922
  },
107434
107923
  "fr": {
@@ -108187,7 +108676,12 @@ var resources = {
108187
108676
  "renameFlow": "Renommer {{name}}",
108188
108677
  "search": "Rechercher",
108189
108678
  "searchResources": "Rechercher des {{kind}}",
108190
- "subflows": "Subflows"
108679
+ "subflows": "Subflows",
108680
+ "listenersLoading": "Recherche des déclencheurs d’erreur…",
108681
+ "listenersFailed": "Impossible de vérifier les déclencheurs. Réessayez ou poursuivez la suppression.",
108682
+ "listenersTitle": "Ces configurations publiées de déclencheurs d’erreur surveillent ce workflow :",
108683
+ "listenerDisabled": "Désactivé",
108684
+ "listenersImpact": "La suppression arrête la transmission des erreurs de ce workflow. Les autres workflows en amont ne sont pas affectés. Retirez manuellement les références indisponibles des configurations."
108191
108685
  },
108192
108686
  diagnostics: {
108193
108687
  "checking": "Vérification du Brouillon actuel…",
@@ -108779,6 +109273,34 @@ var resources = {
108779
109273
  "loading": "Chargement de la version…",
108780
109274
  "failed": "Impossible de charger cette version. Son contenu est peut-être indisponible.",
108781
109275
  "root": "Flux principal"
109276
+ },
109277
+ errorWorkflow: {
109278
+ "trigger": "Déclencheur d’erreur",
109279
+ "description": "Exécute ce workflow lorsqu’un autre échoue.",
109280
+ "empty": "Aucun workflow publié disponible.",
109281
+ "retry": "Réessayer",
109282
+ "more": "Charger plus",
109283
+ "pending": "En attente de gestion des erreurs",
109284
+ "dispatched": "Exécution de gestion des erreurs",
109285
+ "failed": "Impossible de démarrer la gestion des erreurs",
109286
+ "source": "Exécution source",
109287
+ "workflow": "Workflow ayant échoué.",
109288
+ "execution": "Exécution en échec et son état final.",
109289
+ "error": "Message d’erreur et emplacement du nœud, si disponible.",
109290
+ "setupHint": "Choisissez des workflows publiés. Publiez et activez ce workflow pour traiter les échecs de leurs exécutions automatiques.",
109291
+ "sources": "Workflows en amont",
109292
+ "search": "Rechercher des workflows en amont",
109293
+ "noMatches": "Aucun workflow correspondant",
109294
+ "choose": "Sélectionner les workflows en amont",
109295
+ "done": "Terminé",
109296
+ "clear": "Effacer la sélection",
109297
+ "deletedName": "Workflow supprimé",
109298
+ "deleted": "Supprimé",
109299
+ "retiring": "Suppression en cours",
109300
+ "unpublished": "Non publié",
109301
+ "self": "Impossible de surveiller ce workflow lui-même",
109302
+ "removeHint": "Retirez les workflows en amont indisponibles avant de publier à nouveau.",
109303
+ "removeUnavailable": "Retirer les workflows indisponibles"
108782
109304
  }
108783
109305
  }
108784
109306
  };
@@ -112176,6 +112698,19 @@ function NodeInspector({ variables = {
112176
112698
  store?.saveTriggerConfig(selection.id, name, value);
112177
112699
  }
112178
112700
  }, `config:${selection.id}`)),
112701
+ selection?.kind === "trigger" && selection.trigger.kind === "error" && /* @__PURE__ */ jsx(Fragment$1, { children: store == null ? /* @__PURE__ */ jsx(ErrorTriggerSources, {
112702
+ flows: [],
112703
+ flowId: revision.revision.flowId,
112704
+ value: selection.trigger.sourceFlowIds ?? [],
112705
+ disabled: true,
112706
+ complete: false,
112707
+ onChange: () => {}
112708
+ }) : /* @__PURE__ */ jsx(ErrorTriggerSourcesEditor, {
112709
+ store,
112710
+ nodeId: selection.id,
112711
+ value: selection.trigger.sourceFlowIds ?? [],
112712
+ disabled
112713
+ }) }),
112179
112714
  selection?.kind === "trigger" && selection.trigger.kind !== "webhook" && /* @__PURE__ */ jsx(TriggerSummary, {
112180
112715
  trigger: selection.trigger,
112181
112716
  display: selection.trigger.kind == "integration" || selection.trigger.kind == "poll" ? triggerDisplays?.[selection.trigger.definition.key] : void 0