@oomol-lab/open-flow 0.1.0-beta.81 → 0.1.0-beta.82

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 (48) hide show
  1. package/README.md +35 -0
  2. package/dist/browser/{FlowCanvas-CrsiDHK8.js → FlowCanvas-Dew2fmoT.js} +55 -274
  3. package/dist/browser/{createResourceDialog-CS3u9ga9.js → createResourceDialog-bdOJa5Zk.js} +2 -1
  4. package/dist/browser/{exportPng-BOPfjeEi.js → exportPng-Cjdb6COo.js} +2 -2
  5. package/dist/browser/{flowChanges-CFj5pL4Y.js → flowChanges-URBEd4DI.js} +2583 -71
  6. package/dist/browser/{flowWorkspace-BeQaeJ3e.js → flowWorkspace-BlXx-yAn.js} +440 -2578
  7. package/dist/browser/{markdownContent-CAG_CQfH.js → markdownContent-D8G_oNOe.js} +18 -41
  8. package/dist/browser/{markdownContent-frwDfQQU.js → markdownContent-IS8xXDoc.js} +18 -40
  9. package/dist/browser/preview.css +88 -80
  10. package/dist/browser/preview.js +150 -60
  11. package/dist/browser/ui.css +8 -0
  12. package/dist/browser/{dist-CHwj9BhV.js → videoLink-NAWDmBtf.js} +35 -1
  13. package/dist/browser/workbench-contract.d.ts +6 -0
  14. package/dist/browser/workbench.css +259 -251
  15. package/dist/browser/workbench.d.ts +2 -0
  16. package/dist/browser/workbench.js +289 -137
  17. package/dist/browser/{ContentIcon-CMn0c-kl.js → wrapLayout-DZvW9dBs.js} +4397 -4152
  18. package/dist/command/index.js +43 -41
  19. package/dist/common/authoring.d.ts +1 -1
  20. package/dist/common/control-api-conformance.js +306 -2
  21. package/dist/common/control-api.d.ts +20 -0
  22. package/dist/common/control-api.js +306 -4
  23. package/dist/common/control-requests.d.ts +3 -5
  24. package/dist/common/control-requests.js +5 -7
  25. package/dist/common/flow-encoding.d.ts +1 -0
  26. package/dist/common/flow-encoding.js +167 -1
  27. package/dist/common/flow-semantics.js +20 -0
  28. package/dist/common/flow-workflowBundle.d.ts +27 -0
  29. package/dist/common/flow-workflowFile.d.ts +2 -0
  30. package/dist/common/flow-workflowReferences.d.ts +4 -0
  31. package/dist/common/mcp.d.ts +2 -0
  32. package/dist/common/mcp.js +312 -4
  33. package/dist/render/browser/licenses.md +4047 -0
  34. package/dist/render/browser/runtime.css +14877 -0
  35. package/dist/render/browser/runtime.js +266765 -0
  36. package/dist/render/common/png.d.ts +24 -0
  37. package/dist/render/node/index.d.ts +11 -0
  38. package/dist/render/node/index.js +9491 -0
  39. package/dist/render/node/licenses.md +75 -0
  40. package/package.json +12 -2
  41. package/src/control/common/api.ts +50 -0
  42. package/src/control/common/flowDecoders.ts +2 -0
  43. package/src/control/common/mcp.ts +4 -4
  44. package/src/control/common/requests.ts +12 -1
  45. package/src/flow/common/encoding.ts +1 -0
  46. package/src/flow/common/workflowBundle.ts +117 -0
  47. package/src/flow/common/workflowFile.ts +4 -0
  48. package/src/flow/common/workflowReferences.ts +20 -0
@@ -1,5 +1,5 @@
1
1
  import { a as __toCommonJS, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime-CEgmsyvS.js";
2
- import { _ as val, a as toPlainObject, c as useLang, d as attachSetter, f as combine, g as strictEqual, h as readonlyVal, i as isString$1, l as useTranslate, m as derive, n as isBoolean$1, o as I18nProvider, p as compute, r as isPlainObject$2, s as useI18n, t as isArray$2, u as useVal } from "./dist-CHwj9BhV.js";
2
+ import { _ as readonlyVal, a as isPlainObject$2, c as I18nProvider, d as useTranslate, f as useVal, g as derive, h as compute, i as isBoolean$1, l as useI18n, m as combine, n as pasteVideoLink, o as isString$1, p as attachSetter, r as isArray$2, s as toPlainObject, u as useLang, v as strictEqual, y as val } from "./videoLink-NAWDmBtf.js";
3
3
  import * as m$4 from "react";
4
4
  import reactExports, { Children, Fragment, Suspense, createContext, createElement, forwardRef, isValidElement, lazy, memo, useCallback, useContext, useEffect, useId, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
5
5
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -12644,7 +12644,7 @@ var CanvasStore = class {
12644
12644
  this.$$.changingDirection.set(false);
12645
12645
  }
12646
12646
  allLayoutNodes() {
12647
- return [...this.$.nodes.values()];
12647
+ return [...this.$.nodes.values(), ...this.$.commentNodes?.values() ?? []];
12648
12648
  }
12649
12649
  /** Deletes nodes programmatically, such as from a menu action. */
12650
12650
  async deleteNodes(nodes, skipConfirm) {
@@ -12669,7 +12669,7 @@ var CanvasStore = class {
12669
12669
  }
12670
12670
  doRelayout(availableWidth) {
12671
12671
  const selected = this.$.selectedNodes.value.length > 1 ? this.$.selectedNodes.value : [];
12672
- const nodes = selected.length > 0 ? selected.filter(NodeStore.is) : this.allLayoutNodes();
12672
+ const nodes = selected.length > 0 ? selected : this.allLayoutNodes();
12673
12673
  if (nodes.length === 0) return;
12674
12674
  let positions = this.layoutPositions(nodes, availableWidth);
12675
12675
  if (selected.length > 0) {
@@ -12691,9 +12691,10 @@ var CanvasStore = class {
12691
12691
  }
12692
12692
  layoutPositions(nodes, availableWidth) {
12693
12693
  const g = new ie.Graph().setDefaultEdgeLabel(() => ({}));
12694
+ const vertical = this.$.direction.value === "vertical";
12694
12695
  g.setGraph({
12695
- rankdir: this.$.direction.value === "vertical" ? "TB" : "LR",
12696
- ranksep: 80
12696
+ rankdir: vertical ? "TB" : "LR",
12697
+ ranksep: vertical ? 48 : 80
12697
12698
  });
12698
12699
  const singles = /* @__PURE__ */ new Set();
12699
12700
  for (const node of nodes) {
@@ -12714,6 +12715,7 @@ var CanvasStore = class {
12714
12715
  const constraints = [];
12715
12716
  const ordering = new ie.Graph();
12716
12717
  for (const node of nodes) {
12718
+ if (!NodeStore.is(node)) continue;
12717
12719
  const content = node.content$.value;
12718
12720
  if (content.kind !== "condition" && content.kind !== "approval" && content.kind !== "wait") continue;
12719
12721
  const targets = [...new Set(content.outputs.flatMap((port) => "handle" in port ? this.#connections.value.filter((edge) => edge.source === node.nodeId && edge.sourceHandle === `$branch:${port.handle}`).flatMap((edge) => {
@@ -43337,12 +43339,12 @@ function CommentNodeActions({ canvasStore, nodeStore }) {
43337
43339
  });
43338
43340
  }
43339
43341
  var CommentNodeContent_module_default = {
43340
- body: "CommentNodeContent_body_01471",
43341
- container: "CommentNodeContent_container_01471",
43342
- resizeButton: "CommentNodeContent_resizeButton_01471",
43343
- sourceCode: "CommentNodeContent_sourceCode_01471",
43344
- markdown: "CommentNodeContent_markdown_01471",
43345
- taskCheckbox: "CommentNodeContent_taskCheckbox_01471"
43342
+ body: "CommentNodeContent_body_7c741",
43343
+ container: "CommentNodeContent_container_7c741",
43344
+ resizeButton: "CommentNodeContent_resizeButton_7c741",
43345
+ sourceCode: "CommentNodeContent_sourceCode_7c741",
43346
+ markdown: "CommentNodeContent_markdown_7c741",
43347
+ taskCheckbox: "CommentNodeContent_taskCheckbox_7c741"
43346
43348
  };
43347
43349
  //#endregion
43348
43350
  //#region ../../node_modules/.bun/@base-ui+utils@0.2.8+b87d06724be9db7a/node_modules/@base-ui/utils/esm/useControlled.js
@@ -43972,13 +43974,13 @@ var Textarea = m$4.forwardRef(function Textarea({ className, ...props }, ref) {
43972
43974
  });
43973
43975
  });
43974
43976
  var markdownPreview_module_default = {
43975
- container: "markdownPreview_container_c03ca",
43976
- body: "markdownPreview_body_c03ca",
43977
- draggable: "markdownPreview_draggable_c03ca"
43977
+ container: "markdownPreview_container_2a1d9",
43978
+ body: "markdownPreview_body_2a1d9",
43979
+ draggable: "markdownPreview_draggable_2a1d9"
43978
43980
  };
43979
43981
  //#endregion
43980
43982
  //#region src/canvas/browser/preview/markdownPreview.tsx
43981
- var MarkdownContent$1 = lazy(() => import("./markdownContent-CAG_CQfH.js"));
43983
+ var MarkdownContent$1 = lazy(() => import("./markdownContent-D8G_oNOe.js"));
43982
43984
  var MarkdownPreview = /* @__PURE__ */ memo(({ dark, unstyled, components, contentClassName, content, draggable, onDoubleClick }) => {
43983
43985
  const [focus, setFocus] = useState(false);
43984
43986
  return /* @__PURE__ */ jsx("div", {
@@ -43987,8 +43989,9 @@ var MarkdownPreview = /* @__PURE__ */ memo(({ dark, unstyled, components, conten
43987
43989
  onFocus: () => setFocus(true),
43988
43990
  onBlur: () => setFocus(false),
43989
43991
  onDoubleClick,
43990
- children: /* @__PURE__ */ jsx("div", {
43992
+ children: /* @__PURE__ */ jsx(ScrollArea, {
43991
43993
  className: `${markdownPreview_module_default.body} markdown-body`,
43994
+ autoHide: "leave",
43992
43995
  children: /* @__PURE__ */ jsx(Suspense, {
43993
43996
  fallback: /* @__PURE__ */ jsx("span", {
43994
43997
  hidden: true,
@@ -44166,6 +44169,7 @@ function CommentNodeContent({ store }) {
44166
44169
  setComposing(false);
44167
44170
  },
44168
44171
  onChange: (event) => store.$$.content.set(event.target.value),
44172
+ onPaste: (event) => pasteVideoLink(event, t),
44169
44173
  onBlur: (event) => {
44170
44174
  setFocused(false);
44171
44175
  if (editable && !composing) store.saveContent(event.target.value);
@@ -46620,9 +46624,6 @@ function DropdownMenuSeparator({ className, ...props }) {
46620
46624
  });
46621
46625
  }
46622
46626
  //#endregion
46623
- //#region src/canvas/browser/nodeActions.tsx
46624
- var NodeHistoryContext = createContext(void 0);
46625
- //#endregion
46626
46627
  //#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/context-menu/root/ContextMenuRoot.js
46627
46628
  /**
46628
46629
  * A component that creates a context menu activated by right clicking or long pressing.
@@ -46889,16 +46890,7 @@ function NodeHeadContextMenu({ canvasStore, children }) {
46889
46890
  function useNodeMenuItems({ t, nodeStore, onDelete, editable }) {
46890
46891
  const skip = useVal(NodeStore.to(nodeStore)?.ignore);
46891
46892
  const { duplicateNode } = nodeStore;
46892
- const history = useContext(NodeHistoryContext)?.(nodeStore.nodeId);
46893
46893
  return coalesce([
46894
- history && {
46895
- ...history,
46896
- key: "$history",
46897
- icon: /* @__PURE__ */ jsx("i", {
46898
- "aria-hidden": "true",
46899
- className: "i-lucide-light:database"
46900
- })
46901
- },
46902
46894
  editable && duplicateNode && {
46903
46895
  label: t("nodeActions.duplicate"),
46904
46896
  key: "$duplicate",
@@ -62228,9 +62220,29 @@ strictObject({
62228
62220
  kind: literal("open-flow-workflow"),
62229
62221
  version: literal(1),
62230
62222
  name: string$1().optional(),
62223
+ icon: string$1().optional(),
62224
+ description: string$1().optional(),
62231
62225
  content: unknown(),
62232
62226
  presentation: record$3(string$1(), json$4()).optional()
62233
62227
  });
62228
+ //#endregion
62229
+ //#region src/flow/common/workflowBundle.ts
62230
+ var entries = array(strictObject({
62231
+ flowId: string$1().min(1),
62232
+ file: unknown()
62233
+ })).min(1);
62234
+ strictObject({
62235
+ kind: literal("open-flow-workflow-bundle"),
62236
+ version: literal(1),
62237
+ entryFlowId: string$1().min(1),
62238
+ workflows: entries
62239
+ });
62240
+ strictObject({
62241
+ version: literal(1),
62242
+ entryFlowId: string$1().min(1),
62243
+ workflows: entries,
62244
+ unavailableFlowIds: array(string$1().min(1))
62245
+ });
62234
62246
  new TextEncoder();
62235
62247
  //#endregion
62236
62248
  //#region ../../node_modules/.bun/@babel+parser@8.0.4/node_modules/@babel/parser/lib/index.js
@@ -63247,11 +63259,10 @@ var RevisionView = class {
63247
63259
  }
63248
63260
  };
63249
63261
  function revisionView(revision) {
63250
- let view = views.get(revision);
63251
- if (view == null) {
63252
- view = new RevisionView(revision);
63253
- views.set(revision, view);
63254
- }
63262
+ const cached = views.get(revision);
63263
+ if (cached) return cached;
63264
+ const view = new RevisionView(revision);
63265
+ views.set(revision, view);
63255
63266
  return view;
63256
63267
  }
63257
63268
  function connectorAccessReferences(document) {
@@ -64373,7 +64384,7 @@ function nodeDiagnosticCount(node, diagnostics) {
64373
64384
  return diagnostics.filter((diagnostic) => paths.some((path) => diagnostic.path.startsWith(path))).length;
64374
64385
  }
64375
64386
  function runProjection(revision, run, events) {
64376
- if (run?.flowId != revision.revision.flowId || run.revisionId != revision.revision.revisionId) return { nodes: /* @__PURE__ */ new Map() };
64387
+ if (run == null || revision.revision.flowId == null || revision.revision.revisionId == null || run.flowId != revision.revision.flowId || run.revisionId != revision.revision.revisionId) return { nodes: /* @__PURE__ */ new Map() };
64377
64388
  const active = run.status == "queued" || run.status == "starting" || run.status == "running" || run.status == "waiting";
64378
64389
  const nodes = /* @__PURE__ */ new Map();
64379
64390
  if ("waits" in run) for (const wait of run.waits) nodes.set(wait.nodeId, {
@@ -65468,7 +65479,7 @@ function TabsContent({ className, ...props }) {
65468
65479
  }
65469
65480
  //#endregion
65470
65481
  //#region src/workbench/browser/runtime/editor/commentInspector.tsx
65471
- var MarkdownContent = lazy(() => import("./markdownContent-CAG_CQfH.js"));
65482
+ var MarkdownContent = lazy(() => import("./markdownContent-D8G_oNOe.js"));
65472
65483
  /** A comment is presentation data; editing it does not require the canvas store. */
65473
65484
  function CommentInspector({ title, content, disabled = false, readOnly, dark, onSave }) {
65474
65485
  const t = useTranslate();
@@ -65510,14 +65521,16 @@ function CommentInspector({ title, content, disabled = false, readOnly, dark, on
65510
65521
  readOnly,
65511
65522
  value: draftContent,
65512
65523
  onChange: (event) => setDraftContent(event.target.value),
65524
+ onPaste: (event) => pasteVideoLink(event, t),
65513
65525
  onBlur: save
65514
65526
  })
65515
65527
  }),
65516
65528
  /* @__PURE__ */ jsx(TabsContent, {
65517
65529
  value: "preview",
65518
65530
  className: "flex min-h-0 flex-1 flex-col rounded-[var(--ui-control-radius,calc(var(--ui-radius)_+_2px))] border border-[var(--_open-flow-comment-border)] bg-[var(--_open-flow-comment-surface)] p-2",
65519
- children: /* @__PURE__ */ jsx("div", {
65520
- className: "min-h-0 flex-1 overflow-auto rounded-[var(--ui-control-radius,calc(var(--ui-radius)_+_2px))] border border-[color-mix(in_srgb,var(--_open-flow-comment-border)_45%,transparent)] bg-[var(--_open-flow-comment-content)] p-3",
65531
+ children: /* @__PURE__ */ jsx(ScrollArea, {
65532
+ autoHide: "leave",
65533
+ className: "min-h-0 flex-1 rounded-[var(--ui-control-radius,calc(var(--ui-radius)_+_2px))] border border-[color-mix(in_srgb,var(--_open-flow-comment-border)_45%,transparent)] bg-[var(--_open-flow-comment-content)] p-3",
65521
65534
  children: /* @__PURE__ */ jsx("div", {
65522
65535
  className: "markdown-body min-w-0",
65523
65536
  onDoubleClick: () => setSource(true),
@@ -103315,7 +103328,10 @@ var resources = {
103315
103328
  "discardTitle": "Discard changes?",
103316
103329
  "discardDescription": "Your Flow settings have not been saved.",
103317
103330
  "continueEditing": "Continue editing",
103318
- "discardChanges": "Discard changes"
103331
+ "discardChanges": "Discard changes",
103332
+ "icon": "Icon",
103333
+ "resetIcon": "Reset icon",
103334
+ "description": "Description"
103319
103335
  },
103320
103336
  flowState: {
103321
103337
  "title": "Persistent data",
@@ -103329,7 +103345,7 @@ var resources = {
103329
103345
  "clear": "Clear",
103330
103346
  "orphaned": "Outside the current view",
103331
103347
  "nearLimit": "Flow history is at least 80% full. Clear unused history.",
103332
- "history": "Usage",
103348
+ "usage": "Usage",
103333
103349
  "scope": "Scope",
103334
103350
  "refresh": "Refresh",
103335
103351
  "cancel": "Cancel",
@@ -103357,7 +103373,7 @@ var resources = {
103357
103373
  "pendingClear": "{{count}} pending; finish or cancel their Runs before clearing.",
103358
103374
  "clearBlocked": "This history has pending records. Finish or cancel their Runs, then refresh.",
103359
103375
  "clearSource": "Clear {{name}}",
103360
- "sourceHistory": "{{name}} history",
103376
+ "sourceUsage": "{{name}} usage",
103361
103377
  "confirmTitle": "Clear {{name}}?",
103362
103378
  "confirmValues": "This will clear {{count}} saved entries in {{scope}}. Subsequent Runs will no longer be able to read these values.",
103363
103379
  "confirmHistory": "This will clear {{count}} deduplication records in {{scope}}. These items may be processed again.",
@@ -103368,6 +103384,14 @@ var resources = {
103368
103384
  "loadFailed": "Unable to load",
103369
103385
  "valuesHelp": "{{name}}: Content explicitly saved by the workflow, available to later runs.",
103370
103386
  "historyHelp": "{{name}}: Item identifiers used to avoid processing duplicates."
103387
+ },
103388
+ workflowTransfer: {
103389
+ "includeDependencies": "Include referenced workflows",
103390
+ "workflowCount": "Workflows ({{count}})",
103391
+ "unavailable": "Unavailable workflows: {{count}}.",
103392
+ "export": "Export",
103393
+ "hostUnsupported": "This host does not support workflow bundle imports yet.",
103394
+ "unnamed": "Untitled workflow"
103371
103395
  }
103372
103396
  },
103373
103397
  "zh-CN": {
@@ -104684,7 +104708,10 @@ var resources = {
104684
104708
  "discardTitle": "放弃修改?",
104685
104709
  "discardDescription": "工作流设置的修改尚未保存。",
104686
104710
  "continueEditing": "继续编辑",
104687
- "discardChanges": "放弃修改"
104711
+ "discardChanges": "放弃修改",
104712
+ "icon": "图标",
104713
+ "resetIcon": "重置图标",
104714
+ "description": "描述"
104688
104715
  },
104689
104716
  flowState: {
104690
104717
  "title": "持久化数据",
@@ -104698,7 +104725,7 @@ var resources = {
104698
104725
  "clear": "清空",
104699
104726
  "orphaned": "当前视图外",
104700
104727
  "nearLimit": "该工作流的去重记录已使用至少 80%。请清理不再需要的记录。",
104701
- "history": "用量",
104728
+ "usage": "用量",
104702
104729
  "scope": "作用域",
104703
104730
  "refresh": "刷新",
104704
104731
  "cancel": "取消",
@@ -104726,7 +104753,7 @@ var resources = {
104726
104753
  "pendingClear": "{{count}} 条待提交,相关运行结束或取消后可清理。",
104727
104754
  "clearBlocked": "这些记录尚待提交。请等待相关运行结束或取消后再刷新。",
104728
104755
  "clearSource": "清空{{name}}",
104729
- "sourceHistory": "{{name}}的历史记录",
104756
+ "sourceUsage": "{{name}}用量",
104730
104757
  "confirmTitle": "清空「{{name}}」?",
104731
104758
  "confirmValues": "将清空{{scope}}环境保存的 {{count}} 条数据,后续运行将无法读取这些值。",
104732
104759
  "confirmHistory": "将清空{{scope}}环境的 {{count}} 条去重记录,这些条目之后可能再次被处理。",
@@ -104737,6 +104764,14 @@ var resources = {
104737
104764
  "loadFailed": "加载失败",
104738
104765
  "valuesHelp": "{{name}}:工作流主动保存的内容,后续运行可以继续读取。",
104739
104766
  "historyHelp": "{{name}}:条目的识别标记,用来避免重复处理。"
104767
+ },
104768
+ workflowTransfer: {
104769
+ "includeDependencies": "包含引用的工作流",
104770
+ "workflowCount": "{{count}} 个工作流",
104771
+ "unavailable": "{{count}} 个引用的工作流不可用。",
104772
+ "export": "导出",
104773
+ "hostUnsupported": "当前宿主尚不支持导入工作流包。",
104774
+ "unnamed": "未命名工作流"
104740
104775
  }
104741
104776
  },
104742
104777
  "zh-TW": {
@@ -106053,7 +106088,10 @@ var resources = {
106053
106088
  "discardTitle": "放棄變更?",
106054
106089
  "discardDescription": "工作流程設定的變更尚未儲存。",
106055
106090
  "continueEditing": "繼續編輯",
106056
- "discardChanges": "放棄變更"
106091
+ "discardChanges": "放棄變更",
106092
+ "icon": "圖示",
106093
+ "resetIcon": "重設圖示",
106094
+ "description": "說明"
106057
106095
  },
106058
106096
  flowState: {
106059
106097
  "title": "持久化資料",
@@ -106067,7 +106105,7 @@ var resources = {
106067
106105
  "clear": "清空",
106068
106106
  "orphaned": "目前檢視之外",
106069
106107
  "nearLimit": "此工作流的去重記錄已使用至少 80%。請清理不再需要的記錄。",
106070
- "history": "用量",
106108
+ "usage": "用量",
106071
106109
  "scope": "範圍",
106072
106110
  "refresh": "重新整理",
106073
106111
  "cancel": "取消",
@@ -106095,7 +106133,7 @@ var resources = {
106095
106133
  "pendingClear": "{{count}} 筆待提交,相關執行結束或取消後可清理。",
106096
106134
  "clearBlocked": "這些記錄尚待提交。請等待相關執行結束或取消後再重新整理。",
106097
106135
  "clearSource": "清空{{name}}",
106098
- "sourceHistory": "{{name}}的歷史記錄",
106136
+ "sourceUsage": "{{name}}用量",
106099
106137
  "confirmTitle": "清空「{{name}}」?",
106100
106138
  "confirmValues": "將清空{{scope}}環境儲存的 {{count}} 筆資料,後續執行將無法讀取這些值。",
106101
106139
  "confirmHistory": "將清空{{scope}}環境的 {{count}} 筆去重記錄,這些項目之後可能再次被處理。",
@@ -106106,6 +106144,14 @@ var resources = {
106106
106144
  "loadFailed": "載入失敗",
106107
106145
  "valuesHelp": "{{name}}:工作流主動儲存的內容,後續執行可以繼續讀取。",
106108
106146
  "historyHelp": "{{name}}:項目的識別標記,用來避免重複處理。"
106147
+ },
106148
+ workflowTransfer: {
106149
+ "includeDependencies": "包含參照的工作流程",
106150
+ "workflowCount": "{{count}} 個工作流程",
106151
+ "unavailable": "{{count}} 個參照的工作流程無法使用。",
106152
+ "export": "匯出",
106153
+ "hostUnsupported": "目前的宿主尚未支援匯入工作流程套件。",
106154
+ "unnamed": "未命名工作流程"
106109
106155
  }
106110
106156
  },
106111
106157
  "ja": {
@@ -107422,7 +107468,10 @@ var resources = {
107422
107468
  "discardTitle": "変更を破棄しますか?",
107423
107469
  "discardDescription": "ワークフロー設定の変更は保存されていません。",
107424
107470
  "continueEditing": "編集を続ける",
107425
- "discardChanges": "変更を破棄"
107471
+ "discardChanges": "変更を破棄",
107472
+ "icon": "アイコン",
107473
+ "resetIcon": "アイコンをリセット",
107474
+ "description": "説明"
107426
107475
  },
107427
107476
  flowState: {
107428
107477
  "title": "永続データ",
@@ -107436,7 +107485,7 @@ var resources = {
107436
107485
  "clear": "消去",
107437
107486
  "orphaned": "現在のビューの外",
107438
107487
  "nearLimit": "フローの重複履歴が 80% 以上使用されています。不要な履歴を削除してください。",
107439
- "history": "使用量",
107488
+ "usage": "使用量",
107440
107489
  "scope": "スコープ",
107441
107490
  "refresh": "更新",
107442
107491
  "cancel": "キャンセル",
@@ -107464,7 +107513,7 @@ var resources = {
107464
107513
  "pendingClear": "{{count}} 件が確定待ちです。関連する実行の完了またはキャンセル後に消去できます。",
107465
107514
  "clearBlocked": "確定待ちの記録があります。関連する実行の完了またはキャンセル後に更新してください。",
107466
107515
  "clearSource": "{{name}}を消去",
107467
- "sourceHistory": "{{name}}の履歴",
107516
+ "sourceUsage": "{{name}}の使用量",
107468
107517
  "confirmTitle": "「{{name}}」を消去しますか?",
107469
107518
  "confirmValues": "{{scope}}環境の保存データ {{count}} 件を消去します。以降の実行ではこれらの値を読み取れなくなります。",
107470
107519
  "confirmHistory": "{{scope}}環境の重複排除記録 {{count}} 件を消去します。これらの項目が再処理される場合があります。",
@@ -107475,6 +107524,14 @@ var resources = {
107475
107524
  "loadFailed": "読み込みに失敗しました",
107476
107525
  "valuesHelp": "{{name}}:フローが明示的に保存し、後続の実行で読み取れる内容です。",
107477
107526
  "historyHelp": "{{name}}:同じ項目を繰り返し処理しないための識別情報です。"
107527
+ },
107528
+ workflowTransfer: {
107529
+ "includeDependencies": "参照先のワークフローを含める",
107530
+ "workflowCount": "ワークフロー({{count}} 件)",
107531
+ "unavailable": "参照先のワークフロー {{count}} 件を利用できません。",
107532
+ "export": "エクスポート",
107533
+ "hostUnsupported": "このホストはワークフローバンドルのインポートにまだ対応していません。",
107534
+ "unnamed": "無題のワークフロー"
107478
107535
  }
107479
107536
  },
107480
107537
  "ko": {
@@ -108791,7 +108848,10 @@ var resources = {
108791
108848
  "discardTitle": "변경 사항을 버릴까요?",
108792
108849
  "discardDescription": "워크플로 설정의 변경 사항이 저장되지 않았습니다.",
108793
108850
  "continueEditing": "계속 편집",
108794
- "discardChanges": "변경 사항 버리기"
108851
+ "discardChanges": "변경 사항 버리기",
108852
+ "icon": "아이콘",
108853
+ "resetIcon": "아이콘 초기화",
108854
+ "description": "설명"
108795
108855
  },
108796
108856
  flowState: {
108797
108857
  "title": "영구 데이터",
@@ -108805,7 +108865,7 @@ var resources = {
108805
108865
  "clear": "지우기",
108806
108866
  "orphaned": "현재 보기 외부",
108807
108867
  "nearLimit": "Flow 중복 기록이 80% 이상 찼습니다. 필요 없는 기록을 지우세요.",
108808
- "history": "사용량",
108868
+ "usage": "사용량",
108809
108869
  "scope": "범위",
108810
108870
  "refresh": "새로 고침",
108811
108871
  "cancel": "취소",
@@ -108833,7 +108893,7 @@ var resources = {
108833
108893
  "pendingClear": "{{count}}개 확정 대기 중. 관련 실행이 완료되거나 취소된 후 지울 수 있습니다.",
108834
108894
  "clearBlocked": "확정 대기 중인 기록이 있습니다. 관련 실행을 완료하거나 취소한 후 새로 고침하세요.",
108835
108895
  "clearSource": "{{name}} 지우기",
108836
- "sourceHistory": "{{name}} 기록",
108896
+ "sourceUsage": "{{name}} 사용량",
108837
108897
  "confirmTitle": "{{name}}을(를) 지울까요?",
108838
108898
  "confirmValues": "{{scope}} 환경에 저장된 데이터 {{count}}개를 지웁니다. 이후 실행에서 이 값을 읽을 수 없습니다.",
108839
108899
  "confirmHistory": "{{scope}} 환경의 중복 제거 기록 {{count}}개를 지웁니다. 해당 항목이 다시 처리될 수 있습니다.",
@@ -108844,6 +108904,14 @@ var resources = {
108844
108904
  "loadFailed": "불러오기 실패",
108845
108905
  "valuesHelp": "{{name}}: 워크플로가 직접 저장하여 이후 실행에서 읽을 수 있는 내용입니다.",
108846
108906
  "historyHelp": "{{name}}: 같은 항목을 반복 처리하지 않기 위한 식별 정보입니다."
108907
+ },
108908
+ workflowTransfer: {
108909
+ "includeDependencies": "참조된 워크플로 포함",
108910
+ "workflowCount": "워크플로 {{count}}개",
108911
+ "unavailable": "참조된 워크플로 {{count}}개를 사용할 수 없습니다.",
108912
+ "export": "내보내기",
108913
+ "hostUnsupported": "이 호스트는 아직 워크플로 번들 가져오기를 지원하지 않습니다.",
108914
+ "unnamed": "이름 없는 워크플로"
108847
108915
  }
108848
108916
  },
108849
108917
  "ru": {
@@ -110160,7 +110228,10 @@ var resources = {
110160
110228
  "discardTitle": "Отменить изменения?",
110161
110229
  "discardDescription": "Изменения настроек процесса не сохранены.",
110162
110230
  "continueEditing": "Продолжить редактирование",
110163
- "discardChanges": "Отменить изменения"
110231
+ "discardChanges": "Отменить изменения",
110232
+ "icon": "Значок",
110233
+ "resetIcon": "Сбросить значок",
110234
+ "description": "Описание"
110164
110235
  },
110165
110236
  flowState: {
110166
110237
  "title": "Постоянные данные",
@@ -110174,7 +110245,7 @@ var resources = {
110174
110245
  "clear": "Очистить",
110175
110246
  "orphaned": "Вне текущего представления",
110176
110247
  "nearLimit": "История Flow заполнена минимум на 80 %. Удалите ненужные записи.",
110177
- "history": "Использование",
110248
+ "usage": "Использование",
110178
110249
  "scope": "Область",
110179
110250
  "refresh": "Обновить",
110180
110251
  "cancel": "Отмена",
@@ -110202,7 +110273,7 @@ var resources = {
110202
110273
  "pendingClear": "Ожидают фиксации: {{count}}. Завершите или отмените связанные запуски перед очисткой.",
110203
110274
  "clearBlocked": "Есть записи, ожидающие фиксации. Завершите или отмените связанные запуски и обновите данные.",
110204
110275
  "clearSource": "Очистить {{name}}",
110205
- "sourceHistory": "История: {{name}}",
110276
+ "sourceUsage": "Использование: {{name}}",
110206
110277
  "confirmTitle": "Очистить «{{name}}»?",
110207
110278
  "confirmValues": "Будут удалены сохранённые записи ({{count}}) в среде «{{scope}}». Последующие запуски не смогут прочитать эти значения.",
110208
110279
  "confirmHistory": "Будут удалены записи дедупликации ({{count}}) в среде «{{scope}}». Эти элементы могут быть обработаны повторно.",
@@ -110213,6 +110284,14 @@ var resources = {
110213
110284
  "loadFailed": "Не удалось загрузить",
110214
110285
  "valuesHelp": "{{name}}: данные, явно сохранённые процессом для чтения в следующих запусках.",
110215
110286
  "historyHelp": "{{name}}: идентификаторы элементов, предотвращающие повторную обработку."
110287
+ },
110288
+ workflowTransfer: {
110289
+ "includeDependencies": "Включить связанные процессы",
110290
+ "workflowCount": "Процессы ({{count}})",
110291
+ "unavailable": "Связанные процессы недоступны: {{count}}.",
110292
+ "export": "Экспортировать",
110293
+ "hostUnsupported": "Этот хост пока не поддерживает импорт пакетов процессов.",
110294
+ "unnamed": "Процесс без названия"
110216
110295
  }
110217
110296
  },
110218
110297
  "fr": {
@@ -111529,7 +111608,10 @@ var resources = {
111529
111608
  "discardTitle": "Ignorer les modifications ?",
111530
111609
  "discardDescription": "Les modifications des paramètres du workflow n’ont pas été enregistrées.",
111531
111610
  "continueEditing": "Continuer à modifier",
111532
- "discardChanges": "Ignorer les modifications"
111611
+ "discardChanges": "Ignorer les modifications",
111612
+ "icon": "Icône",
111613
+ "resetIcon": "Réinitialiser l’icône",
111614
+ "description": "Description"
111533
111615
  },
111534
111616
  flowState: {
111535
111617
  "title": "Données persistantes",
@@ -111543,7 +111625,7 @@ var resources = {
111543
111625
  "clear": "Effacer",
111544
111626
  "orphaned": "Hors de la vue actuelle",
111545
111627
  "nearLimit": "L’historique du Flow est rempli à au moins 80 %. Effacez les entrées inutiles.",
111546
- "history": "Utilisation",
111628
+ "usage": "Utilisation",
111547
111629
  "scope": "Portée",
111548
111630
  "refresh": "Actualiser",
111549
111631
  "cancel": "Annuler",
@@ -111571,7 +111653,7 @@ var resources = {
111571
111653
  "pendingClear": "{{count}} en attente de validation. Terminez ou annulez les exécutions concernées avant de vider.",
111572
111654
  "clearBlocked": "Des entrées sont en attente de validation. Terminez ou annulez les exécutions concernées, puis actualisez.",
111573
111655
  "clearSource": "Vider {{name}}",
111574
- "sourceHistory": "Historique de {{name}}",
111656
+ "sourceUsage": "Utilisation de {{name}}",
111575
111657
  "confirmTitle": "Vider « {{name}} » ?",
111576
111658
  "confirmValues": "Cela supprimera {{count}} entrées enregistrées en environnement {{scope}}. Les exécutions suivantes ne pourront plus lire ces valeurs.",
111577
111659
  "confirmHistory": "Cela supprimera {{count}} entrées de déduplication en environnement {{scope}}. Ces éléments pourront être traités à nouveau.",
@@ -111582,6 +111664,14 @@ var resources = {
111582
111664
  "loadFailed": "Chargement impossible",
111583
111665
  "valuesHelp": "{{name}} : contenu enregistré explicitement par le workflow, accessible aux exécutions suivantes.",
111584
111666
  "historyHelp": "{{name}} : identifiants des éléments utilisés pour éviter les traitements en double."
111667
+ },
111668
+ workflowTransfer: {
111669
+ "includeDependencies": "Inclure les workflows référencés",
111670
+ "workflowCount": "Workflows ({{count}})",
111671
+ "unavailable": "Workflows référencés indisponibles : {{count}}.",
111672
+ "export": "Exporter",
111673
+ "hostUnsupported": "Cet hôte ne prend pas encore en charge l’import de lots de workflows.",
111674
+ "unnamed": "Workflow sans nom"
111585
111675
  }
111586
111676
  }
111587
111677
  };
@@ -113942,7 +114032,7 @@ function FlowStateButton({ client, flowId, nodes, history, notify, onClose }) {
113942
114032
  children: [/* @__PURE__ */ jsx("i", {
113943
114033
  "aria-hidden": "true",
113944
114034
  className: "i-lucide-light:database"
113945
- }), t(space == null ? "flowState.title" : "flowState.history")]
114035
+ }), t(space == null ? "flowState.title" : "flowState.usage")]
113946
114036
  }), /* @__PURE__ */ jsxs(DialogContent, {
113947
114037
  ref: dialogRoot,
113948
114038
  container,
@@ -113951,7 +114041,7 @@ function FlowStateButton({ client, flowId, nodes, history, notify, onClose }) {
113951
114041
  children: [
113952
114042
  /* @__PURE__ */ jsx(DialogTitle, {
113953
114043
  className: "break-words pr-8",
113954
- children: space == null ? t("flowState.title") : t("flowState.sourceHistory", { name: sourceName(space, nodes, t) })
114044
+ children: space == null ? t("flowState.title") : t("flowState.sourceUsage", { name: sourceName(space, nodes, t) })
113955
114045
  }),
113956
114046
  /* @__PURE__ */ jsxs(Tabs, {
113957
114047
  value: scope,
@@ -1885,6 +1885,10 @@
1885
1885
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
1886
1886
  }
1887
1887
 
1888
+ :where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .grid-rows-\[auto_auto_minmax\(0\,1fr\)_auto\] {
1889
+ grid-template-rows: auto auto minmax(0, 1fr) auto;
1890
+ }
1891
+
1888
1892
  :where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .grid-rows-\[auto_minmax\(0\,1fr\)_auto\] {
1889
1893
  grid-template-rows: auto minmax(0, 1fr) auto;
1890
1894
  }
@@ -2752,6 +2756,10 @@
2752
2756
  padding-left: calc(var(--spacing) * 4);
2753
2757
  }
2754
2758
 
2759
+ :where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .pl-5 {
2760
+ padding-left: calc(var(--spacing) * 5);
2761
+ }
2762
+
2755
2763
  :where(.open-flow-theme, .open-flow-workbench, .open-flow-canvas-root) .pl-6 {
2756
2764
  padding-left: calc(var(--spacing) * 6);
2757
2765
  }
@@ -478,4 +478,38 @@ var isObject = (x) => x !== null && typeof x === "object";
478
478
  var isPlainObject = (x) => isObject(x) && !isArray(x);
479
479
  var toPlainObject = (x) => isPlainObject(x) ? x : void 0;
480
480
  //#endregion
481
- export { val as _, toPlainObject as a, useLang as c, attachSetter as d, combine as f, strictEqual as g, readonlyVal as h, isString as i, useTranslate as l, derive as m, isBoolean as n, I18nProvider as o, compute as p, isPlainObject as r, useI18n as s, isArray as t, useVal as u };
481
+ //#region src/ui/browser/markdown/videoLink.ts
482
+ function getVideoLink(href) {
483
+ let url;
484
+ try {
485
+ url = new URL(href);
486
+ } catch {
487
+ return;
488
+ }
489
+ if (url.protocol !== "https:" && url.protocol !== "http:") return;
490
+ const host = url.hostname.replace(/^www\./, "");
491
+ const youtubeId = host === "youtube.com" && url.pathname === "/watch" ? url.searchParams.get("v") : host === "youtu.be" ? url.pathname.slice(1) : null;
492
+ if (youtubeId && /^[a-zA-Z0-9_-]+$/.test(youtubeId)) return {
493
+ src: `https://www.youtube.com/embed/${youtubeId}`,
494
+ titleKey: "markdown.videoYouTube"
495
+ };
496
+ const bilibiliId = host === "bilibili.com" ? url.pathname.match(/^\/video\/(BV[a-zA-Z0-9]+)\/?$/)?.[1] : void 0;
497
+ if (bilibiliId) return {
498
+ src: `https://player.bilibili.com/player.html?bvid=${bilibiliId}&autoplay=0`,
499
+ titleKey: "markdown.videoBilibili"
500
+ };
501
+ }
502
+ function pasteVideoLink(event, t) {
503
+ const textarea = event.currentTarget;
504
+ if (event.defaultPrevented || textarea.readOnly || textarea.disabled) return;
505
+ const href = event.clipboardData.getData("text/plain").trim();
506
+ if (/\s/.test(href)) return;
507
+ const video = getVideoLink(href);
508
+ if (!video) return;
509
+ const destination = href.replaceAll("(", "%28").replaceAll(")", "%29");
510
+ const markdown = `[![${t(video.titleKey)}](thumbnail.jpg)](${destination})`;
511
+ event.preventDefault();
512
+ textarea.ownerDocument.execCommand("insertText", false, markdown);
513
+ }
514
+ //#endregion
515
+ export { readonlyVal as _, isPlainObject as a, I18nProvider as c, useTranslate as d, useVal as f, derive as g, compute as h, isBoolean as i, useI18n as l, combine as m, pasteVideoLink as n, isString as o, attachSetter as p, isArray as r, toPlainObject as s, getVideoLink as t, useLang as u, strictEqual as v, val as y };
@@ -1,4 +1,6 @@
1
+ import type { WorkflowBundleImportResult } from '../common/control-api.js';
1
2
  import type { FlowCatalogEvent, FlowChangeEvent } from './flow-notifications.js';
3
+ import type { WorkflowBundle } from '../common/flow-workflowBundle.js';
2
4
  import type { UiLanguage } from '../common/localization.js';
3
5
  export type { FlowCatalogEvent, FlowChangeEvent } from './flow-notifications.js';
4
6
  export type WorkbenchLanguage = UiLanguage;
@@ -64,3 +66,7 @@ export interface OpenFlowWorkbenchHandle {
64
66
  /** Opens confirmation on an idle, initialized Flow list. Invalid files notify the host. Does not create a Flow. */
65
67
  openImport(input: WorkbenchImportInput): 'opened' | 'unavailable' | 'invalid-file';
66
68
  }
69
+ /** The host must create every member using the selected destination scope. */
70
+ export type WorkflowBundleImporter = (file: WorkflowBundle, name: string, idempotencyKey: string, options?: {
71
+ readonly tagIds?: readonly string[];
72
+ }) => Promise<WorkflowBundleImportResult>;