@oomol-lab/open-flow 0.1.0-beta.74 → 0.1.0-beta.76

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 (139) hide show
  1. package/README.md +3 -1
  2. package/dist/browser/{ContentIcon-CUQHjQIw.js → ContentIcon-Cm1hbVzW.js} +4 -3
  3. package/dist/browser/{FlowCanvas-Dtf8_cQp.js → FlowCanvas-NzKtla_c.js} +62 -62
  4. package/dist/browser/{createResourceDialog-DI9pL-Yr.js → createResourceDialog-BgdedQqu.js} +3 -3
  5. package/dist/browser/{dialog-BYJGvItc.js → dialog-aSElFFw2.js} +322 -26
  6. package/dist/browser/{exportSvg-BOoy7-Db.js → exportSvg-Dcz4HTo_.js} +2 -2
  7. package/dist/browser/{flowChanges-RL-H4CjD.js → flowChanges-NZyS7HSp.js} +490 -438
  8. package/dist/browser/{flowWorkspace-BkDsETj0.js → flowWorkspace-Bl0SDehy.js} +499 -61
  9. package/dist/browser/preview.css +696 -825
  10. package/dist/browser/preview.js +1399 -717
  11. package/dist/browser/theme.css +114 -262
  12. package/dist/browser/{tooltip-wZJRB9oP.js → tooltip-3XMK9jkr.js} +1 -1
  13. package/dist/browser/{typeScriptSession-CSRwWmZm.js → typeScriptSession-C9sBGOKZ.js} +1 -1
  14. package/dist/browser/ui.css +354 -460
  15. package/dist/browser/ui.js +1 -1
  16. package/dist/browser/workbench.css +696 -825
  17. package/dist/browser/workbench.js +13 -7
  18. package/dist/browser/{workbenchSelect-BcWPWGzw.js → workbenchSelect-DBGP7Y4Z.js} +2 -2
  19. package/dist/command/index.js +41 -43
  20. package/dist/common/authoring.d.ts +5 -5
  21. package/dist/common/authoringExamples.d.ts +3 -2
  22. package/dist/common/authoringSchema.d.ts +70 -4
  23. package/dist/common/connector-proxy.d.ts +1 -1
  24. package/dist/common/control-api-conformance.js +250 -138
  25. package/dist/common/control-api.d.ts +3 -2
  26. package/dist/common/control-api.js +246 -134
  27. package/dist/common/control-requests.d.ts +3 -3
  28. package/dist/common/control-requests.js +353 -79
  29. package/dist/common/cron-trigger.d.ts +2 -1
  30. package/dist/common/decision.d.ts +4 -4
  31. package/dist/common/decision.js +5 -2
  32. package/dist/common/engine-contract.d.ts +6 -1
  33. package/dist/common/event-source-definition.d.ts +1 -1
  34. package/dist/common/event-source-view.d.ts +22 -0
  35. package/dist/common/event-source.d.ts +1 -1
  36. package/dist/common/event-source.js +24 -65
  37. package/dist/common/event-sources.d.ts +0 -21
  38. package/dist/common/flow-authoring.js +90 -19
  39. package/dist/common/flow-change-schema.d.ts +9 -1
  40. package/dist/common/flow-change.d.ts +7 -201
  41. package/dist/common/flow-change.js +96 -23
  42. package/dist/common/flow-encoding.js +89 -21
  43. package/dist/common/flow-graph.d.ts +2 -1
  44. package/dist/common/flow-input-value.d.ts +1 -1
  45. package/dist/common/flow-model.d.ts +121 -0
  46. package/dist/common/flow-notifications.d.ts +1 -1
  47. package/dist/common/flow-retry.d.ts +3 -5
  48. package/dist/common/flow-semantics.js +816 -586
  49. package/dist/common/flow-workflowReferences.d.ts +8 -0
  50. package/dist/common/flowInspection.d.ts +1 -1
  51. package/dist/common/http-hosts.d.ts +6 -0
  52. package/dist/common/http-request.d.ts +164 -0
  53. package/dist/common/http-request.js +5272 -0
  54. package/dist/common/integration-trigger.d.ts +2 -1
  55. package/dist/common/mcp.d.ts +3 -3
  56. package/dist/common/mcp.js +248 -136
  57. package/dist/common/openapi.d.ts +4 -4
  58. package/dist/common/openapi.js +4 -1
  59. package/dist/common/poll-trigger.d.ts +2 -1
  60. package/dist/common/run-events.js +11 -9
  61. package/dist/common/runtime-contract.d.ts +23 -1
  62. package/dist/common/runtime-contract.js +607 -72
  63. package/dist/common/runtime-nodejs-compat.d.ts +44 -0
  64. package/dist/common/runtime-nodejs-compat.js +5870 -0
  65. package/dist/common/scheduler-checkpoint.d.ts +1 -1
  66. package/dist/common/scheduler-node-execution.d.ts +1 -1
  67. package/dist/common/scheduler.d.ts +2 -2
  68. package/dist/common/scheduler.js +95 -25
  69. package/dist/common/trigger-catalog.d.ts +1 -7
  70. package/dist/common/trigger-config-options.d.ts +1 -1
  71. package/dist/common/trigger-config.d.ts +1 -1
  72. package/dist/common/trigger-contract.d.ts +2 -1
  73. package/dist/common/trigger-localization.d.ts +8 -2
  74. package/dist/common/trigger-model.d.ts +101 -0
  75. package/dist/common/webhook-response.d.ts +1 -3
  76. package/dist/common/webhook-trigger.d.ts +3 -1
  77. package/dist/common/webhook-trigger.js +12 -11
  78. package/dist/common/workflow.d.ts +3 -12
  79. package/dist/common/workflow.js +25 -23
  80. package/dist/index.d.ts +41 -14
  81. package/package.json +9 -1
  82. package/skills/open-flow/references/flow-authoring.md +1 -0
  83. package/skills/open-flow/references/flow-n8n-conversion.md +19 -15
  84. package/src/base/common/json.ts +1 -1
  85. package/src/connector/common/proxy.ts +1 -1
  86. package/src/control/common/api.ts +7 -5
  87. package/src/control/common/authoring.ts +14 -3
  88. package/src/control/common/authoringExamples.ts +8 -0
  89. package/src/control/common/authoringSchema.ts +38 -25
  90. package/src/control/common/authoringTools.ts +1 -1
  91. package/src/control/common/conformance.ts +1 -1
  92. package/src/control/common/connectorDecoders.ts +1 -1
  93. package/src/control/common/eventSources.ts +2 -29
  94. package/src/control/common/triggerCatalog.ts +1 -8
  95. package/src/decision/common/decision.ts +15 -7
  96. package/src/event-source/common/definition.ts +1 -1
  97. package/src/event-source/common/index.ts +1 -1
  98. package/src/event-source/common/view.ts +20 -0
  99. package/src/execution/common/checkpoint.ts +1 -1
  100. package/src/execution/common/events.ts +3 -0
  101. package/src/execution/common/node-execution.ts +5 -3
  102. package/src/execution/common/scheduler.ts +2 -1
  103. package/src/flow/common/change.ts +59 -192
  104. package/src/flow/common/changeSchema.ts +39 -5
  105. package/src/flow/common/connectionUsage.ts +1 -1
  106. package/src/flow/common/graph.ts +10 -4
  107. package/src/flow/common/inputValue.ts +1 -1
  108. package/src/flow/common/model.ts +130 -0
  109. package/src/flow/common/modules.ts +1 -1
  110. package/src/flow/common/portChanges.ts +1 -1
  111. package/src/flow/common/retry.ts +3 -5
  112. package/src/flow/common/semantics.ts +71 -7
  113. package/src/flow/common/webhookResponse.ts +4 -8
  114. package/src/flow/common/workflowReferences.ts +31 -0
  115. package/src/http/common/authBindings.ts +9 -0
  116. package/src/http/common/headers.ts +5 -0
  117. package/src/http/common/hosts.ts +13 -0
  118. package/src/http/common/httpRequest.ts +266 -0
  119. package/src/openapi/common/openapi.ts +9 -5
  120. package/src/{execution → runtime}/common/engineContract.ts +24 -15
  121. package/src/runtime/common/nodejsCompat.ts +275 -0
  122. package/src/runtime/common/nodejsGuest.generated.json +47 -0
  123. package/src/runtime/common/runtime.ts +1138 -0
  124. package/src/trigger/common/config.ts +1 -1
  125. package/src/trigger/common/configOptions.ts +1 -1
  126. package/src/trigger/common/contract.ts +2 -1
  127. package/src/trigger/common/cron.ts +2 -1
  128. package/src/trigger/common/integration.ts +2 -1
  129. package/src/trigger/common/model.ts +87 -0
  130. package/src/trigger/common/poll.ts +2 -1
  131. package/src/trigger/common/webhook.ts +7 -4
  132. package/src/trigger/providers/fieldDescriptions.ts +1 -1
  133. package/src/trigger/providers/localization.ts +9 -2
  134. package/src/trigger/providers/remote.ts +1 -1
  135. package/src/types/index.ts +44 -15
  136. package/src/workflow/common/workflow.ts +3 -44
  137. package/src/execution/common/runtime.ts +0 -563
  138. package/src/openapi/common/authBindings.ts +0 -12
  139. /package/src/{control → connector}/common/providerIconSprite.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  import { a as toPlainObject, i as isString } from "./dist-BFmpkX4P.js";
2
- import { $ as useAnchoredPopupScrollLock, A as string, An as ownerDocument, At as useTriggerDataForwarding, Bn as useValueChanged, Br as isElement, C as literal, Cn as activeElement, Cr as useRenderElement, Ct as useSyncedFloatingRootContext, D as preprocess, Dt as PopupTriggerMap, E as object, Er as NOOP, Et as popupStoreSelectors, F as IndexGuessBehavior, Ft as FloatingFocusManager, Gn as closePress, Ht as FloatingPortal, I as useCompositeListItem, Ir as useStableCallback, Jn as imperativeAction, Jt as ReactStore, Ln as transitionStatusMapping, Lr as useRefWithInit, M as unknown, Mn as createLucideIcon, Mr as formatErrorMessage, Mt as platform, N as _isoDateTime, Nn as useTransitionStatus, Nr as mergeProps, Nt as useDismiss, O as record$1, Or as useMergedRefs, Ot as useImplicitActiveTrigger, P as Separator, Pn as useOpenChangeComplete, Pr as useIsoLayoutEffect, Pt as useClick, Q as useToolbarRootContext, Qn as itemPress, Rn as useAnimationFrame, T as number, Tn as getTarget, Tr as EMPTY_OBJECT, Tt as createInitialPopupStoreState, U as COMPOSITE_KEYS, Un as cancelOpen, Ut as CLICK_TRIGGER_IDENTIFIER, Vn as createChangeEventDetails, Wt as DROPDOWN_COLLISION_AVOIDANCE, Xt as useStore, Yt as Store, _ as array, _r as useControlled, _t as useRole, an as useTimeout, br as cn, cr as useFormContext, ct as inertValue, dr as useBaseUiId, dt as popupStateMapping, er as none, et as useScrollLock, f as isTimeZone, ft as pressableTriggerOpenStateMapping, g as _enum, gr as visuallyHiddenInput, gt as useTypeahead, h as ZodType, hr as visuallyHidden, i as TooltipTrigger, it as useAnchorPositioning, j as union, jn as Check, k as strictObject, kn as isWebKit, kr as useButton, kt as useOpenStateTransitions, lr as useRegisterFieldControl, lt as getPseudoElementBounds, m as ZodISODateTime, mr as fieldValidityMapping, mt as useOpenInteractionType, n as TooltipContent, nn as useValueAsRef, nt as getDisabledMountTransitionStyles, or as windowResize, ot as useDirection, pt as triggerOpenStateMapping, qt as addEventListener, rn as useOnFirstRender, rt as InternalBackdrop, sr as useLabelableContext, st as CompositeList, t as Tooltip, tn as createSelector, tt as usePositioner, ur as useFieldRootContext, ut as CommonPopupDataAttributes, v as boolean, vr as Button, vt as useListNavigation, w as never, wn as contains, wr as EMPTY_ARRAY, wt as useFloatingRootContext, x as json$1, xn as getFloatingFocusElement, xr as cva, y as discriminatedUnion, yn as rectToClientRect, yr as buttonVariants, yt as useInteractions, zr as getWindow } from "./tooltip-wZJRB9oP.js";
2
+ import { $ as useAnchoredPopupScrollLock, A as string, An as ownerDocument, At as useTriggerDataForwarding, Bn as useValueChanged, Br as isElement, C as literal, Cn as activeElement, Cr as useRenderElement, Ct as useSyncedFloatingRootContext, D as preprocess, Dt as PopupTriggerMap, E as object, Er as NOOP, Et as popupStoreSelectors, F as IndexGuessBehavior, Ft as FloatingFocusManager, Gn as closePress, Ht as FloatingPortal, I as useCompositeListItem, Ir as useStableCallback, Jn as imperativeAction, Jt as ReactStore, Ln as transitionStatusMapping, Lr as useRefWithInit, M as unknown, Mn as createLucideIcon, Mr as formatErrorMessage, Mt as platform, N as _isoDateTime, Nn as useTransitionStatus, Nr as mergeProps, Nt as useDismiss, O as record$1, Or as useMergedRefs, Ot as useImplicitActiveTrigger, P as Separator, Pn as useOpenChangeComplete, Pr as useIsoLayoutEffect, Pt as useClick, Q as useToolbarRootContext, Qn as itemPress, Rn as useAnimationFrame, T as number, Tn as getTarget, Tr as EMPTY_OBJECT, Tt as createInitialPopupStoreState, U as COMPOSITE_KEYS, Un as cancelOpen, Ut as CLICK_TRIGGER_IDENTIFIER, Vn as createChangeEventDetails, Wt as DROPDOWN_COLLISION_AVOIDANCE, Xt as useStore, Yt as Store, _ as array, _r as useControlled, _t as useRole, an as useTimeout, br as cn, cr as useFormContext, ct as inertValue, dr as useBaseUiId, dt as popupStateMapping, er as none, et as useScrollLock, f as isTimeZone, ft as pressableTriggerOpenStateMapping, g as _enum, gr as visuallyHiddenInput, gt as useTypeahead, h as ZodType, hr as visuallyHidden, i as TooltipTrigger, it as useAnchorPositioning, j as union, jn as Check, k as strictObject, kn as isWebKit, kr as useButton, kt as useOpenStateTransitions, lr as useRegisterFieldControl, lt as getPseudoElementBounds, m as ZodISODateTime, mr as fieldValidityMapping, mt as useOpenInteractionType, n as TooltipContent, nn as useValueAsRef, nt as getDisabledMountTransitionStyles, or as windowResize, ot as useDirection, pt as triggerOpenStateMapping, qt as addEventListener, rn as useOnFirstRender, rt as InternalBackdrop, sr as useLabelableContext, st as CompositeList, t as Tooltip, tn as createSelector, tt as usePositioner, ur as useFieldRootContext, ut as CommonPopupDataAttributes, v as boolean, vr as Button, vt as useListNavigation, w as never, wn as contains, wr as EMPTY_ARRAY, wt as useFloatingRootContext, x as json$1, xn as getFloatingFocusElement, xr as cva, y as discriminatedUnion, yn as rectToClientRect, yr as buttonVariants, yt as useInteractions, zr as getWindow } from "./tooltip-3XMK9jkr.js";
3
3
  import * as React from "react";
4
4
  import { useMemo } from "react";
5
5
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -6290,6 +6290,9 @@ function webhookSupportsBody(method) {
6290
6290
  }
6291
6291
  //#endregion
6292
6292
  //#region src/decision/common/decision.ts
6293
+ function isDecisionExecutor(executor) {
6294
+ return executor.kind === "decision";
6295
+ }
6293
6296
  var decisionModel = "typesafe/jev";
6294
6297
  var decisionLimits = {
6295
6298
  choice: 255,
@@ -6313,7 +6316,7 @@ function limitDecisionQuestions(questions) {
6313
6316
  }
6314
6317
  /** Loading an oversized task also updates its previously generated output schemas. */
6315
6318
  function limitDecisionTask(task) {
6316
- if (task.executor.kind !== "decision") return task;
6319
+ if (!isDecisionExecutor(task.executor)) return task;
6317
6320
  const original = task.executor.questions;
6318
6321
  const questions = limitDecisionQuestions(original);
6319
6322
  if (questions === original) return task;
@@ -6437,13 +6440,296 @@ function decisionTask(questions = [defaultDecisionQuestion()], name = "AI Decisi
6437
6440
  };
6438
6441
  }
6439
6442
  //#endregion
6440
- //#region src/openapi/common/authBindings.ts
6441
- /** Never allow credentials to enter a Revision as literal node inputs. */
6442
- function assertOpenApiAuthBindings(document) {
6443
- for (const node of Object.values(document.graph.nodes)) {
6444
- if (node.kind != "task" || !("executor" in node.task) || node.task.executor.kind != "openapi") continue;
6445
- for (const [handle, mapping] of Object.entries(node.inputs)) if (handle.startsWith("auth.") && mapping.kind == "value") throw new TypeError("OpenAPI authentication accepts deployment variables and upstream outputs only.");
6443
+ //#region src/http/common/authBindings.ts
6444
+ /** Never allow credentials to enter a Revision as literal inputs of an OpenAPI or HTTP request node. */
6445
+ function assertHttpAuthBindings(inputs) {
6446
+ for (const [handle, mapping] of Object.entries(inputs)) if (handle.startsWith("auth.") && mapping.kind == "value") throw new TypeError("HTTP authentication accepts deployment variables and upstream outputs only.");
6447
+ }
6448
+ //#endregion
6449
+ //#region src/http/common/hosts.ts
6450
+ /** Hosts of a Code `http` Capability: lowercase DNS names or IPv4 addresses; `*.example.com` matches subdomains only. */
6451
+ var httpHostPattern = /^(?:\*\.)?(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
6452
+ /** Wildcards must name a registrable suffix, so `*.com` is rejected. */
6453
+ function isHttpHost(value) {
6454
+ return httpHostPattern.test(value) && (!value.startsWith("*.") || value.slice(2).includes("."));
6455
+ }
6456
+ //#endregion
6457
+ //#region src/flow/common/portChanges.ts
6458
+ function renamedPort(previous, next) {
6459
+ const previousNames = new Set(previous.flatMap((port) => "handle" in port ? [port.handle] : []));
6460
+ const nextNames = new Set(next.flatMap((port) => "handle" in port ? [port.handle] : []));
6461
+ const removed = [...previousNames].filter((name) => !nextNames.has(name));
6462
+ const added = [...nextNames].filter((name) => !previousNames.has(name));
6463
+ return removed.length == 1 && added.length == 1 ? [removed[0], added[0]] : void 0;
6464
+ }
6465
+ function renameOutputMapping(mapping, nodeIds, rename) {
6466
+ if (rename == null || mapping.kind != "sources") return mapping;
6467
+ const sources = mapping.sources.map((source) => source.kind == "node" && !source.system && nodeIds.has(source.nodeId) && source.output == rename[0] ? {
6468
+ ...source,
6469
+ output: rename[1]
6470
+ } : source);
6471
+ return sources.every((source, index) => source === mapping.sources[index]) ? mapping : {
6472
+ kind: "sources",
6473
+ sources
6474
+ };
6475
+ }
6476
+ /** Carry saved mappings through a field rename and remove only fields absent from the new contract. */
6477
+ function remapInputMappings(mappings, ports, rename) {
6478
+ const inputs = { ...mappings };
6479
+ if (rename != null && Object.hasOwn(inputs, rename[0])) {
6480
+ Object.defineProperty(inputs, rename[1], {
6481
+ value: inputs[rename[0]],
6482
+ enumerable: true,
6483
+ configurable: true,
6484
+ writable: true
6485
+ });
6486
+ delete inputs[rename[0]];
6487
+ }
6488
+ const names = new Set(ports.flatMap((port) => "handle" in port ? [port.handle] : []));
6489
+ for (const name of Object.keys(inputs)) if (!names.has(name)) delete inputs[name];
6490
+ return inputs;
6491
+ }
6492
+ //#endregion
6493
+ //#region src/http/common/headers.ts
6494
+ /** Header names are case-insensitive; never silently combine duplicate business fields. */
6495
+ function httpHeaderNameIssue(name, names) {
6496
+ if (!/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(name)) return "invalid";
6497
+ if (names.some((candidate) => candidate.toLowerCase() === name.toLowerCase())) return "duplicate";
6498
+ }
6499
+ //#endregion
6500
+ //#region src/http/common/httpRequest.ts
6501
+ var parameterSchema = strictObject({
6502
+ mode: _enum(["fields", "object"]).default("fields"),
6503
+ names: array(string()).default([])
6504
+ });
6505
+ var httpRequestConfigSchema = strictObject({
6506
+ method: _enum([
6507
+ "GET",
6508
+ "POST",
6509
+ "PUT",
6510
+ "PATCH",
6511
+ "DELETE",
6512
+ "HEAD",
6513
+ "OPTIONS"
6514
+ ]).default("GET"),
6515
+ query: parameterSchema.default({
6516
+ mode: "fields",
6517
+ names: []
6518
+ }),
6519
+ headers: parameterSchema.default({
6520
+ mode: "fields",
6521
+ names: []
6522
+ }),
6523
+ bodyFormat: _enum([
6524
+ "none",
6525
+ "json",
6526
+ "text",
6527
+ "form"
6528
+ ]).default("none"),
6529
+ authentication: union([
6530
+ strictObject({ type: literal("none") }),
6531
+ strictObject({ type: _enum(["bearer", "basic"]) }),
6532
+ strictObject({
6533
+ type: literal("apiKey"),
6534
+ name: string(),
6535
+ in: _enum(["header", "query"])
6536
+ })
6537
+ ]).default({ type: "none" }),
6538
+ responseFormat: _enum([
6539
+ "auto",
6540
+ "json",
6541
+ "text"
6542
+ ]).default("auto"),
6543
+ statusPolicy: _enum(["success", "all"]).default("success")
6544
+ });
6545
+ var httpRequestExecutorSchema = httpRequestConfigSchema.extend({ kind: literal("http-request") });
6546
+ var scalarSchema = { type: [
6547
+ "string",
6548
+ "number",
6549
+ "boolean"
6550
+ ] };
6551
+ var queryValueSchema = { anyOf: [scalarSchema, {
6552
+ type: "array",
6553
+ items: scalarSchema
6554
+ }] };
6555
+ var httpHeaderSchema = {
6556
+ type: "object",
6557
+ additionalProperties: { type: "string" }
6558
+ };
6559
+ var httpQuerySchema = {
6560
+ type: "object",
6561
+ additionalProperties: queryValueSchema
6562
+ };
6563
+ function httpAuthHandles(config) {
6564
+ return config.authentication.type == "none" ? [] : config.authentication.type == "basic" ? ["auth.username", "auth.password"] : ["auth.token"];
6565
+ }
6566
+ function retain(ports, old) {
6567
+ const remaining = new Map(ports.map((port) => [port.handle, port]));
6568
+ return [...old.flatMap((item) => {
6569
+ if ("group" in item) return [item];
6570
+ const next = remaining.get(item.handle);
6571
+ if (next == null) return [];
6572
+ remaining.delete(item.handle);
6573
+ return [dequal(item.jsonSchema, next.jsonSchema) && item.nullable == next.nullable ? item : next];
6574
+ }), ...remaining.values()];
6575
+ }
6576
+ function httpRequestTask(config = httpRequestConfigSchema.parse({}), name = "HTTP Request", previous) {
6577
+ const inputs = [{
6578
+ handle: "url",
6579
+ jsonSchema: { type: "string" },
6580
+ nullable: false
6581
+ }];
6582
+ for (const group of ["query", "headers"]) if (config[group].mode == "object") inputs.push({
6583
+ handle: group,
6584
+ jsonSchema: group == "query" ? httpQuerySchema : httpHeaderSchema,
6585
+ nullable: true
6586
+ });
6587
+ else for (const parameterName of config[group].names.filter((value) => value.trim())) inputs.push({
6588
+ handle: `${group == "query" ? "query" : "header"}.${parameterName}`,
6589
+ jsonSchema: group == "query" ? queryValueSchema : { type: "string" },
6590
+ nullable: true
6591
+ });
6592
+ if (config.bodyFormat != "none") inputs.push({
6593
+ handle: "body",
6594
+ jsonSchema: config.bodyFormat == "json" ? {} : config.bodyFormat == "text" ? { type: "string" } : httpQuerySchema,
6595
+ nullable: config.bodyFormat == "json"
6596
+ });
6597
+ inputs.push(...httpAuthHandles(config).map((handle) => ({
6598
+ handle,
6599
+ jsonSchema: { type: "string" },
6600
+ nullable: false
6601
+ })));
6602
+ const outputs = [
6603
+ {
6604
+ handle: "body",
6605
+ jsonSchema: config.responseFormat == "text" ? { type: "string" } : {},
6606
+ nullable: true
6607
+ },
6608
+ {
6609
+ handle: "statusCode",
6610
+ jsonSchema: { type: "integer" },
6611
+ nullable: false
6612
+ },
6613
+ {
6614
+ handle: "headers",
6615
+ jsonSchema: httpHeaderSchema,
6616
+ nullable: false
6617
+ }
6618
+ ];
6619
+ return {
6620
+ name,
6621
+ executor: {
6622
+ ...config,
6623
+ kind: "http-request"
6624
+ },
6625
+ inputs: retain(inputs, previous?.inputs ?? []),
6626
+ outputs: retain(outputs, previous?.outputs ?? [])
6627
+ };
6628
+ }
6629
+ function httpRequestIssues(config) {
6630
+ const issues = [];
6631
+ if (["GET", "HEAD"].includes(config.method) && config.bodyFormat != "none") issues.push({
6632
+ field: "bodyFormat",
6633
+ code: "bodyUnsupported",
6634
+ message: "GET and HEAD do not support a request body."
6635
+ });
6636
+ for (const group of ["query", "headers"]) {
6637
+ if (config[group].mode != "fields") continue;
6638
+ const seen = /* @__PURE__ */ new Set();
6639
+ for (const [index, name] of config[group].names.entries()) {
6640
+ const key = group == "headers" ? name.toLowerCase() : name;
6641
+ if (!name.trim() || seen.has(key)) issues.push({
6642
+ field: group,
6643
+ index,
6644
+ code: "parameterNamesInvalid",
6645
+ message: "Parameter names must be nonempty and unique."
6646
+ });
6647
+ seen.add(key);
6648
+ if (group == "headers" && httpHeaderNameIssue(name, []) === "invalid") issues.push({
6649
+ field: group,
6650
+ index,
6651
+ code: "headerNameInvalid",
6652
+ message: "Invalid HTTP header name."
6653
+ });
6654
+ }
6655
+ }
6656
+ const auth = config.authentication;
6657
+ if (auth.type != "none") {
6658
+ const group = auth.type == "apiKey" && auth.in == "query" ? "query" : "headers";
6659
+ const name = auth.type == "apiKey" ? auth.name : "authorization";
6660
+ if (!name.trim()) issues.push({
6661
+ field: "authentication",
6662
+ code: "keyNameRequired",
6663
+ message: "API Key requires a name."
6664
+ });
6665
+ if (group == "headers" && name.trim() && httpHeaderNameIssue(name, []) === "invalid") issues.push({
6666
+ field: "authentication",
6667
+ code: "headerNameInvalid",
6668
+ message: "Invalid authentication header name."
6669
+ });
6670
+ if (config[group].mode == "fields" && config[group].names.some((item) => group == "headers" ? item.toLowerCase() == name.toLowerCase() : item == name)) issues.push({
6671
+ field: "authentication",
6672
+ code: "authConflict",
6673
+ message: "Authentication conflicts with a request parameter."
6674
+ });
6446
6675
  }
6676
+ return issues;
6677
+ }
6678
+ /** Only a named parameter rename carries a value; changing source modes is not a rename. */
6679
+ function httpRequestInputs(mappings, previous, next) {
6680
+ const candidate = renamedPort(previous.inputs, next.inputs);
6681
+ const rename = candidate != null && ["query.", "header."].some((prefix) => candidate.every((name) => name.startsWith(prefix))) ? candidate : void 0;
6682
+ return remapInputMappings(mappings, next.inputs, rename);
6683
+ }
6684
+ function httpRequestExecutor(node) {
6685
+ const executor = node.task.executor;
6686
+ return executor?.kind === "http-request" ? executor : void 0;
6687
+ }
6688
+ /** The object editor assembles named inputs without changing unrelated request settings. */
6689
+ function withHttpParameterFields(node, group, values) {
6690
+ const config = httpRequestExecutor(node);
6691
+ if (config == null) return node;
6692
+ const task = httpRequestTask({
6693
+ ...config,
6694
+ [group]: {
6695
+ mode: "fields",
6696
+ names: Object.keys(values)
6697
+ }
6698
+ }, node.task.name, node.task);
6699
+ const inputs = httpRequestInputs(node.inputs, node.task, task);
6700
+ const rename = renamedPort(node.task.inputs, task.inputs);
6701
+ for (const [name, value] of Object.entries(values)) {
6702
+ const handle = `${group === "query" ? "query" : "header"}.${name}`;
6703
+ const existing = config[group].mode === "fields" && (config[group].names.includes(name) || rename?.[1] === handle);
6704
+ if (inputs[handle] == null && !existing) inputs[handle] = {
6705
+ kind: "value",
6706
+ value
6707
+ };
6708
+ }
6709
+ return {
6710
+ ...node,
6711
+ task,
6712
+ inputs
6713
+ };
6714
+ }
6715
+ function withHttpParameterSource(node, group, mapping) {
6716
+ const config = httpRequestExecutor(node);
6717
+ if (config == null) return node;
6718
+ const task = httpRequestTask({
6719
+ ...config,
6720
+ [group]: {
6721
+ mode: "object",
6722
+ names: []
6723
+ }
6724
+ }, node.task.name, node.task);
6725
+ const inputs = httpRequestInputs(node.inputs, node.task, task);
6726
+ if (mapping == null) delete inputs[group];
6727
+ else inputs[group] = mapping;
6728
+ return {
6729
+ ...node,
6730
+ task,
6731
+ inputs
6732
+ };
6447
6733
  }
6448
6734
  function checkJsonDepth(value, depth = 0) {
6449
6735
  if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
@@ -6455,6 +6741,7 @@ var retryNodeTypes = [
6455
6741
  "code",
6456
6742
  "connector",
6457
6743
  "openapi",
6744
+ "http-request",
6458
6745
  "llm",
6459
6746
  "decision"
6460
6747
  ];
@@ -6552,11 +6839,6 @@ function workflowOutputsPort(outputs) {
6552
6839
  nullable: false
6553
6840
  };
6554
6841
  }
6555
- /** Header names are case-insensitive; never silently combine duplicate business fields. */
6556
- function webhookHeaderNameIssue(name, names) {
6557
- if (!/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(name)) return "invalid";
6558
- if (names.some((candidate) => candidate.toLowerCase() === name.toLowerCase())) return "duplicate";
6559
- }
6560
6842
  /** Fixed inputs belong to the node, not author-supplied definitions. */
6561
6843
  var webhookResponseInputs = [
6562
6844
  {
@@ -6659,7 +6941,15 @@ var workflowCapabilitySchema = strictObject({
6659
6941
  inputs: array(port),
6660
6942
  outputs: array(port).nullable()
6661
6943
  });
6662
- var capability = union([connectorCapabilitySchema, workflowCapabilitySchema]);
6944
+ var httpCapabilitySchema = strictObject({
6945
+ kind: literal("http"),
6946
+ hosts: array(text.refine(isHttpHost, "Use a lowercase host name or IPv4 address, optionally prefixed by \"*.\" for subdomains.")).min(1).max(20).describe("Hosts Code may call with context.fetch. \"*.example.com\" matches subdomains only.")
6947
+ });
6948
+ var capability = union([
6949
+ connectorCapabilitySchema,
6950
+ workflowCapabilitySchema,
6951
+ httpCapabilitySchema
6952
+ ]);
6663
6953
  var inline = object({
6664
6954
  ...ports,
6665
6955
  name: text,
@@ -6769,7 +7059,8 @@ var managedFields = object({
6769
7059
  kind: literal("workflow"),
6770
7060
  flowId: text,
6771
7061
  revisionId: text
6772
- })
7062
+ }),
7063
+ httpRequestExecutorSchema
6773
7064
  ])
6774
7065
  });
6775
7066
  var managed = managedFields.transform(limitDecisionTask);
@@ -7038,7 +7329,8 @@ var revision = object({
7038
7329
  literal(8),
7039
7330
  literal(9),
7040
7331
  literal(10),
7041
- literal(11)
7332
+ literal(11),
7333
+ literal(12)
7042
7334
  ]),
7043
7335
  document,
7044
7336
  modules: record$1(text, module)
@@ -7069,7 +7361,7 @@ function decodeRevisionContent(value) {
7069
7361
  checkJsonDepth(value);
7070
7362
  const content = revision.parse(value);
7071
7363
  checkModelVersion(content);
7072
- assertOpenApiAuthBindings(content.document);
7364
+ assertDocumentHttpAuthBindings(content.document);
7073
7365
  return content;
7074
7366
  }
7075
7367
  var shapes = {
@@ -7240,6 +7532,8 @@ var variants = new Map(Object.entries(shapes).map(([kind, shape]) => [kind, shap
7240
7532
  })]));
7241
7533
  array(union([...variants.values()])).min(1);
7242
7534
  function checkModelVersion(content) {
7535
+ if (content.modelVersion < 12 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "moduleId" in candidateNode.task && candidateNode.task.capabilities?.some((item) => item.kind == "http"))) throw new TypeError("Code HTTP access requires Flow model version 12.");
7536
+ if (content.modelVersion < 11 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "executor" in candidateNode.task && candidateNode.task.executor.kind == "http-request")) throw new TypeError("HTTP Request requires Flow model version 11.");
7243
7537
  if (content.modelVersion < 11 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && ("moduleId" in candidateNode.task ? candidateNode.task.capabilities?.some((item) => item.kind == "workflow") : candidateNode.task.executor.kind == "agent" && candidateNode.task.executor.tools.some((item) => item.kind == "workflow")))) throw new TypeError("Workflow tools require Flow model version 11.");
7244
7538
  if (content.modelVersion < 10 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "webhook" && (candidateNode.options?.responseBody != null || candidateNode.options?.responseStatusCodeOutput != null || candidateNode.options?.responseHeadersSource != null || candidateNode.options?.responseHeaderOutputs != null))) throw new TypeError("Dynamic Webhook responses require Flow model version 10.");
7245
7539
  if (content.modelVersion < 9 && Object.values(content.document.graph.nodes).some((candidateNode) => "retry" in candidateNode && candidateNode.retry != null)) throw new TypeError("Node retries require Flow model version 9.");
@@ -7254,6 +7548,9 @@ function checkModelVersion(content) {
7254
7548
  if (content.modelVersion < 6 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "executor" in candidateNode.task)) throw new TypeError("Node-owned managed Tasks require Flow model version 6.");
7255
7549
  if (content.modelVersion < 5 && Object.values(content.document.graph.nodes).some((itemNode) => itemNode.kind == "error")) throw new TypeError("Error workflows require Flow model version 5.");
7256
7550
  }
7551
+ function assertDocumentHttpAuthBindings(content) {
7552
+ for (const graphNode of Object.values(content.graph.nodes)) if (graphNode.kind == "task" && "executor" in graphNode.task && ["openapi", "http-request"].includes(graphNode.task.executor.kind)) assertHttpAuthBindings(graphNode.inputs);
7553
+ }
7257
7554
  //#endregion
7258
7555
  //#region src/flow/common/condition.ts
7259
7556
  var otherwiseOutput = "otherwise";
@@ -7492,9 +7789,6 @@ function resourceNameIssue(value) {
7492
7789
  }
7493
7790
  if (!/^[\p{L}\p{N}](?:[\p{L}\p{N} _-]*[\p{L}\p{N}])?$/u.test(name)) return "specialCharacter";
7494
7791
  }
7495
- function portsByHandle(ports) {
7496
- return Object.fromEntries(ports.flatMap((port) => "handle" in port ? [[port.handle, port]] : []));
7497
- }
7498
7792
  var workflowToolNamePattern = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;
7499
7793
  function workflowToolNameIssue(name, otherNames = []) {
7500
7794
  if (!workflowToolNamePattern.test(name)) return "invalid";
@@ -7510,6 +7804,8 @@ function decodeTaskCapabilities(value) {
7510
7804
  if (workflowToolNameIssue(item.name, names)) throw new TypeError("Workflow tool names must be unique provider-compatible names.");
7511
7805
  names.add(item.name);
7512
7806
  }
7807
+ const http = parsed.filter((item) => item.kind == "http");
7808
+ if (http.length > 1 || http.some((item) => new Set(item.hosts).size != item.hosts.length)) throw new TypeError("Code declares HTTP hosts once, without duplicates.");
7513
7809
  let connectorIndex = 0;
7514
7810
  return parsed.map((item) => item.kind == "connector" ? connectors[connectorIndex++] : item);
7515
7811
  }
@@ -7645,10 +7941,10 @@ function upgradeRevisionContent(content) {
7645
7941
  function upgradeDecodedRevisionContent(content) {
7646
7942
  const graph = content.document.graph;
7647
7943
  const hasManual = Object.values(graph.nodes).some((node) => node.kind == "manual");
7648
- if (!hasManual && content.modelVersion == 11) return content;
7944
+ if (!hasManual && content.modelVersion == 12) return content;
7649
7945
  return {
7650
7946
  ...content,
7651
- modelVersion: 11,
7947
+ modelVersion: 12,
7652
7948
  document: {
7653
7949
  ...content.document,
7654
7950
  graph: hasManual ? {
@@ -7695,7 +7991,7 @@ function invalid(message) {
7695
7991
  throw new FlowChangeError(message);
7696
7992
  }
7697
7993
  function applyFlowChanges(content, operations) {
7698
- const source = content.modelVersion != 11 || Object.values(content.document.graph.nodes).some((node) => node.kind == "manual") ? decodeRevisionContent(content) : content;
7994
+ const source = content.modelVersion != 12 || Object.values(content.document.graph.nodes).some((node) => node.kind == "manual") ? decodeRevisionContent(content) : content;
7699
7995
  const document = { ...source.document };
7700
7996
  const modules = { ...source.modules };
7701
7997
  for (const operation of operations) switch (operation.kind) {
@@ -8140,10 +8436,10 @@ function applyFlowChanges(content, operations) {
8140
8436
  break;
8141
8437
  }
8142
8438
  }
8143
- assertOpenApiAuthBindings(document);
8439
+ assertDocumentHttpAuthBindings(document);
8144
8440
  return upgradeDecodedRevisionContent({
8145
8441
  document,
8146
- modelVersion: 11,
8442
+ modelVersion: 12,
8147
8443
  modules
8148
8444
  });
8149
8445
  }
@@ -9044,4 +9340,4 @@ function DialogDescription({ className, ...props }) {
9044
9340
  });
9045
9341
  }
9046
9342
  //#endregion
9047
- export { workflowOutputsPort as $, clearConditionBindings as A, resolveAriaLabelledBy as At, agentToolFields as B, Label as Bt, resourceNameIssue as C, SelectChevron as Ct, nodeErrorSchema as D, SelectSeparator as Dt, workflowToolNameIssue as E, SelectItem as Et, operandHandle as F, compareItemEquality as Ft, workflowAgentToolSchema as G, connectorAgentToolSchema as H, useLabelableId as Ht, operatorsForType as I, defaultItemEquality as It, webhookHeadersPort as J, webhookHeaderNameIssue as K, otherwiseOutput as L, findItemIndex as Lt, conditionInputPorts as M, isGroupedItems as Mt, mapConditionSources as N, stringifyAsLabel as Nt, nodeSystemOutputPorts as O, SelectTrigger as Ot, nodeInputMappings as P, stringifyAsValue as Pt, webhookStatusCodePort as Q, unaryOperator as R, removeItem as Rt, portsByHandle as S, Select as St, upgradeRevisionContent as T, SelectGroup as Tt, connectorCapabilitySchema as U, ChevronDown as Ut, authoringDefinitionSchemas as V, Input as Vt, decodeRevisionContent as W, webhookResponseInputs as X, webhookResponseAllowsBody as Y, webhookResponseTimeout as Z, applyFlowChanges as _, schemaObject as _t, DialogFooter as a, checkJsonDepth as at, nodeNameIssue as b, format as bt, DialogTrigger as c, decisionQuestionIssues as ct, Field as d, limitDecisionQuestions as dt, waitAutoContinueSchema as et, FieldDescription as f, webhookMethods as ft, FlowChangeError as g, portsAssignable as gt, FieldLabel as h, matchesSchema as ht, DialogDescription as i, supportsNodeRetry as it, comparisonIssue as j, hasNullItemLabel as jt, supportsNodeErrorHandling as k, SelectValue as kt, Icon as l, decisionTask as lt, FieldGroup as m, comparePorts as mt, DialogClose as n, nodeRetryLimits as nt, DialogHeader as o, decisionLimits as ot, FieldError as p, webhookSupportsBody as pt, webhookHeaderValuePort as q, DialogContent as r, retryConfigurationSchema as rt, DialogTitle as s, decisionModel as st, Dialog as t, defaultNodeRetry as tt, Spinner as u, defaultDecisionQuestion as ut, isTriggerNode as v, variableInputCompatible as vt, upgradeManualTrigger as w, SelectContent as wt, normalizeNodeName as x, dequal as xt, nextNodeName as y, isSchemaKeyword as yt, valueType as z, selectedValueIncludes as zt };
9343
+ export { waitAutoContinueSchema as $, Input as $t, comparisonIssue as A, variableInputCompatible as At, authoringDefinitionSchemas as B, SelectTrigger as Bt, upgradeManualTrigger as C, limitDecisionQuestions as Ct, nodeSystemOutputPorts as D, matchesSchema as Dt, nodeErrorSchema as E, comparePorts as Et, operatorsForType as F, SelectChevron as Ft, workflowAgentToolSchema as G, stringifyAsLabel as Gt, connectorCapabilitySchema as H, resolveAriaLabelledBy as Ht, otherwiseOutput as I, SelectContent as It, webhookResponseAllowsBody as J, defaultItemEquality as Jt, webhookHeaderValuePort as K, stringifyAsValue as Kt, unaryOperator as L, SelectGroup as Lt, mapConditionSources as M, format as Mt, nodeInputMappings as N, dequal as Nt, supportsNodeErrorHandling as O, portsAssignable as Ot, operandHandle as P, Select as Pt, workflowOutputsPort as Q, Label as Qt, valueType as R, SelectItem as Rt, resourceNameIssue as S, defaultDecisionQuestion as St, workflowToolNameIssue as T, webhookSupportsBody as Tt, decodeRevisionContent as U, hasNullItemLabel as Ut, connectorAgentToolSchema as V, SelectValue as Vt, httpCapabilitySchema as W, isGroupedItems as Wt, webhookResponseTimeout as X, removeItem as Xt, webhookResponseInputs as Y, findItemIndex as Yt, webhookStatusCodePort as Z, selectedValueIncludes as Zt, applyFlowChanges as _, isHttpHost as _t, DialogFooter as a, httpHeaderSchema as at, nodeNameIssue as b, decisionQuestionIssues as bt, DialogTrigger as c, httpRequestInputs as ct, Field as d, withHttpParameterFields as dt, useLabelableId as en, defaultNodeRetry as et, FieldDescription as f, withHttpParameterSource as ft, FlowChangeError as g, renamedPort as gt, FieldLabel as h, renameOutputMapping as ht, DialogDescription as i, checkJsonDepth as it, conditionInputPorts as j, isSchemaKeyword as jt, clearConditionBindings as k, schemaObject as kt, Icon as l, httpRequestIssues as lt, FieldGroup as m, remapInputMappings as mt, DialogClose as n, retryConfigurationSchema as nt, DialogHeader as o, httpQuerySchema as ot, FieldError as p, httpHeaderNameIssue as pt, webhookHeadersPort as q, compareItemEquality as qt, DialogContent as r, supportsNodeRetry as rt, DialogTitle as s, httpRequestConfigSchema as st, Dialog as t, ChevronDown as tn, nodeRetryLimits as tt, Spinner as u, httpRequestTask as ut, isTriggerNode as v, decisionLimits as vt, upgradeRevisionContent as w, webhookMethods as wt, normalizeNodeName as x, decisionTask as xt, nextNodeName as y, decisionModel as yt, agentToolFields as z, SelectSeparator as zt };
@@ -1,5 +1,5 @@
1
- import { n as IconImageCrossOriginContext, o as IconifyProvider } from "./ContentIcon-CUQHjQIw.js";
2
- import { t as FlowCanvas, v as CanvasStore } from "./FlowCanvas-Dtf8_cQp.js";
1
+ import { n as IconImageCrossOriginContext, o as IconifyProvider } from "./ContentIcon-Cm1hbVzW.js";
2
+ import { t as FlowCanvas, v as CanvasStore } from "./FlowCanvas-NzKtla_c.js";
3
3
  import { createElement } from "react";
4
4
  import { createRoot } from "react-dom/client";
5
5
  //#region ../../node_modules/.bun/html-to-image@1.11.11/node_modules/html-to-image/es/util.js