@oomol-lab/open-flow 0.1.0-beta.73 → 0.1.0-beta.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +36 -0
- package/NOTICE +7 -0
- package/README.md +41 -0
- package/dist/browser/{ContentIcon-CUQHjQIw.js → ContentIcon-FCpKiwjp.js} +2 -1
- package/dist/browser/{FlowCanvas-Dtf8_cQp.js → FlowCanvas-dzRBnlUT.js} +1 -1
- package/dist/browser/{createResourceDialog-BWJkjiOO.js → createResourceDialog-BeYDdUl-.js} +2 -2
- package/dist/browser/{dialog-CUy_fwx9.js → dialog-ZtpsFbl4.js} +337 -31
- package/dist/browser/{exportSvg-BOoy7-Db.js → exportSvg-DqXw1yf-.js} +2 -2
- package/dist/browser/{flowChanges-CgSnSqqP.js → flowChanges-b_5UobFj.js} +586 -87
- package/dist/browser/{flowWorkspace-Bf7H-r0t.js → flowWorkspace-ItojZbO4.js} +21162 -20242
- package/dist/browser/preview.css +254 -179
- package/dist/browser/preview.js +22201 -20625
- package/dist/browser/{typeScriptSession-B0hC-C8y.js → typeScriptSession-CSRwWmZm.js} +1 -1
- package/dist/browser/ui.css +72 -2
- package/dist/browser/workbench.css +254 -179
- package/dist/browser/workbench.js +22 -78
- package/dist/browser/{workbenchSelect-C3e4J93X.js → workbenchSelect-M441Lz0d.js} +1 -1
- package/dist/command/index.js +42 -42
- package/dist/common/authoring.d.ts +5 -5
- package/dist/common/authoringExamples.d.ts +3 -2
- package/dist/common/authoringFields.d.ts +1 -1
- package/dist/common/authoringSchema.d.ts +95 -8
- package/dist/common/connector-proxy.d.ts +1 -1
- package/dist/common/control-api-conformance.d.ts +1 -1
- package/dist/common/control-api-conformance.js +119 -31
- package/dist/common/control-api.d.ts +4 -3
- package/dist/common/control-api.js +117 -29
- package/dist/common/control-requests.d.ts +5 -4
- package/dist/common/control-requests.js +437 -103
- package/dist/common/cron-trigger.d.ts +1 -1
- package/dist/common/decision.d.ts +1 -1
- package/dist/common/draftOperations.d.ts +1 -1
- package/dist/common/engine-contract.d.ts +4 -2
- package/dist/common/event-source-definition.d.ts +1 -1
- package/dist/common/flow-agent.d.ts +1 -1
- package/dist/{browser → common}/flow-authoring-node.d.ts +3 -3
- package/dist/{browser → common}/flow-authoring.js +131 -30
- package/dist/{browser → common}/flow-change-schema.d.ts +177 -6
- package/dist/{browser → common}/flow-change.d.ts +35 -15
- package/dist/{browser → common}/flow-change.js +133 -32
- package/dist/common/flow-connectionUsage.d.ts +1 -1
- package/dist/common/flow-encoding.d.ts +1 -1
- package/dist/common/flow-encoding.js +89 -23
- package/dist/common/flow-errorHandling.d.ts +1 -1
- package/dist/common/flow-graph.d.ts +3 -2
- package/dist/common/flow-modules.d.ts +1 -1
- package/dist/common/flow-promptTemplate.d.ts +1 -1
- package/dist/common/flow-retry.d.ts +2 -2
- package/dist/common/flow-semantics.d.ts +1 -1
- package/dist/common/flow-semantics.js +966 -614
- package/dist/common/flow-workflowFile.d.ts +1 -1
- package/dist/common/flowInspection.d.ts +3 -3
- package/dist/common/http-request.d.ts +156 -0
- package/dist/common/http-request.js +5254 -0
- package/dist/common/integration-trigger.d.ts +1 -1
- package/dist/common/licenses.md +118 -1
- package/dist/common/liveDetails.d.ts +1 -1
- package/dist/common/mcp.d.ts +5 -4
- package/dist/common/mcp.js +117 -29
- package/dist/common/openapi.d.ts +1 -1
- package/dist/common/poll-trigger.d.ts +1 -1
- package/dist/common/run-events.js +11 -9
- package/dist/common/run-results.d.ts +8 -1
- package/dist/common/runtime-contract.d.ts +8 -2
- package/dist/common/runtime-contract.js +25 -5
- package/dist/common/scheduler-checkpoint.d.ts +1 -1
- package/dist/common/scheduler-dependencies.d.ts +1 -1
- package/dist/common/scheduler-node-execution.d.ts +1 -1
- package/dist/common/scheduler.d.ts +3 -3
- package/dist/common/scheduler.js +101 -33
- package/dist/common/trigger-catalog.d.ts +1 -1
- package/dist/common/trigger-config-options.d.ts +1 -1
- package/dist/common/trigger-config.d.ts +1 -1
- package/dist/common/trigger-contract.d.ts +2 -2
- package/dist/common/trigger-localization.d.ts +1 -1
- package/dist/common/webhook-response.d.ts +1 -3
- package/dist/common/webhook-trigger.d.ts +1 -1
- package/dist/common/webhook-trigger.js +12 -11
- package/dist/common/workflow.d.ts +17 -1
- package/dist/common/workflow.js +68 -22
- package/dist/index.d.ts +6 -3
- package/package.json +11 -6
- package/skills/open-flow/references/flow-authoring.md +1 -0
- package/skills/open-flow/references/flow-n8n-conversion.md +19 -15
- package/src/base/common/json.ts +90 -0
- package/src/canvas/common/commands.ts +15 -0
- package/src/connector/common/actionSchema.ts +168 -0
- package/src/connector/common/proxy.ts +44 -0
- package/src/control/common/api.ts +1506 -0
- package/src/control/common/authoring.ts +923 -0
- package/src/control/common/authoringCondition.ts +110 -0
- package/src/control/common/authoringDiagnosticFields.ts +136 -0
- package/src/control/common/authoringExamples.ts +200 -0
- package/src/control/common/authoringFields.ts +53 -0
- package/src/control/common/authoringLlm.ts +70 -0
- package/src/control/common/authoringOpenApi.ts +129 -0
- package/src/control/common/authoringSchema.ts +410 -0
- package/src/control/common/authoringTools.ts +123 -0
- package/src/control/common/authoringTriggers.ts +26 -0
- package/src/control/common/checkDecoders.ts +65 -0
- package/src/control/common/conformance.ts +1989 -0
- package/src/control/common/connectorDecoders.ts +370 -0
- package/src/control/common/connectorQueries.ts +61 -0
- package/src/control/common/decoding.ts +60 -0
- package/src/control/common/draftOperations.ts +61 -0
- package/src/control/common/errors.ts +114 -0
- package/src/control/common/eventSourceSchemas.ts +13 -0
- package/src/control/common/eventSources.ts +186 -0
- package/src/control/common/flowDecoders.ts +153 -0
- package/src/control/common/flowInspection.ts +181 -0
- package/src/control/common/flowNotifications.ts +37 -0
- package/src/control/common/liveDetails.ts +124 -0
- package/src/control/common/mcp.ts +241 -0
- package/src/control/common/mcpConformance.ts +142 -0
- package/src/control/common/providerAccess.ts +28 -0
- package/src/control/common/providerIconSprite.ts +42 -0
- package/src/control/common/publicationDecoders.ts +98 -0
- package/src/control/common/random.ts +16 -0
- package/src/control/common/requests.ts +112 -0
- package/src/control/common/resultQuery.ts +8 -0
- package/src/control/common/results.ts +176 -0
- package/src/control/common/revisionDecoders.ts +52 -0
- package/src/control/common/runDecoders.ts +240 -0
- package/src/control/common/triggerCatalog.ts +89 -0
- package/src/control/common/triggerDecoders.ts +175 -0
- package/src/decision/common/decision.ts +168 -0
- package/src/event-source/common/catalog.generated.json +65 -0
- package/src/event-source/common/definition.ts +66 -0
- package/src/event-source/common/index.ts +99 -0
- package/src/execution/common/checkpoint.ts +311 -0
- package/src/execution/common/dependencies.ts +440 -0
- package/src/execution/common/engineContract.ts +84 -0
- package/src/execution/common/events.ts +331 -0
- package/src/execution/common/node-execution.ts +469 -0
- package/src/execution/common/runLifecycle.ts +250 -0
- package/src/execution/common/runtime.ts +563 -0
- package/src/execution/common/scheduler.ts +697 -0
- package/src/execution/common/wait.ts +36 -0
- package/src/flow/common/agent.ts +305 -0
- package/src/flow/common/authoring.ts +30 -0
- package/src/flow/common/change.ts +1037 -0
- package/src/flow/common/changeSchema.ts +792 -0
- package/src/flow/common/codePermissions.ts +2 -0
- package/src/flow/common/condition.ts +265 -0
- package/src/flow/common/connectionUsage.ts +131 -0
- package/src/flow/common/edgeChanges.ts +35 -0
- package/src/flow/common/encoding.ts +437 -0
- package/src/flow/common/errorHandling.ts +34 -0
- package/src/flow/common/graph.ts +898 -0
- package/src/flow/common/inputValue.ts +16 -0
- package/src/flow/common/json.ts +8 -0
- package/src/flow/common/moduleChanges.ts +31 -0
- package/src/flow/common/modules.ts +292 -0
- package/src/flow/common/nodeChanges.ts +762 -0
- package/src/flow/common/portChanges.ts +36 -0
- package/src/flow/common/promptTemplate.ts +15 -0
- package/src/flow/common/retry.ts +20 -0
- package/src/flow/common/schema.ts +162 -0
- package/src/flow/common/schemaCompare.ts +176 -0
- package/src/flow/common/schemaComparer.ts +178 -0
- package/src/flow/common/schemaKeywords.ts +53 -0
- package/src/flow/common/semantics.ts +531 -0
- package/src/flow/common/sourceField.ts +35 -0
- package/src/flow/common/triggerScheduleSchema.ts +8 -0
- package/src/flow/common/wait.ts +30 -0
- package/src/flow/common/webhookMethod.ts +7 -0
- package/src/flow/common/webhookResponse.ts +71 -0
- package/src/flow/common/workflowFile.ts +97 -0
- package/src/http/common/authBindings.ts +12 -0
- package/src/http/common/headers.ts +5 -0
- package/src/http/common/httpRequest.ts +251 -0
- package/src/json-schema-subset/checker/array.ts +142 -0
- package/src/json-schema-subset/checker/cache.ts +57 -0
- package/src/json-schema-subset/checker/checker.ts +230 -0
- package/src/json-schema-subset/checker/enumAndConst.ts +113 -0
- package/src/json-schema-subset/checker/equals.ts +93 -0
- package/src/json-schema-subset/checker/numeric/checker.ts +50 -0
- package/src/json-schema-subset/checker/numeric/float.ts +121 -0
- package/src/json-schema-subset/checker/numeric/index.ts +1 -0
- package/src/json-schema-subset/checker/numeric/integer.ts +119 -0
- package/src/json-schema-subset/checker/numeric/integerNormalizer.ts +72 -0
- package/src/json-schema-subset/checker/object.ts +354 -0
- package/src/json-schema-subset/checker/range.ts +91 -0
- package/src/json-schema-subset/checker/string.ts +60 -0
- package/src/json-schema-subset/checker/tools/index.ts +3 -0
- package/src/json-schema-subset/checker/tools/mark.ts +82 -0
- package/src/json-schema-subset/checker/tools/quantum.ts +106 -0
- package/src/json-schema-subset/checker/tools/range.ts +210 -0
- package/src/json-schema-subset/checker/validator.ts +23 -0
- package/src/json-schema-subset/compiler/array.ts +163 -0
- package/src/json-schema-subset/compiler/combination.ts +109 -0
- package/src/json-schema-subset/compiler/common.ts +99 -0
- package/src/json-schema-subset/compiler/compiler.ts +188 -0
- package/src/json-schema-subset/compiler/enumAndConst.ts +75 -0
- package/src/json-schema-subset/compiler/index.ts +11 -0
- package/src/json-schema-subset/compiler/object.ts +411 -0
- package/src/json-schema-subset/compiler/primitive.ts +144 -0
- package/src/json-schema-subset/compiler/utils.ts +24 -0
- package/src/json-schema-subset/compiler/wrapper.ts +192 -0
- package/src/json-schema-subset/error.ts +55 -0
- package/src/json-schema-subset/expression/calculator.ts +442 -0
- package/src/json-schema-subset/expression/combination.ts +49 -0
- package/src/json-schema-subset/expression/expression.ts +191 -0
- package/src/json-schema-subset/expression/index.ts +25 -0
- package/src/json-schema-subset/expression/result.ts +88 -0
- package/src/json-schema-subset/expression/types.ts +36 -0
- package/src/json-schema-subset/extends/extendsContext.ts +89 -0
- package/src/json-schema-subset/extends/index.ts +2 -0
- package/src/json-schema-subset/extends/types.ts +12 -0
- package/src/json-schema-subset/global.ts +60 -0
- package/src/json-schema-subset/index.ts +8 -0
- package/src/json-schema-subset/preprocessing.ts +74 -0
- package/src/json-schema-subset/types.ts +8 -0
- package/src/json-schema-subset/utils.ts +95 -0
- package/src/localization/common/languages.ts +118 -0
- package/src/localization/common/timeZone.ts +25 -0
- package/src/openapi/common/openapi.ts +459 -0
- package/src/trigger/common/config.ts +56 -0
- package/src/trigger/common/configOptions.ts +15 -0
- package/src/trigger/common/configSchema.ts +8 -0
- package/src/trigger/common/contract.ts +132 -0
- package/src/trigger/common/cron.ts +151 -0
- package/src/trigger/common/integration.ts +498 -0
- package/src/trigger/common/poll.ts +187 -0
- package/src/trigger/common/webhook.ts +413 -0
- package/src/trigger/providers/airtable/locales/fr.json +18 -0
- package/src/trigger/providers/airtable/locales/ja.json +18 -0
- package/src/trigger/providers/airtable/locales/ko.json +18 -0
- package/src/trigger/providers/airtable/locales/ru.json +18 -0
- package/src/trigger/providers/airtable/locales/zh-CN.json +18 -0
- package/src/trigger/providers/airtable/locales/zh-TW.json +18 -0
- package/src/trigger/providers/asana/locales/fr.json +15 -0
- package/src/trigger/providers/asana/locales/ja.json +15 -0
- package/src/trigger/providers/asana/locales/ko.json +15 -0
- package/src/trigger/providers/asana/locales/ru.json +15 -0
- package/src/trigger/providers/asana/locales/zh-CN.json +15 -0
- package/src/trigger/providers/asana/locales/zh-TW.json +15 -0
- package/src/trigger/providers/calendly/locales/fr.json +16 -0
- package/src/trigger/providers/calendly/locales/ja.json +16 -0
- package/src/trigger/providers/calendly/locales/ko.json +16 -0
- package/src/trigger/providers/calendly/locales/ru.json +16 -0
- package/src/trigger/providers/calendly/locales/zh-CN.json +16 -0
- package/src/trigger/providers/calendly/locales/zh-TW.json +16 -0
- package/src/trigger/providers/catalog.generated.json +4996 -0
- package/src/trigger/providers/clickup/locales/fr.json +16 -0
- package/src/trigger/providers/clickup/locales/ja.json +16 -0
- package/src/trigger/providers/clickup/locales/ko.json +16 -0
- package/src/trigger/providers/clickup/locales/ru.json +16 -0
- package/src/trigger/providers/clickup/locales/zh-CN.json +16 -0
- package/src/trigger/providers/clickup/locales/zh-TW.json +16 -0
- package/src/trigger/providers/definitions.ts +19 -0
- package/src/trigger/providers/feishu/locales/fr.json +20 -0
- package/src/trigger/providers/feishu/locales/ja.json +20 -0
- package/src/trigger/providers/feishu/locales/ko.json +20 -0
- package/src/trigger/providers/feishu/locales/ru.json +20 -0
- package/src/trigger/providers/feishu/locales/zh-CN.json +20 -0
- package/src/trigger/providers/feishu/locales/zh-TW.json +20 -0
- package/src/trigger/providers/fieldDescriptions.ts +392 -0
- package/src/trigger/providers/fieldLabels.ts +256 -0
- package/src/trigger/providers/fireflies/locales/fr.json +17 -0
- package/src/trigger/providers/fireflies/locales/ja.json +17 -0
- package/src/trigger/providers/fireflies/locales/ko.json +17 -0
- package/src/trigger/providers/fireflies/locales/ru.json +17 -0
- package/src/trigger/providers/fireflies/locales/zh-CN.json +17 -0
- package/src/trigger/providers/fireflies/locales/zh-TW.json +17 -0
- package/src/trigger/providers/github/locales/fr.json +30 -0
- package/src/trigger/providers/github/locales/ja.json +30 -0
- package/src/trigger/providers/github/locales/ko.json +30 -0
- package/src/trigger/providers/github/locales/ru.json +30 -0
- package/src/trigger/providers/github/locales/zh-CN.json +30 -0
- package/src/trigger/providers/github/locales/zh-TW.json +30 -0
- package/src/trigger/providers/gitlab/locales/fr.json +18 -0
- package/src/trigger/providers/gitlab/locales/ja.json +18 -0
- package/src/trigger/providers/gitlab/locales/ko.json +18 -0
- package/src/trigger/providers/gitlab/locales/ru.json +18 -0
- package/src/trigger/providers/gitlab/locales/zh-CN.json +18 -0
- package/src/trigger/providers/gitlab/locales/zh-TW.json +18 -0
- package/src/trigger/providers/gmail/locales/fr.json +18 -0
- package/src/trigger/providers/gmail/locales/ja.json +18 -0
- package/src/trigger/providers/gmail/locales/ko.json +18 -0
- package/src/trigger/providers/gmail/locales/ru.json +18 -0
- package/src/trigger/providers/gmail/locales/zh-CN.json +18 -0
- package/src/trigger/providers/gmail/locales/zh-TW.json +18 -0
- package/src/trigger/providers/google-calendar/locales/fr.json +15 -0
- package/src/trigger/providers/google-calendar/locales/ja.json +15 -0
- package/src/trigger/providers/google-calendar/locales/ko.json +15 -0
- package/src/trigger/providers/google-calendar/locales/ru.json +15 -0
- package/src/trigger/providers/google-calendar/locales/zh-CN.json +15 -0
- package/src/trigger/providers/google-calendar/locales/zh-TW.json +15 -0
- package/src/trigger/providers/google-drive/locales/fr.json +48 -0
- package/src/trigger/providers/google-drive/locales/ja.json +48 -0
- package/src/trigger/providers/google-drive/locales/ko.json +48 -0
- package/src/trigger/providers/google-drive/locales/ru.json +48 -0
- package/src/trigger/providers/google-drive/locales/zh-CN.json +48 -0
- package/src/trigger/providers/google-drive/locales/zh-TW.json +48 -0
- package/src/trigger/providers/google-sheets/locales/fr.json +19 -0
- package/src/trigger/providers/google-sheets/locales/ja.json +19 -0
- package/src/trigger/providers/google-sheets/locales/ko.json +19 -0
- package/src/trigger/providers/google-sheets/locales/ru.json +19 -0
- package/src/trigger/providers/google-sheets/locales/zh-CN.json +19 -0
- package/src/trigger/providers/google-sheets/locales/zh-TW.json +19 -0
- package/src/trigger/providers/intercom/locales/fr.json +17 -0
- package/src/trigger/providers/intercom/locales/ja.json +17 -0
- package/src/trigger/providers/intercom/locales/ko.json +17 -0
- package/src/trigger/providers/intercom/locales/ru.json +17 -0
- package/src/trigger/providers/intercom/locales/zh-CN.json +17 -0
- package/src/trigger/providers/intercom/locales/zh-TW.json +17 -0
- package/src/trigger/providers/jira/locales/fr.json +17 -0
- package/src/trigger/providers/jira/locales/ja.json +17 -0
- package/src/trigger/providers/jira/locales/ko.json +17 -0
- package/src/trigger/providers/jira/locales/ru.json +17 -0
- package/src/trigger/providers/jira/locales/zh-CN.json +17 -0
- package/src/trigger/providers/jira/locales/zh-TW.json +17 -0
- package/src/trigger/providers/linear/locales/fr.json +13 -0
- package/src/trigger/providers/linear/locales/ja.json +13 -0
- package/src/trigger/providers/linear/locales/ko.json +13 -0
- package/src/trigger/providers/linear/locales/ru.json +13 -0
- package/src/trigger/providers/linear/locales/zh-CN.json +13 -0
- package/src/trigger/providers/linear/locales/zh-TW.json +13 -0
- package/src/trigger/providers/locales/fr.ts +71 -0
- package/src/trigger/providers/locales/ja.ts +71 -0
- package/src/trigger/providers/locales/ko.ts +71 -0
- package/src/trigger/providers/locales/ru.ts +71 -0
- package/src/trigger/providers/locales/zh-CN.ts +71 -0
- package/src/trigger/providers/locales/zh-TW.ts +71 -0
- package/src/trigger/providers/localization.ts +59 -0
- package/src/trigger/providers/notion/locales/fr.json +16 -0
- package/src/trigger/providers/notion/locales/ja.json +16 -0
- package/src/trigger/providers/notion/locales/ko.json +16 -0
- package/src/trigger/providers/notion/locales/ru.json +16 -0
- package/src/trigger/providers/notion/locales/zh-CN.json +16 -0
- package/src/trigger/providers/notion/locales/zh-TW.json +16 -0
- package/src/trigger/providers/one-drive/locales/fr.json +16 -0
- package/src/trigger/providers/one-drive/locales/ja.json +16 -0
- package/src/trigger/providers/one-drive/locales/ko.json +16 -0
- package/src/trigger/providers/one-drive/locales/ru.json +16 -0
- package/src/trigger/providers/one-drive/locales/zh-CN.json +16 -0
- package/src/trigger/providers/one-drive/locales/zh-TW.json +16 -0
- package/src/trigger/providers/outlook/locales/fr.json +18 -0
- package/src/trigger/providers/outlook/locales/ja.json +18 -0
- package/src/trigger/providers/outlook/locales/ko.json +18 -0
- package/src/trigger/providers/outlook/locales/ru.json +18 -0
- package/src/trigger/providers/outlook/locales/zh-CN.json +18 -0
- package/src/trigger/providers/outlook/locales/zh-TW.json +18 -0
- package/src/trigger/providers/pandadoc/locales/fr.json +12 -0
- package/src/trigger/providers/pandadoc/locales/ja.json +12 -0
- package/src/trigger/providers/pandadoc/locales/ko.json +12 -0
- package/src/trigger/providers/pandadoc/locales/ru.json +12 -0
- package/src/trigger/providers/pandadoc/locales/zh-CN.json +12 -0
- package/src/trigger/providers/pandadoc/locales/zh-TW.json +12 -0
- package/src/trigger/providers/pipedrive/locales/fr.json +15 -0
- package/src/trigger/providers/pipedrive/locales/ja.json +15 -0
- package/src/trigger/providers/pipedrive/locales/ko.json +15 -0
- package/src/trigger/providers/pipedrive/locales/ru.json +15 -0
- package/src/trigger/providers/pipedrive/locales/zh-CN.json +15 -0
- package/src/trigger/providers/pipedrive/locales/zh-TW.json +15 -0
- package/src/trigger/providers/remote.ts +163 -0
- package/src/trigger/providers/resend/locales/fr.json +16 -0
- package/src/trigger/providers/resend/locales/ja.json +16 -0
- package/src/trigger/providers/resend/locales/ko.json +16 -0
- package/src/trigger/providers/resend/locales/ru.json +16 -0
- package/src/trigger/providers/resend/locales/zh-CN.json +16 -0
- package/src/trigger/providers/resend/locales/zh-TW.json +16 -0
- package/src/trigger/providers/sentry/locales/fr.json +19 -0
- package/src/trigger/providers/sentry/locales/ja.json +19 -0
- package/src/trigger/providers/sentry/locales/ko.json +19 -0
- package/src/trigger/providers/sentry/locales/ru.json +19 -0
- package/src/trigger/providers/sentry/locales/zh-CN.json +19 -0
- package/src/trigger/providers/sentry/locales/zh-TW.json +19 -0
- package/src/trigger/providers/shopify/locales/fr.json +18 -0
- package/src/trigger/providers/shopify/locales/ja.json +18 -0
- package/src/trigger/providers/shopify/locales/ko.json +18 -0
- package/src/trigger/providers/shopify/locales/ru.json +18 -0
- package/src/trigger/providers/shopify/locales/zh-CN.json +18 -0
- package/src/trigger/providers/shopify/locales/zh-TW.json +18 -0
- package/src/trigger/providers/slack/locales/fr.json +18 -0
- package/src/trigger/providers/slack/locales/ja.json +18 -0
- package/src/trigger/providers/slack/locales/ko.json +18 -0
- package/src/trigger/providers/slack/locales/ru.json +18 -0
- package/src/trigger/providers/slack/locales/zh-CN.json +18 -0
- package/src/trigger/providers/slack/locales/zh-TW.json +18 -0
- package/src/trigger/providers/slackbot/locales/fr.json +23 -0
- package/src/trigger/providers/slackbot/locales/ja.json +23 -0
- package/src/trigger/providers/slackbot/locales/ko.json +23 -0
- package/src/trigger/providers/slackbot/locales/ru.json +23 -0
- package/src/trigger/providers/slackbot/locales/zh-CN.json +23 -0
- package/src/trigger/providers/slackbot/locales/zh-TW.json +23 -0
- package/src/trigger/providers/source-events.ts +25 -0
- package/src/trigger/providers/stripe/locales/fr.json +17 -0
- package/src/trigger/providers/stripe/locales/ja.json +17 -0
- package/src/trigger/providers/stripe/locales/ko.json +17 -0
- package/src/trigger/providers/stripe/locales/ru.json +17 -0
- package/src/trigger/providers/stripe/locales/zh-CN.json +17 -0
- package/src/trigger/providers/stripe/locales/zh-TW.json +17 -0
- package/src/trigger/providers/tally/locales/fr.json +12 -0
- package/src/trigger/providers/tally/locales/ja.json +12 -0
- package/src/trigger/providers/tally/locales/ko.json +12 -0
- package/src/trigger/providers/tally/locales/ru.json +12 -0
- package/src/trigger/providers/tally/locales/zh-CN.json +12 -0
- package/src/trigger/providers/tally/locales/zh-TW.json +12 -0
- package/src/trigger/providers/telegram/locales/fr.json +17 -0
- package/src/trigger/providers/telegram/locales/ja.json +17 -0
- package/src/trigger/providers/telegram/locales/ko.json +17 -0
- package/src/trigger/providers/telegram/locales/ru.json +17 -0
- package/src/trigger/providers/telegram/locales/zh-CN.json +17 -0
- package/src/trigger/providers/telegram/locales/zh-TW.json +17 -0
- package/src/trigger/providers/typeform/locales/fr.json +12 -0
- package/src/trigger/providers/typeform/locales/ja.json +12 -0
- package/src/trigger/providers/typeform/locales/ko.json +12 -0
- package/src/trigger/providers/typeform/locales/ru.json +12 -0
- package/src/trigger/providers/typeform/locales/zh-CN.json +12 -0
- package/src/trigger/providers/typeform/locales/zh-TW.json +12 -0
- package/src/trigger/providers/vercel/locales/fr.json +18 -0
- package/src/trigger/providers/vercel/locales/ja.json +18 -0
- package/src/trigger/providers/vercel/locales/ko.json +18 -0
- package/src/trigger/providers/vercel/locales/ru.json +18 -0
- package/src/trigger/providers/vercel/locales/zh-CN.json +18 -0
- package/src/trigger/providers/vercel/locales/zh-TW.json +18 -0
- package/src/trigger/providers/woocommerce/locales/fr.json +19 -0
- package/src/trigger/providers/woocommerce/locales/ja.json +19 -0
- package/src/trigger/providers/woocommerce/locales/ko.json +19 -0
- package/src/trigger/providers/woocommerce/locales/ru.json +19 -0
- package/src/trigger/providers/woocommerce/locales/zh-CN.json +19 -0
- package/src/trigger/providers/woocommerce/locales/zh-TW.json +19 -0
- package/src/trigger/providers/zendesk/locales/fr.json +15 -0
- package/src/trigger/providers/zendesk/locales/ja.json +15 -0
- package/src/trigger/providers/zendesk/locales/ko.json +15 -0
- package/src/trigger/providers/zendesk/locales/ru.json +15 -0
- package/src/trigger/providers/zendesk/locales/zh-CN.json +15 -0
- package/src/trigger/providers/zendesk/locales/zh-TW.json +15 -0
- package/src/trigger/providers/zoom/locales/fr.json +17 -0
- package/src/trigger/providers/zoom/locales/ja.json +17 -0
- package/src/trigger/providers/zoom/locales/ko.json +17 -0
- package/src/trigger/providers/zoom/locales/ru.json +17 -0
- package/src/trigger/providers/zoom/locales/zh-CN.json +17 -0
- package/src/trigger/providers/zoom/locales/zh-TW.json +17 -0
- package/src/types/index.ts +112 -0
- package/src/workflow/common/workflow.ts +273 -0
- package/dist/browser/lib-DrKav3HG.js +0 -11403
- /package/dist/{browser → common}/flow-authoring-edge.d.ts +0 -0
- /package/dist/{browser → common}/flow-authoring-module.d.ts +0 -0
- /package/dist/{browser → common}/flow-authoring.d.ts +0 -0
- /package/dist/{browser → common}/flow-input-value.d.ts +0 -0
- /package/dist/{browser → common}/webhook-method.d.ts +0 -0
|
@@ -12285,14 +12285,186 @@ function decisionTask(questions = [defaultDecisionQuestion()], name = "AI Decisi
|
|
|
12285
12285
|
};
|
|
12286
12286
|
}
|
|
12287
12287
|
//#endregion
|
|
12288
|
-
//#region src/
|
|
12288
|
+
//#region src/http/common/authBindings.ts
|
|
12289
12289
|
/** Never allow credentials to enter a Revision as literal node inputs. */
|
|
12290
|
-
function
|
|
12290
|
+
function assertHttpAuthBindings(document) {
|
|
12291
12291
|
for (const node of Object.values(document.graph.nodes)) {
|
|
12292
|
-
if (node.kind != "task" || !("executor" in node.task) || node.task.executor.kind
|
|
12293
|
-
for (const [handle, mapping] of Object.entries(node.inputs)) if (handle.startsWith("auth.") && mapping.kind == "value") throw new TypeError("
|
|
12292
|
+
if (node.kind != "task" || !("executor" in node.task) || !["openapi", "http-request"].includes(node.task.executor.kind)) continue;
|
|
12293
|
+
for (const [handle, mapping] of Object.entries(node.inputs)) if (handle.startsWith("auth.") && mapping.kind == "value") throw new TypeError("HTTP authentication accepts deployment variables and upstream outputs only.");
|
|
12294
12294
|
}
|
|
12295
12295
|
}
|
|
12296
|
+
//#endregion
|
|
12297
|
+
//#region src/flow/common/portChanges.ts
|
|
12298
|
+
function renamedPort(previous, next) {
|
|
12299
|
+
const previousNames = new Set(previous.flatMap((port) => "handle" in port ? [port.handle] : []));
|
|
12300
|
+
const nextNames = new Set(next.flatMap((port) => "handle" in port ? [port.handle] : []));
|
|
12301
|
+
const removed = [...previousNames].filter((name) => !nextNames.has(name));
|
|
12302
|
+
const added = [...nextNames].filter((name) => !previousNames.has(name));
|
|
12303
|
+
return removed.length == 1 && added.length == 1 ? [removed[0], added[0]] : void 0;
|
|
12304
|
+
}
|
|
12305
|
+
function renameOutputMapping(mapping, nodeIds, rename) {
|
|
12306
|
+
if (rename == null || mapping.kind != "sources") return mapping;
|
|
12307
|
+
const sources = mapping.sources.map((source) => source.kind == "node" && !source.system && nodeIds.has(source.nodeId) && source.output == rename[0] ? {
|
|
12308
|
+
...source,
|
|
12309
|
+
output: rename[1]
|
|
12310
|
+
} : source);
|
|
12311
|
+
return sources.every((source, index) => source === mapping.sources[index]) ? mapping : {
|
|
12312
|
+
kind: "sources",
|
|
12313
|
+
sources
|
|
12314
|
+
};
|
|
12315
|
+
}
|
|
12316
|
+
/** Carry saved mappings through a field rename and remove only fields absent from the new contract. */
|
|
12317
|
+
function remapInputMappings(mappings, ports, rename) {
|
|
12318
|
+
const inputs = { ...mappings };
|
|
12319
|
+
if (rename != null && Object.hasOwn(inputs, rename[0])) {
|
|
12320
|
+
Object.defineProperty(inputs, rename[1], {
|
|
12321
|
+
value: inputs[rename[0]],
|
|
12322
|
+
enumerable: true,
|
|
12323
|
+
configurable: true,
|
|
12324
|
+
writable: true
|
|
12325
|
+
});
|
|
12326
|
+
delete inputs[rename[0]];
|
|
12327
|
+
}
|
|
12328
|
+
const names = new Set(ports.flatMap((port) => "handle" in port ? [port.handle] : []));
|
|
12329
|
+
for (const name of Object.keys(inputs)) if (!names.has(name)) delete inputs[name];
|
|
12330
|
+
return inputs;
|
|
12331
|
+
}
|
|
12332
|
+
//#endregion
|
|
12333
|
+
//#region src/http/common/httpRequest.ts
|
|
12334
|
+
var parameterSchema = strictObject({
|
|
12335
|
+
mode: _enum(["fields", "object"]).default("fields"),
|
|
12336
|
+
names: array(string()).default([])
|
|
12337
|
+
});
|
|
12338
|
+
var httpRequestConfigSchema = strictObject({
|
|
12339
|
+
method: _enum([
|
|
12340
|
+
"GET",
|
|
12341
|
+
"POST",
|
|
12342
|
+
"PUT",
|
|
12343
|
+
"PATCH",
|
|
12344
|
+
"DELETE",
|
|
12345
|
+
"HEAD",
|
|
12346
|
+
"OPTIONS"
|
|
12347
|
+
]).default("GET"),
|
|
12348
|
+
query: parameterSchema.default({
|
|
12349
|
+
mode: "fields",
|
|
12350
|
+
names: []
|
|
12351
|
+
}),
|
|
12352
|
+
headers: parameterSchema.default({
|
|
12353
|
+
mode: "fields",
|
|
12354
|
+
names: []
|
|
12355
|
+
}),
|
|
12356
|
+
bodyFormat: _enum([
|
|
12357
|
+
"none",
|
|
12358
|
+
"json",
|
|
12359
|
+
"text",
|
|
12360
|
+
"form"
|
|
12361
|
+
]).default("none"),
|
|
12362
|
+
authentication: union([
|
|
12363
|
+
strictObject({ type: literal("none") }),
|
|
12364
|
+
strictObject({ type: _enum(["bearer", "basic"]) }),
|
|
12365
|
+
strictObject({
|
|
12366
|
+
type: literal("apiKey"),
|
|
12367
|
+
name: string(),
|
|
12368
|
+
in: _enum(["header", "query"])
|
|
12369
|
+
})
|
|
12370
|
+
]).default({ type: "none" }),
|
|
12371
|
+
responseFormat: _enum([
|
|
12372
|
+
"auto",
|
|
12373
|
+
"json",
|
|
12374
|
+
"text"
|
|
12375
|
+
]).default("auto"),
|
|
12376
|
+
statusPolicy: _enum(["success", "all"]).default("success")
|
|
12377
|
+
});
|
|
12378
|
+
var httpRequestExecutorSchema = httpRequestConfigSchema.extend({ kind: literal("http-request") });
|
|
12379
|
+
var scalarSchema = { type: [
|
|
12380
|
+
"string",
|
|
12381
|
+
"number",
|
|
12382
|
+
"boolean"
|
|
12383
|
+
] };
|
|
12384
|
+
var queryValueSchema = { anyOf: [scalarSchema, {
|
|
12385
|
+
type: "array",
|
|
12386
|
+
items: scalarSchema
|
|
12387
|
+
}] };
|
|
12388
|
+
var httpHeaderSchema = {
|
|
12389
|
+
type: "object",
|
|
12390
|
+
additionalProperties: { type: "string" }
|
|
12391
|
+
};
|
|
12392
|
+
var httpQuerySchema = {
|
|
12393
|
+
type: "object",
|
|
12394
|
+
additionalProperties: queryValueSchema
|
|
12395
|
+
};
|
|
12396
|
+
function httpAuthHandles(config) {
|
|
12397
|
+
return config.authentication.type == "none" ? [] : config.authentication.type == "basic" ? ["auth.username", "auth.password"] : ["auth.token"];
|
|
12398
|
+
}
|
|
12399
|
+
function retain(ports, old) {
|
|
12400
|
+
const remaining = new Map(ports.map((port) => [port.handle, port]));
|
|
12401
|
+
return [...old.flatMap((item) => {
|
|
12402
|
+
if ("group" in item) return [item];
|
|
12403
|
+
const next = remaining.get(item.handle);
|
|
12404
|
+
if (next == null) return [];
|
|
12405
|
+
remaining.delete(item.handle);
|
|
12406
|
+
return [dequal(item.jsonSchema, next.jsonSchema) && item.nullable == next.nullable ? item : next];
|
|
12407
|
+
}), ...remaining.values()];
|
|
12408
|
+
}
|
|
12409
|
+
function httpRequestTask(config = httpRequestConfigSchema.parse({}), name = "HTTP Request", previous) {
|
|
12410
|
+
const inputs = [{
|
|
12411
|
+
handle: "url",
|
|
12412
|
+
jsonSchema: { type: "string" },
|
|
12413
|
+
nullable: false
|
|
12414
|
+
}];
|
|
12415
|
+
for (const group of ["query", "headers"]) if (config[group].mode == "object") inputs.push({
|
|
12416
|
+
handle: group,
|
|
12417
|
+
jsonSchema: group == "query" ? httpQuerySchema : httpHeaderSchema,
|
|
12418
|
+
nullable: true
|
|
12419
|
+
});
|
|
12420
|
+
else for (const parameterName of config[group].names.filter((value) => value.trim())) inputs.push({
|
|
12421
|
+
handle: `${group == "query" ? "query" : "header"}.${parameterName}`,
|
|
12422
|
+
jsonSchema: group == "query" ? queryValueSchema : { type: "string" },
|
|
12423
|
+
nullable: true
|
|
12424
|
+
});
|
|
12425
|
+
if (config.bodyFormat != "none") inputs.push({
|
|
12426
|
+
handle: "body",
|
|
12427
|
+
jsonSchema: config.bodyFormat == "json" ? {} : config.bodyFormat == "text" ? { type: "string" } : httpQuerySchema,
|
|
12428
|
+
nullable: config.bodyFormat == "json"
|
|
12429
|
+
});
|
|
12430
|
+
inputs.push(...httpAuthHandles(config).map((handle) => ({
|
|
12431
|
+
handle,
|
|
12432
|
+
jsonSchema: { type: "string" },
|
|
12433
|
+
nullable: false
|
|
12434
|
+
})));
|
|
12435
|
+
const outputs = [
|
|
12436
|
+
{
|
|
12437
|
+
handle: "body",
|
|
12438
|
+
jsonSchema: config.responseFormat == "text" ? { type: "string" } : {},
|
|
12439
|
+
nullable: true
|
|
12440
|
+
},
|
|
12441
|
+
{
|
|
12442
|
+
handle: "statusCode",
|
|
12443
|
+
jsonSchema: { type: "integer" },
|
|
12444
|
+
nullable: false
|
|
12445
|
+
},
|
|
12446
|
+
{
|
|
12447
|
+
handle: "headers",
|
|
12448
|
+
jsonSchema: httpHeaderSchema,
|
|
12449
|
+
nullable: false
|
|
12450
|
+
}
|
|
12451
|
+
];
|
|
12452
|
+
return {
|
|
12453
|
+
name,
|
|
12454
|
+
executor: {
|
|
12455
|
+
...config,
|
|
12456
|
+
kind: "http-request"
|
|
12457
|
+
},
|
|
12458
|
+
inputs: retain(inputs, previous?.inputs ?? []),
|
|
12459
|
+
outputs: retain(outputs, previous?.outputs ?? [])
|
|
12460
|
+
};
|
|
12461
|
+
}
|
|
12462
|
+
/** Only a named parameter rename carries a value; changing source modes is not a rename. */
|
|
12463
|
+
function httpRequestInputs(mappings, previous, next) {
|
|
12464
|
+
const candidate = renamedPort(previous.inputs, next.inputs);
|
|
12465
|
+
const rename = candidate != null && ["query.", "header."].some((prefix) => candidate.every((name) => name.startsWith(prefix))) ? candidate : void 0;
|
|
12466
|
+
return remapInputMappings(mappings, next.inputs, rename);
|
|
12467
|
+
}
|
|
12296
12468
|
function checkJsonDepth(value, depth = 0) {
|
|
12297
12469
|
if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
|
|
12298
12470
|
if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
|
|
@@ -12303,6 +12475,7 @@ var retryNodeTypes = [
|
|
|
12303
12475
|
"code",
|
|
12304
12476
|
"connector",
|
|
12305
12477
|
"openapi",
|
|
12478
|
+
"http-request",
|
|
12306
12479
|
"llm",
|
|
12307
12480
|
"decision"
|
|
12308
12481
|
];
|
|
@@ -12452,7 +12625,7 @@ var ports = {
|
|
|
12452
12625
|
inputs: array(union([input, group])),
|
|
12453
12626
|
outputs: array(union([port, group]))
|
|
12454
12627
|
};
|
|
12455
|
-
var
|
|
12628
|
+
var connectorCapabilitySchema = union([
|
|
12456
12629
|
strictObject({
|
|
12457
12630
|
kind: literal("connector"),
|
|
12458
12631
|
action: text$1,
|
|
@@ -12484,6 +12657,15 @@ var capability = union([
|
|
|
12484
12657
|
})).optional()
|
|
12485
12658
|
})
|
|
12486
12659
|
]);
|
|
12660
|
+
var workflowCapabilitySchema = strictObject({
|
|
12661
|
+
kind: literal("workflow"),
|
|
12662
|
+
name: text$1,
|
|
12663
|
+
flowId: text$1,
|
|
12664
|
+
revisionId: text$1,
|
|
12665
|
+
inputs: array(port),
|
|
12666
|
+
outputs: array(port).nullable()
|
|
12667
|
+
});
|
|
12668
|
+
var capability = union([connectorCapabilitySchema, workflowCapabilitySchema]);
|
|
12487
12669
|
var inline = object$1({
|
|
12488
12670
|
...ports,
|
|
12489
12671
|
name: text$1,
|
|
@@ -12498,6 +12680,20 @@ var agentValue = union([object$1({
|
|
|
12498
12680
|
input: text$1
|
|
12499
12681
|
})]);
|
|
12500
12682
|
var agentInput = union([agentValue, object$1({ kind: literal("model") })]);
|
|
12683
|
+
var agentToolFields = {
|
|
12684
|
+
id: text$1,
|
|
12685
|
+
name: text$1,
|
|
12686
|
+
description: text$1,
|
|
12687
|
+
approval: boolean(),
|
|
12688
|
+
inputs: array(input.extend({ source: agentInput }))
|
|
12689
|
+
};
|
|
12690
|
+
var connectorAgentToolSchema = object$1({
|
|
12691
|
+
...agentToolFields,
|
|
12692
|
+
kind: literal("connector").optional(),
|
|
12693
|
+
action: text$1,
|
|
12694
|
+
connectionId: actionConnection.optional()
|
|
12695
|
+
});
|
|
12696
|
+
var workflowAgentToolSchema = workflowCapabilitySchema.extend(agentToolFields);
|
|
12501
12697
|
var decisionQuestion = discriminatedUnion("type", [
|
|
12502
12698
|
strictObject({
|
|
12503
12699
|
name: text$1,
|
|
@@ -12566,15 +12762,7 @@ var managedFields = object$1({
|
|
|
12566
12762
|
model: text$1,
|
|
12567
12763
|
prompt: text$1,
|
|
12568
12764
|
maxRounds: number(),
|
|
12569
|
-
tools: array(
|
|
12570
|
-
id: text$1,
|
|
12571
|
-
name: text$1,
|
|
12572
|
-
description: text$1,
|
|
12573
|
-
action: text$1,
|
|
12574
|
-
connectionId: actionConnection.optional(),
|
|
12575
|
-
approval: boolean(),
|
|
12576
|
-
inputs: array(input.extend({ source: agentInput }))
|
|
12577
|
-
})),
|
|
12765
|
+
tools: array(union([workflowAgentToolSchema, connectorAgentToolSchema])),
|
|
12578
12766
|
notification: object$1({
|
|
12579
12767
|
action: text$1,
|
|
12580
12768
|
connectionId: actionConnection.optional(),
|
|
@@ -12587,7 +12775,8 @@ var managedFields = object$1({
|
|
|
12587
12775
|
kind: literal("workflow"),
|
|
12588
12776
|
flowId: text$1,
|
|
12589
12777
|
revisionId: text$1
|
|
12590
|
-
})
|
|
12778
|
+
}),
|
|
12779
|
+
httpRequestExecutorSchema
|
|
12591
12780
|
])
|
|
12592
12781
|
});
|
|
12593
12782
|
var managed = managedFields.transform(limitDecisionTask);
|
|
@@ -12855,7 +13044,8 @@ var revision = object$1({
|
|
|
12855
13044
|
literal(7),
|
|
12856
13045
|
literal(8),
|
|
12857
13046
|
literal(9),
|
|
12858
|
-
literal(10)
|
|
13047
|
+
literal(10),
|
|
13048
|
+
literal(11)
|
|
12859
13049
|
]),
|
|
12860
13050
|
document,
|
|
12861
13051
|
modules: record$3(text$1, module)
|
|
@@ -12886,7 +13076,7 @@ function decodeRevisionContent(value) {
|
|
|
12886
13076
|
checkJsonDepth(value);
|
|
12887
13077
|
const content = revision.parse(value);
|
|
12888
13078
|
checkModelVersion(content);
|
|
12889
|
-
|
|
13079
|
+
assertHttpAuthBindings(content.document);
|
|
12890
13080
|
return content;
|
|
12891
13081
|
}
|
|
12892
13082
|
var shapes = {
|
|
@@ -13080,6 +13270,8 @@ function changeOperationsSchema(kind) {
|
|
|
13080
13270
|
return toJSONSchema(schema, { io: "input" });
|
|
13081
13271
|
}
|
|
13082
13272
|
function checkModelVersion(content) {
|
|
13273
|
+
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.");
|
|
13274
|
+
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.");
|
|
13083
13275
|
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.");
|
|
13084
13276
|
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.");
|
|
13085
13277
|
if (content.modelVersion < 9 && Object.values(content.document.graph.nodes).some((candidateNode) => {
|
|
@@ -13679,6 +13871,7 @@ var authoringTypes = [
|
|
|
13679
13871
|
"llm",
|
|
13680
13872
|
"decision",
|
|
13681
13873
|
"openapi",
|
|
13874
|
+
"http-request",
|
|
13682
13875
|
"condition",
|
|
13683
13876
|
"value",
|
|
13684
13877
|
"wait",
|
|
@@ -13731,10 +13924,21 @@ var operand = union([
|
|
|
13731
13924
|
system,
|
|
13732
13925
|
variable
|
|
13733
13926
|
]);
|
|
13734
|
-
var
|
|
13927
|
+
var toolSources = record$3(id$1, agentToolFields.inputs.element.shape.source).optional().describe("Tool input sources by name. The platform resolves types from the selected Action or workflow. New inputs default to model-provided; omitted existing sources are preserved.");
|
|
13928
|
+
var agentTool = union([workflowAgentToolSchema.omit({
|
|
13929
|
+
id: true,
|
|
13930
|
+
inputs: true,
|
|
13931
|
+
outputs: true,
|
|
13932
|
+
revisionId: true
|
|
13933
|
+
}).extend({ inputs: toolSources }).strict(), connectorAgentToolSchema.omit({
|
|
13735
13934
|
id: true,
|
|
13736
13935
|
inputs: true
|
|
13737
|
-
}).extend({ inputs:
|
|
13936
|
+
}).extend({ inputs: toolSources }).strict()]);
|
|
13937
|
+
var authoringCapabilities = array(union([connectorCapabilitySchema, strictObject({
|
|
13938
|
+
kind: literal("workflow"),
|
|
13939
|
+
name: id$1,
|
|
13940
|
+
flowId: id$1
|
|
13941
|
+
})]));
|
|
13738
13942
|
var notification = strictObject({
|
|
13739
13943
|
...authoringDefinitionSchemas.connector.shape,
|
|
13740
13944
|
messageHandle: id$1,
|
|
@@ -13790,10 +13994,11 @@ var authoringConfigurations = {
|
|
|
13790
13994
|
"code": strictObject({
|
|
13791
13995
|
inputs: inputFields,
|
|
13792
13996
|
outputs: outputFields,
|
|
13793
|
-
capabilities:
|
|
13997
|
+
capabilities: authoringCapabilities.optional()
|
|
13794
13998
|
}),
|
|
13795
13999
|
"connector": authoringDefinitionSchemas.connector.omit({ outputMode: true }).strict(),
|
|
13796
14000
|
"openapi": authoringOpenApiSchema,
|
|
14001
|
+
"http-request": httpRequestConfigSchema,
|
|
13797
14002
|
"agent": authoringDefinitionSchemas.agent.omit({
|
|
13798
14003
|
prompt: true,
|
|
13799
14004
|
tools: true
|
|
@@ -13854,7 +14059,8 @@ var authoringEditSchema = discriminatedUnion("op", [
|
|
|
13854
14059
|
}),
|
|
13855
14060
|
strictObject({
|
|
13856
14061
|
op: literal("node.refresh"),
|
|
13857
|
-
node: referenceSchema
|
|
14062
|
+
node: referenceSchema,
|
|
14063
|
+
tool: id$1.optional().describe("Name of a workflow tool on an Agent or Code node. Omit for a Call Workflow node.")
|
|
13858
14064
|
}),
|
|
13859
14065
|
strictObject({
|
|
13860
14066
|
op: literal("node.remove"),
|
|
@@ -14041,21 +14247,21 @@ function authoringSchema(kind) {
|
|
|
14041
14247
|
"wait",
|
|
14042
14248
|
"approval"
|
|
14043
14249
|
].includes(kind),
|
|
14044
|
-
guidance: kind == "webhook-response" ? "Prepare an HTTP response using fixed inputs body (any JSON, default empty text), statusCode (number, default 200) and headers (scalar-valued object, default {}). Select this node in Webhook options.responseBody as {kind: \"webhook-response\", nodeId: \"node reference\", timeoutMs: 30000}. Its first completion responds immediately while the Run continues. It has no business outputs. Multiple response nodes are allowed; each Webhook selects one reachable node." : kind == "outputs" ? "Declare output fields through config.outputDefs. Set their values through node.add.inputs or input.set. Outputs is a singleton execution sink; it waits for its predecessors and produces workflow business outputs independently of node logs. No downstream edges or data references to Outputs are allowed." : kind == "webhook" ? "Use options.responseBody: {kind: \"webhook-response\", nodeId: \"node ID or $alias\", timeoutMs: 30000} to respond on the selected node’s first completion while the Run continues. Body, statusCode and headers come exclusively from that node; clear workflow-output-only status/header references when switching. Alternatively configure options.responseBody as {kind: \"workflow-outputs\", output?: \"top-level output name\", timeoutMs?: 30000} to respond after the Run succeeds. Omit output for the complete object. Connect Webhook to Outputs. Timeout is 1000–60000 ms; HTTP timeout does not cancel the Run. Strings return text; other values return JSON. Only in this mode, options.responseStatusCodeOutput can select a numeric top-level workflow output as the HTTP status, overriding the preserved fixed responseStatusCode (default 200). Its runtime value must be an integer from 200 to 599, excluding 204, 205, 304; missing or invalid values return 500. Use responseHeaders for fixed text headers. In workflow-output mode, responseHeaderOutputs maps header names to top-level output names; values can be string, number or boolean and are converted to text. Alternatively responseHeadersSource: {kind: \"workflow-outputs\", output?: \"object field\"} replaces the entire header object (omit output for all outputs), preserving but ignoring per-header settings. Missing, null, complex or invalid header values return 500 without fallback. Header restrictions and Content-Type policy still apply. Omit responseBody for immediate responseData. Clear options.responseBody, options.responseStatusCodeOutput, options.responseHeadersSource and options.responseHeaderOutputs explicitly to switch back." : kind == "start" ? "Declare workflow inputs through config.inputDefs; read them in Start node details. REST calls and manual runs supply them as trigger.outputs. Downstream nodes bind these parameters as Start outputs. Start has no input sources or defaults; non-nullable parameters are required, and omitted nullable parameters become null." : kind == "condition" ? "Edit branch operands through config.branches. A branch can test one expression, all expressions, or any alternatives. Unmatched execution uses branch otherwise." : ["poll", "integration"].includes(kind) ? "Configure static parameters with node.add.inputs or input.set. Definitions come from the selected Trigger key; execution output and variable sources are unavailable." : kind == "llm" ? "Configure model settings, message templates and history as defaults. Input bindings with the same names override these defaults; named business inputs can be bound directly. Template strings interpolate {{name}}." : kind == "openapi" ? "Select an operation; the tool resolves its ports and authentication. Read authenticationChoices from node details. authentication is replaced as a complete choice. Bind advertised credentials through inputs." : kind == "workflow" ? "Select another workflow with config.flowId. A workflow cannot call itself, including in a disconnected node. Owned unpublished or unavailable targets may be saved as incomplete drafts. Use node.refresh to load the current published interface." : "Supply business configuration and input data. Fixed definitions are assembled by the tool. Existing constraints and defaults are preserved on partial updates.",
|
|
14250
|
+
guidance: kind == "webhook-response" ? "Prepare an HTTP response using fixed inputs body (any JSON, default empty text), statusCode (number, default 200) and headers (scalar-valued object, default {}). Select this node in Webhook options.responseBody as {kind: \"webhook-response\", nodeId: \"node reference\", timeoutMs: 30000}. Its first completion responds immediately while the Run continues. It has no business outputs. Multiple response nodes are allowed; each Webhook selects one reachable node." : kind == "outputs" ? "Declare output fields through config.outputDefs. Set their values through node.add.inputs or input.set. Outputs is a singleton execution sink; it waits for its predecessors and produces workflow business outputs independently of node logs. No downstream edges or data references to Outputs are allowed." : kind == "webhook" ? "Use options.responseBody: {kind: \"webhook-response\", nodeId: \"node ID or $alias\", timeoutMs: 30000} to respond on the selected node’s first completion while the Run continues. Body, statusCode and headers come exclusively from that node; clear workflow-output-only status/header references when switching. Alternatively configure options.responseBody as {kind: \"workflow-outputs\", output?: \"top-level output name\", timeoutMs?: 30000} to respond after the Run succeeds. Omit output for the complete object. Connect Webhook to Outputs. Timeout is 1000–60000 ms; HTTP timeout does not cancel the Run. Strings return text; other values return JSON. Only in this mode, options.responseStatusCodeOutput can select a numeric top-level workflow output as the HTTP status, overriding the preserved fixed responseStatusCode (default 200). Its runtime value must be an integer from 200 to 599, excluding 204, 205, 304; missing or invalid values return 500. Use responseHeaders for fixed text headers. In workflow-output mode, responseHeaderOutputs maps header names to top-level output names; values can be string, number or boolean and are converted to text. Alternatively responseHeadersSource: {kind: \"workflow-outputs\", output?: \"object field\"} replaces the entire header object (omit output for all outputs), preserving but ignoring per-header settings. Missing, null, complex or invalid header values return 500 without fallback. Header restrictions and Content-Type policy still apply. Omit responseBody for immediate responseData. Clear options.responseBody, options.responseStatusCodeOutput, options.responseHeadersSource and options.responseHeaderOutputs explicitly to switch back." : kind == "start" ? "Declare workflow inputs through config.inputDefs; read them in Start node details. REST calls and manual runs supply them as trigger.outputs. Downstream nodes bind these parameters as Start outputs. Start has no input sources or defaults; non-nullable parameters are required, and omitted nullable parameters become null." : kind == "condition" ? "Edit branch operands through config.branches. A branch can test one expression, all expressions, or any alternatives. Unmatched execution uses branch otherwise." : ["poll", "integration"].includes(kind) ? "Configure static parameters with node.add.inputs or input.set. Definitions come from the selected Trigger key; execution output and variable sources are unavailable." : kind == "llm" ? "Configure model settings, message templates and history as defaults. Input bindings with the same names override these defaults; named business inputs can be bound directly. Template strings interpolate {{name}}." : kind == "http-request" ? "Configure method, query/headers modes and names, bodyFormat, authentication, responseFormat and statusPolicy. Bind url, query.<name>/header.<name> or whole query/headers objects, body and auth.token (Basic: auth.username/auth.password). Credentials accept variables or upstream outputs only. Outputs: body, statusCode, headers. Authentication is replaced as a complete choice." : kind == "openapi" ? "Select an operation; the tool resolves its ports and authentication. Read authenticationChoices from node details. authentication is replaced as a complete choice. Bind advertised credentials through inputs." : kind == "workflow" ? "Select another workflow with config.flowId. A workflow cannot call itself, including in a disconnected node. Owned unpublished or unavailable targets may be saved as incomplete drafts. Use node.refresh to load the current published interface." : kind == "agent" ? "Tools accept Connector Actions or {kind: \"workflow\", flowId, name, description, approval, inputs}. Workflow parameter sources use model, input or value. The platform derives the interface. Refresh a workflow tool with node.refresh and tool: its name." : kind == "code" ? "Select workflows through config.capabilities: [{kind: \"workflow\", flowId, name}]. Call context.workflows.call(name, input) and await its business output. The platform derives input/output types. Refresh a selected workflow tool with node.refresh and tool: its name. Calls obey node and Run time limits." : "Supply business configuration and input data. Fixed definitions are assembled by the tool. Existing constraints and defaults are preserved on partial updates.",
|
|
14045
14251
|
example: {
|
|
14046
14252
|
op: "node.add",
|
|
14047
14253
|
as: "step",
|
|
14048
14254
|
type: kind,
|
|
14049
14255
|
name: "Step",
|
|
14050
14256
|
...{
|
|
14051
|
-
start: { config: { inputDefs: {} } },
|
|
14052
|
-
outputs: { config: { outputDefs: {} } },
|
|
14053
|
-
workflow: { config: { flowId: "<Flow ID>" } },
|
|
14054
|
-
connector: { config: {
|
|
14257
|
+
"start": { config: { inputDefs: {} } },
|
|
14258
|
+
"outputs": { config: { outputDefs: {} } },
|
|
14259
|
+
"workflow": { config: { flowId: "<Flow ID>" } },
|
|
14260
|
+
"connector": { config: {
|
|
14055
14261
|
action: "<Action ID>",
|
|
14056
14262
|
connectionId: "<Connection ID>"
|
|
14057
14263
|
} },
|
|
14058
|
-
poll: { config: {
|
|
14264
|
+
"poll": { config: {
|
|
14059
14265
|
key: "<Trigger key>",
|
|
14060
14266
|
schedule: [{
|
|
14061
14267
|
type: "every",
|
|
@@ -14063,20 +14269,27 @@ function authoringSchema(kind) {
|
|
|
14063
14269
|
value: 5
|
|
14064
14270
|
}]
|
|
14065
14271
|
} },
|
|
14066
|
-
integration: { config: { key: "<Trigger key>" } },
|
|
14067
|
-
|
|
14272
|
+
"integration": { config: { key: "<Trigger key>" } },
|
|
14273
|
+
"http-request": {
|
|
14274
|
+
config: {},
|
|
14275
|
+
inputs: { url: {
|
|
14276
|
+
kind: "value",
|
|
14277
|
+
value: "https://example.com"
|
|
14278
|
+
} }
|
|
14279
|
+
},
|
|
14280
|
+
"openapi": { config: {
|
|
14068
14281
|
sourceUrl: "https://example.com/openapi.json",
|
|
14069
14282
|
path: "/items",
|
|
14070
14283
|
method: "get"
|
|
14071
14284
|
} },
|
|
14072
|
-
code: {
|
|
14285
|
+
"code": {
|
|
14073
14286
|
code: "export default ({value}) => ({result:value})",
|
|
14074
14287
|
inputs: { value: {
|
|
14075
14288
|
kind: "value",
|
|
14076
14289
|
value: "Hello"
|
|
14077
14290
|
} }
|
|
14078
14291
|
},
|
|
14079
|
-
condition: { config: {
|
|
14292
|
+
"condition": { config: {
|
|
14080
14293
|
match: "first",
|
|
14081
14294
|
branches: [{
|
|
14082
14295
|
name: "yes",
|
|
@@ -14093,32 +14306,32 @@ function authoringSchema(kind) {
|
|
|
14093
14306
|
}
|
|
14094
14307
|
}]
|
|
14095
14308
|
} },
|
|
14096
|
-
value: { config: { values: {
|
|
14309
|
+
"value": { config: { values: {
|
|
14097
14310
|
threshold: 100,
|
|
14098
14311
|
region: "EU"
|
|
14099
14312
|
} } },
|
|
14100
|
-
webhook: { config: {
|
|
14313
|
+
"webhook": { config: {
|
|
14101
14314
|
method: "POST",
|
|
14102
14315
|
body: { orderId: {
|
|
14103
14316
|
schema: { type: "string" },
|
|
14104
14317
|
nullable: false
|
|
14105
14318
|
} }
|
|
14106
14319
|
} },
|
|
14107
|
-
wait: {
|
|
14320
|
+
"wait": {
|
|
14108
14321
|
prompt: "Continue processing this order?",
|
|
14109
14322
|
inputs: { order: {
|
|
14110
14323
|
kind: "value",
|
|
14111
14324
|
value: { orderId: "A-1" }
|
|
14112
14325
|
} }
|
|
14113
14326
|
},
|
|
14114
|
-
approval: {
|
|
14327
|
+
"approval": {
|
|
14115
14328
|
prompt: "Approve this order?",
|
|
14116
14329
|
inputs: { order: {
|
|
14117
14330
|
kind: "value",
|
|
14118
14331
|
value: { orderId: "A-1" }
|
|
14119
14332
|
} }
|
|
14120
14333
|
},
|
|
14121
|
-
llm: {
|
|
14334
|
+
"llm": {
|
|
14122
14335
|
config: {
|
|
14123
14336
|
model: { model: "deepseek-v4-flash" },
|
|
14124
14337
|
template: [{
|
|
@@ -14134,7 +14347,7 @@ function authoringSchema(kind) {
|
|
|
14134
14347
|
}
|
|
14135
14348
|
} }
|
|
14136
14349
|
},
|
|
14137
|
-
agent: {
|
|
14350
|
+
"agent": {
|
|
14138
14351
|
config: { model: "deepseek-v4-flash" },
|
|
14139
14352
|
inputs: { orders: {
|
|
14140
14353
|
kind: "value",
|
|
@@ -14337,6 +14550,24 @@ function resourceNameIssue(value) {
|
|
|
14337
14550
|
function portsByHandle(ports) {
|
|
14338
14551
|
return Object.fromEntries(ports.flatMap((port) => "handle" in port ? [[port.handle, port]] : []));
|
|
14339
14552
|
}
|
|
14553
|
+
var workflowToolNamePattern = /^[A-Za-z][A-Za-z0-9_-]{0,63}$/;
|
|
14554
|
+
function workflowToolNameIssue(name, otherNames = []) {
|
|
14555
|
+
if (!workflowToolNamePattern.test(name)) return "invalid";
|
|
14556
|
+
for (const other of otherNames) if (other == name) return "duplicate";
|
|
14557
|
+
}
|
|
14558
|
+
function decodeTaskCapabilities(value) {
|
|
14559
|
+
if (!Array.isArray(value)) throw new TypeError("Task capabilities must be an array.");
|
|
14560
|
+
const parsed = authoringDefinitionSchemas.capabilities.parse(value);
|
|
14561
|
+
const connectors = decodeConnectorCapabilities(parsed.filter((item) => item.kind == "connector"));
|
|
14562
|
+
const names = /* @__PURE__ */ new Set();
|
|
14563
|
+
for (const item of parsed) {
|
|
14564
|
+
if (item.kind != "workflow") continue;
|
|
14565
|
+
if (workflowToolNameIssue(item.name, names)) throw new TypeError("Workflow tool names must be unique provider-compatible names.");
|
|
14566
|
+
names.add(item.name);
|
|
14567
|
+
}
|
|
14568
|
+
let connectorIndex = 0;
|
|
14569
|
+
return parsed.map((item) => item.kind == "connector" ? connectors[connectorIndex++] : item);
|
|
14570
|
+
}
|
|
14340
14571
|
function decodeConnectorCapabilities(value) {
|
|
14341
14572
|
if (!Array.isArray(value)) throw new TypeError("Connector capabilities must be an array.");
|
|
14342
14573
|
if (value.length == 0) return [];
|
|
@@ -14469,10 +14700,10 @@ function upgradeRevisionContent(content) {
|
|
|
14469
14700
|
function upgradeDecodedRevisionContent(content) {
|
|
14470
14701
|
const graph = content.document.graph;
|
|
14471
14702
|
const hasManual = Object.values(graph.nodes).some((node) => node.kind == "manual");
|
|
14472
|
-
if (!hasManual && content.modelVersion ==
|
|
14703
|
+
if (!hasManual && content.modelVersion == 11) return content;
|
|
14473
14704
|
return {
|
|
14474
14705
|
...content,
|
|
14475
|
-
modelVersion:
|
|
14706
|
+
modelVersion: 11,
|
|
14476
14707
|
document: {
|
|
14477
14708
|
...content.document,
|
|
14478
14709
|
graph: hasManual ? {
|
|
@@ -14507,7 +14738,7 @@ function invalid(message) {
|
|
|
14507
14738
|
throw new FlowChangeError(message);
|
|
14508
14739
|
}
|
|
14509
14740
|
function applyFlowChanges(content, operations) {
|
|
14510
|
-
const source = content.modelVersion !=
|
|
14741
|
+
const source = content.modelVersion != 11 || Object.values(content.document.graph.nodes).some((node) => node.kind == "manual") ? decodeRevisionContent(content) : content;
|
|
14511
14742
|
const document = { ...source.document };
|
|
14512
14743
|
const modules = { ...source.modules };
|
|
14513
14744
|
for (const operation of operations) switch (operation.kind) {
|
|
@@ -14621,7 +14852,7 @@ function applyFlowChanges(content, operations) {
|
|
|
14621
14852
|
const graph = document.graph;
|
|
14622
14853
|
if (!dequal(graph.nodes[operation.nodeId], operation.before)) invalid("The Node changed before this operation was applied.");
|
|
14623
14854
|
if (operation.node.kind != operation.before.kind) invalid("Replacing a Node cannot change its kind.");
|
|
14624
|
-
if (operation.node.kind == "task" && "moduleId" in operation.node.task && operation.node.task.capabilities !== void 0)
|
|
14855
|
+
if (operation.node.kind == "task" && "moduleId" in operation.node.task && operation.node.task.capabilities !== void 0) decodeTaskCapabilities(operation.node.task.capabilities);
|
|
14625
14856
|
const name = normalizeNodeName(operation.node.name ?? "");
|
|
14626
14857
|
const issue = nodeNameIssue(graph, operation.nodeId, name);
|
|
14627
14858
|
if (issue != null) invalid(`Node name is ${issue}.`);
|
|
@@ -14643,7 +14874,7 @@ function applyFlowChanges(content, operations) {
|
|
|
14643
14874
|
if (graph.nodes[operation.nodeId] != null) invalid("A Node with this ID already exists in the target graph.");
|
|
14644
14875
|
if (operation.node.kind == "error" && Object.values(graph.nodes).some((node) => node.kind == "error")) invalid("A graph can contain only one Flow Error node.");
|
|
14645
14876
|
if ((operation.node.kind == "manual" || operation.node.kind == "start") && Object.values(graph.nodes).some((node) => node.kind == "manual" || node.kind == "start")) invalid("A graph can contain only one Start Trigger.");
|
|
14646
|
-
if (operation.node.kind == "task" && "moduleId" in operation.node.task && operation.node.task.capabilities !== void 0)
|
|
14877
|
+
if (operation.node.kind == "task" && "moduleId" in operation.node.task && operation.node.task.capabilities !== void 0) decodeTaskCapabilities(operation.node.task.capabilities);
|
|
14647
14878
|
if (operation.node.name == null) invalid("A Node name cannot be empty.");
|
|
14648
14879
|
if (operation.node.kind == "outputs" && Object.values(graph.nodes).some((node) => node.kind == "outputs")) invalid("A graph can contain only one Outputs node.");
|
|
14649
14880
|
const name = normalizeNodeName(operation.node.name);
|
|
@@ -14742,7 +14973,7 @@ function applyFlowChanges(content, operations) {
|
|
|
14742
14973
|
if (!dequal(node.task.capabilities, operation.before)) invalid("The inline Task capabilities changed before this operation was applied.");
|
|
14743
14974
|
const task = { ...node.task };
|
|
14744
14975
|
if (operation.value === void 0) delete task.capabilities;
|
|
14745
|
-
else task.capabilities =
|
|
14976
|
+
else task.capabilities = decodeTaskCapabilities(operation.value);
|
|
14746
14977
|
Object.assign(document, { graph: {
|
|
14747
14978
|
...graph,
|
|
14748
14979
|
nodes: {
|
|
@@ -14952,10 +15183,10 @@ function applyFlowChanges(content, operations) {
|
|
|
14952
15183
|
break;
|
|
14953
15184
|
}
|
|
14954
15185
|
}
|
|
14955
|
-
|
|
15186
|
+
assertHttpAuthBindings(document);
|
|
14956
15187
|
return upgradeDecodedRevisionContent({
|
|
14957
15188
|
document,
|
|
14958
|
-
modelVersion:
|
|
15189
|
+
modelVersion: 11,
|
|
14959
15190
|
modules
|
|
14960
15191
|
});
|
|
14961
15192
|
}
|
|
@@ -15219,42 +15450,6 @@ async function imports(source) {
|
|
|
15219
15450
|
}
|
|
15220
15451
|
}
|
|
15221
15452
|
//#endregion
|
|
15222
|
-
//#region src/flow/common/portChanges.ts
|
|
15223
|
-
function renamedPort(previous, next) {
|
|
15224
|
-
const previousNames = new Set(previous.flatMap((port) => "handle" in port ? [port.handle] : []));
|
|
15225
|
-
const nextNames = new Set(next.flatMap((port) => "handle" in port ? [port.handle] : []));
|
|
15226
|
-
const removed = [...previousNames].filter((name) => !nextNames.has(name));
|
|
15227
|
-
const added = [...nextNames].filter((name) => !previousNames.has(name));
|
|
15228
|
-
return removed.length == 1 && added.length == 1 ? [removed[0], added[0]] : void 0;
|
|
15229
|
-
}
|
|
15230
|
-
function renameOutputMapping(mapping, nodeIds, rename) {
|
|
15231
|
-
if (rename == null || mapping.kind != "sources") return mapping;
|
|
15232
|
-
const sources = mapping.sources.map((source) => source.kind == "node" && !source.system && nodeIds.has(source.nodeId) && source.output == rename[0] ? {
|
|
15233
|
-
...source,
|
|
15234
|
-
output: rename[1]
|
|
15235
|
-
} : source);
|
|
15236
|
-
return sources.every((source, index) => source === mapping.sources[index]) ? mapping : {
|
|
15237
|
-
kind: "sources",
|
|
15238
|
-
sources
|
|
15239
|
-
};
|
|
15240
|
-
}
|
|
15241
|
-
/** Carry saved mappings through a field rename and remove only fields absent from the new contract. */
|
|
15242
|
-
function remapInputMappings(mappings, ports, rename) {
|
|
15243
|
-
const inputs = { ...mappings };
|
|
15244
|
-
if (rename != null && Object.hasOwn(inputs, rename[0])) {
|
|
15245
|
-
Object.defineProperty(inputs, rename[1], {
|
|
15246
|
-
value: inputs[rename[0]],
|
|
15247
|
-
enumerable: true,
|
|
15248
|
-
configurable: true,
|
|
15249
|
-
writable: true
|
|
15250
|
-
});
|
|
15251
|
-
delete inputs[rename[0]];
|
|
15252
|
-
}
|
|
15253
|
-
const names = new Set(ports.flatMap((port) => "handle" in port ? [port.handle] : []));
|
|
15254
|
-
for (const name of Object.keys(inputs)) if (!names.has(name)) delete inputs[name];
|
|
15255
|
-
return inputs;
|
|
15256
|
-
}
|
|
15257
|
-
//#endregion
|
|
15258
15453
|
//#region src/flow/common/nodeChanges.ts
|
|
15259
15454
|
var codeTaskTemplate = `export default async function (inputs, context) {
|
|
15260
15455
|
return { result: inputs.value }
|
|
@@ -15699,6 +15894,26 @@ object$1({
|
|
|
15699
15894
|
}).nullable()
|
|
15700
15895
|
}))
|
|
15701
15896
|
});
|
|
15897
|
+
function workflowCapability(name, target) {
|
|
15898
|
+
return {
|
|
15899
|
+
kind: "workflow",
|
|
15900
|
+
name,
|
|
15901
|
+
flowId: target.flowId,
|
|
15902
|
+
revisionId: "inputs" in target ? target.revisionId : "",
|
|
15903
|
+
inputs: "inputs" in target ? target.inputs : [],
|
|
15904
|
+
outputs: "inputs" in target ? target.outputs : null
|
|
15905
|
+
};
|
|
15906
|
+
}
|
|
15907
|
+
function workflowAgentTool(id, name, target, previous) {
|
|
15908
|
+
const capability = workflowCapability(name, target);
|
|
15909
|
+
return {
|
|
15910
|
+
...capability,
|
|
15911
|
+
id,
|
|
15912
|
+
description: previous?.description ?? target.name,
|
|
15913
|
+
approval: previous?.approval ?? false,
|
|
15914
|
+
inputs: capability.inputs.map((port) => Object.assign({}, port, { source: previous?.inputs.find((old) => old.handle == port.handle)?.source ?? { kind: "model" } }))
|
|
15915
|
+
};
|
|
15916
|
+
}
|
|
15702
15917
|
//#endregion
|
|
15703
15918
|
//#region src/control/common/authoringCondition.ts
|
|
15704
15919
|
/** Preserve empty groups in invalid drafts; do not turn them into unconditional branches. */
|
|
@@ -15887,6 +16102,7 @@ function authoringDiagnosticField(node, parts) {
|
|
|
15887
16102
|
if (tool == null) return "config.tools";
|
|
15888
16103
|
const base = `config.tools.${location[2]}`;
|
|
15889
16104
|
if (location[3] == "id") return base;
|
|
16105
|
+
if (tool.kind == "workflow" && (location[3] == "revisionId" || location[3] == "outputs")) return `${base}.flowId`;
|
|
15890
16106
|
if (location[3] == "inputs") {
|
|
15891
16107
|
const input = tool.inputs[Number(location[4])];
|
|
15892
16108
|
if (input == null) return `${base}.inputs`;
|
|
@@ -15902,6 +16118,11 @@ function authoringDiagnosticField(node, parts) {
|
|
|
15902
16118
|
}
|
|
15903
16119
|
return ["config", ...location.slice(1)].join(".");
|
|
15904
16120
|
}
|
|
16121
|
+
if (head == "capabilities" && "moduleId" in task && task.capabilities?.[Number(location[1])]?.kind == "workflow" && [
|
|
16122
|
+
"revisionId",
|
|
16123
|
+
"inputs",
|
|
16124
|
+
"outputs"
|
|
16125
|
+
].includes(location[2] ?? "")) return `config.capabilities.${location[1]}.flowId`;
|
|
15905
16126
|
if (head == "capabilities") return ["config", ...location].join(".");
|
|
15906
16127
|
if (head == "name") return "name";
|
|
15907
16128
|
return "config";
|
|
@@ -15979,6 +16200,31 @@ function fieldsToPorts(fields, previous) {
|
|
|
15979
16200
|
}
|
|
15980
16201
|
//#endregion
|
|
15981
16202
|
//#region src/control/common/authoringTools.ts
|
|
16203
|
+
/** A rename retains a snapshot only when one removed name matches one added name for the same target. */
|
|
16204
|
+
function previousWorkflowTool(tool, next, previous) {
|
|
16205
|
+
const named = previous.find((item) => item.name == tool.name);
|
|
16206
|
+
if (named != null) return named;
|
|
16207
|
+
if (next.filter((item) => item.kind == "workflow" && item.flowId == tool.flowId && !previous.some((old) => old.name == item.name)).length != 1) return;
|
|
16208
|
+
const removed = previous.filter((item) => item.kind == "workflow" && item.flowId == tool.flowId && !next.some((itemNext) => itemNext.name == item.name));
|
|
16209
|
+
return removed.length == 1 ? removed[0] : void 0;
|
|
16210
|
+
}
|
|
16211
|
+
function outwardCapabilities(capabilities) {
|
|
16212
|
+
return capabilities.map((item) => item.kind == "workflow" ? {
|
|
16213
|
+
kind: item.kind,
|
|
16214
|
+
name: item.name,
|
|
16215
|
+
flowId: item.flowId
|
|
16216
|
+
} : item);
|
|
16217
|
+
}
|
|
16218
|
+
async function prepareCapabilities(capabilities, previous, workflow) {
|
|
16219
|
+
return Promise.all(capabilities.map(async (item) => {
|
|
16220
|
+
if (item.kind != "workflow") return item;
|
|
16221
|
+
const old = previousWorkflowTool(item, capabilities, previous);
|
|
16222
|
+
return old?.kind == "workflow" && old.flowId == item.flowId ? {
|
|
16223
|
+
...old,
|
|
16224
|
+
name: item.name
|
|
16225
|
+
} : workflowCapability(item.name, await workflow(item.flowId));
|
|
16226
|
+
}));
|
|
16227
|
+
}
|
|
15982
16228
|
var AuthoringToolInputError = class extends Error {
|
|
15983
16229
|
constructor(details) {
|
|
15984
16230
|
super(`Unknown input ${JSON.stringify(details.input)} for tool ${JSON.stringify(details.tool)}. Choose from: ${details.choices.join(", ") || "(none)"}.`);
|
|
@@ -15988,17 +16234,45 @@ var AuthoringToolInputError = class extends Error {
|
|
|
15988
16234
|
}
|
|
15989
16235
|
};
|
|
15990
16236
|
function outwardAgentTools(tools) {
|
|
15991
|
-
return tools.map((
|
|
15992
|
-
...tool
|
|
15993
|
-
|
|
15994
|
-
|
|
16237
|
+
return tools.map((tool) => {
|
|
16238
|
+
const { id: _id, inputs, ...settings } = tool;
|
|
16239
|
+
return {
|
|
16240
|
+
...tool.kind == "workflow" ? {
|
|
16241
|
+
kind: tool.kind,
|
|
16242
|
+
name: tool.name,
|
|
16243
|
+
description: tool.description,
|
|
16244
|
+
approval: tool.approval,
|
|
16245
|
+
flowId: tool.flowId
|
|
16246
|
+
} : settings,
|
|
16247
|
+
inputs: Object.fromEntries(inputs.map((input) => [input.handle, input.source]))
|
|
16248
|
+
};
|
|
16249
|
+
});
|
|
15995
16250
|
}
|
|
15996
|
-
/** Keep persisted
|
|
15997
|
-
async function prepareAgentTools(tools, previous, action, id) {
|
|
16251
|
+
/** Keep persisted tool contracts until the caller selects a different target or explicitly refreshes. */
|
|
16252
|
+
async function prepareAgentTools(tools, previous, action, id, workflow) {
|
|
15998
16253
|
const prepared = [];
|
|
15999
16254
|
for (const tool of tools) {
|
|
16000
|
-
const old = previous.find((item) => item.name == tool.name);
|
|
16001
|
-
|
|
16255
|
+
const old = tool.kind == "workflow" ? previousWorkflowTool(tool, tools, previous) : previous.find((item) => item.name == tool.name);
|
|
16256
|
+
if (tool.kind == "workflow") {
|
|
16257
|
+
if (workflow == null) throw new Error("Workflow tools are unavailable.");
|
|
16258
|
+
const preparedTool = (old?.kind == "workflow" && old.flowId == tool.flowId ? old : void 0) ?? workflowAgentTool(old?.id ?? id(), tool.name, await workflow(tool.flowId));
|
|
16259
|
+
const choices = preparedTool.inputs.map((port) => port.handle);
|
|
16260
|
+
for (const input of Object.keys(tool.inputs ?? {})) if (!choices.includes(input)) throw new AuthoringToolInputError({
|
|
16261
|
+
tool: tool.name,
|
|
16262
|
+
action: tool.flowId,
|
|
16263
|
+
input,
|
|
16264
|
+
choices
|
|
16265
|
+
});
|
|
16266
|
+
prepared.push({
|
|
16267
|
+
...preparedTool,
|
|
16268
|
+
name: tool.name,
|
|
16269
|
+
description: tool.description,
|
|
16270
|
+
approval: tool.approval,
|
|
16271
|
+
inputs: preparedTool.inputs.map((port) => Object.assign({}, port, { source: tool.inputs?.[port.handle] ?? port.source }))
|
|
16272
|
+
});
|
|
16273
|
+
continue;
|
|
16274
|
+
}
|
|
16275
|
+
const retained = old?.kind != "workflow" && old?.action == tool.action ? old : void 0;
|
|
16002
16276
|
const definition = retained == null ? await action(tool.action) : void 0;
|
|
16003
16277
|
const ports = retained?.inputs ?? Object.entries(definition.inputs).map(([handle, port]) => Object.assign({}, port, {
|
|
16004
16278
|
handle,
|
|
@@ -16137,12 +16411,15 @@ function authoringNode(content, ref) {
|
|
|
16137
16411
|
inputs: fieldsView([...task.inputs, ...node.kind == "task" ? node.additionalInputs ?? [] : []].filter((port) => !("handle" in port) || !llmReservedInputs.includes(port.handle)))
|
|
16138
16412
|
};
|
|
16139
16413
|
else if (task.executor.kind == "workflow") config = { flowId: task.executor.flowId };
|
|
16140
|
-
else if (task.executor.kind == "
|
|
16414
|
+
else if (task.executor.kind == "http-request") {
|
|
16415
|
+
const { kind: _kind, ...settings } = task.executor;
|
|
16416
|
+
config = settings;
|
|
16417
|
+
} else if (task.executor.kind == "openapi") config = { ...openApiConfigView(task.executor) };
|
|
16141
16418
|
} else if (node.kind == "task" && "moduleId" in node.task) {
|
|
16142
16419
|
config = {
|
|
16143
16420
|
inputs: fieldsView([...node.task.inputs, ...node.additionalInputs ?? []]),
|
|
16144
16421
|
outputs: fieldsView(node.task.outputs),
|
|
16145
|
-
...node.task.capabilities == null ? {} : { capabilities: node.task.capabilities }
|
|
16422
|
+
...node.task.capabilities == null ? {} : { capabilities: outwardCapabilities(node.task.capabilities) }
|
|
16146
16423
|
};
|
|
16147
16424
|
texts.code = content.modules[node.task.moduleId]?.source ?? "";
|
|
16148
16425
|
} else switch (node.kind) {
|
|
@@ -16410,9 +16687,12 @@ async function compileAuthoring(base, request, host) {
|
|
|
16410
16687
|
outputs: Object.entries(action.outputs).map(([handle, port]) => Object.assign({ handle }, port))
|
|
16411
16688
|
};
|
|
16412
16689
|
}
|
|
16413
|
-
async function
|
|
16690
|
+
async function workflowTarget(flowId) {
|
|
16414
16691
|
if (host.workflow == null) fail("workflow.unavailable", "Workflow calls are unavailable.");
|
|
16415
|
-
|
|
16692
|
+
return host.workflow(flowId);
|
|
16693
|
+
}
|
|
16694
|
+
async function resolveWorkflow(flowId, name, previous) {
|
|
16695
|
+
const target = await workflowTarget(flowId);
|
|
16416
16696
|
return "inputs" in target ? workflowTask(target, name) : workflowSelectionTask({
|
|
16417
16697
|
...target,
|
|
16418
16698
|
name
|
|
@@ -16435,7 +16715,7 @@ async function compileAuthoring(base, request, host) {
|
|
|
16435
16715
|
const timing = record(record(patch.config).autoContinue);
|
|
16436
16716
|
if (Object.hasOwn(timing, "kind") && timing.kind != record(record(view.config).autoContinue).kind) record(update.config).autoContinue = timing;
|
|
16437
16717
|
}
|
|
16438
|
-
if (type == "openapi" && Object.hasOwn(record(patch.config), "authentication")) record(update.config).authentication = record(patch.config).authentication;
|
|
16718
|
+
if ((type == "openapi" || type == "http-request") && Object.hasOwn(record(patch.config), "authentication")) record(update.config).authentication = record(patch.config).authentication;
|
|
16439
16719
|
for (const path of clear) clearPath(update, path);
|
|
16440
16720
|
if (typeof update.name != "string") fail("node.name-required", "Node name cannot be cleared.");
|
|
16441
16721
|
const config = authoringConfigurations[type].parse(update.config);
|
|
@@ -16491,6 +16771,7 @@ async function compileAuthoring(base, request, host) {
|
|
|
16491
16771
|
moduleId: node.task.moduleId,
|
|
16492
16772
|
name: String(update.name),
|
|
16493
16773
|
...config,
|
|
16774
|
+
...config.capabilities == null ? {} : { capabilities: await prepareCapabilities(config.capabilities, node.task.capabilities ?? [], workflowTarget) },
|
|
16494
16775
|
inputs,
|
|
16495
16776
|
outputs: fieldsToPorts(config.outputs, node.task.outputs)
|
|
16496
16777
|
}
|
|
@@ -16520,7 +16801,13 @@ async function compileAuthoring(base, request, host) {
|
|
|
16520
16801
|
};
|
|
16521
16802
|
} else task = await connectorTask(config, String(update.name));
|
|
16522
16803
|
} else if (type == "decision") task = decisionTask(config.questions, String(update.name));
|
|
16523
|
-
else if (type == "
|
|
16804
|
+
else if (type == "http-request") {
|
|
16805
|
+
task = httpRequestTask(httpRequestConfigSchema.parse(config), String(update.name), before);
|
|
16806
|
+
next = {
|
|
16807
|
+
...next,
|
|
16808
|
+
inputs: httpRequestInputs(node.inputs, before, task)
|
|
16809
|
+
};
|
|
16810
|
+
} else if (type == "openapi") task = await prepareOpenApiTask(config, before, (url) => host.openapi(url), String(update.name), {
|
|
16524
16811
|
authentication: explicit("authentication"),
|
|
16525
16812
|
serverUrl: explicit("serverUrl")
|
|
16526
16813
|
});
|
|
@@ -16539,7 +16826,7 @@ async function compileAuthoring(base, request, host) {
|
|
|
16539
16826
|
};
|
|
16540
16827
|
if (type == "agent") {
|
|
16541
16828
|
const previous = before.executor.kind == "agent" ? before.executor : void 0;
|
|
16542
|
-
Object.assign(prepared, { tools: await prepareAgentTools(tools, previous?.tools ?? [], (id) => host.action(id), () => fresh("tool")) });
|
|
16829
|
+
Object.assign(prepared, { tools: await prepareAgentTools(tools, previous?.tools ?? [], (id) => host.action(id), () => fresh("tool"), workflowTarget) });
|
|
16543
16830
|
Reflect.deleteProperty(prepared, "notification");
|
|
16544
16831
|
if (notification != null) {
|
|
16545
16832
|
if (dequal(record(view.config).notification, notification) && previous?.notification != null) Object.assign(prepared, { notification: previous.notification });
|
|
@@ -16763,13 +17050,45 @@ async function compileAuthoring(base, request, host) {
|
|
|
16763
17050
|
case "node.refresh": {
|
|
16764
17051
|
const ref = resolve(edit.node);
|
|
16765
17052
|
const node = nodeAt(content, ref);
|
|
16766
|
-
if (node.kind != "task"
|
|
16767
|
-
|
|
16768
|
-
|
|
16769
|
-
|
|
16770
|
-
|
|
16771
|
-
|
|
16772
|
-
|
|
17053
|
+
if (node.kind != "task") fail("node.invalid-type", "Only workflow nodes and tools support refresh.");
|
|
17054
|
+
if (edit.tool != null) {
|
|
17055
|
+
if ("moduleId" in node.task) {
|
|
17056
|
+
const selected = node.task.capabilities?.find((item) => item.kind == "workflow" && item.name == edit.tool);
|
|
17057
|
+
if (selected?.kind != "workflow") fail("tool.not-found", "Workflow tool was not found.");
|
|
17058
|
+
const target = await workflowTarget(selected.flowId);
|
|
17059
|
+
if (!("inputs" in target)) fail("workflow.unavailable", "The workflow interface is unavailable.");
|
|
17060
|
+
replace(ref, {
|
|
17061
|
+
...node,
|
|
17062
|
+
task: {
|
|
17063
|
+
...node.task,
|
|
17064
|
+
capabilities: node.task.capabilities.map((item) => item === selected ? workflowCapability(selected.name, target) : item)
|
|
17065
|
+
}
|
|
17066
|
+
});
|
|
17067
|
+
} else if (node.task.executor.kind == "agent") {
|
|
17068
|
+
const selected = node.task.executor.tools.find((item) => item.kind == "workflow" && item.name == edit.tool);
|
|
17069
|
+
if (selected?.kind != "workflow") fail("tool.not-found", "Workflow tool was not found.");
|
|
17070
|
+
const target = await workflowTarget(selected.flowId);
|
|
17071
|
+
if (!("inputs" in target)) fail("workflow.unavailable", "The workflow interface is unavailable.");
|
|
17072
|
+
replace(ref, {
|
|
17073
|
+
...node,
|
|
17074
|
+
task: {
|
|
17075
|
+
...node.task,
|
|
17076
|
+
executor: {
|
|
17077
|
+
...node.task.executor,
|
|
17078
|
+
tools: node.task.executor.tools.map((item) => item === selected ? workflowAgentTool(selected.id, selected.name, target, selected) : item)
|
|
17079
|
+
}
|
|
17080
|
+
}
|
|
17081
|
+
});
|
|
17082
|
+
} else fail("node.invalid-type", "Only Agent and Code nodes have workflow tools.");
|
|
17083
|
+
} else {
|
|
17084
|
+
if (!("executor" in node.task) || node.task.executor.kind != "workflow") fail("node.invalid-type", "Specify a workflow tool name.");
|
|
17085
|
+
apply([{
|
|
17086
|
+
kind: "graph.node.replace",
|
|
17087
|
+
nodeId: ref,
|
|
17088
|
+
before: node,
|
|
17089
|
+
node: withWorkflowTask(node, await resolveWorkflow(node.task.executor.flowId, node.name ?? node.task.name, node.task))
|
|
17090
|
+
}]);
|
|
17091
|
+
}
|
|
16773
17092
|
break;
|
|
16774
17093
|
}
|
|
16775
17094
|
case "node.add": {
|
|
@@ -16829,6 +17148,9 @@ async function compileAuthoring(base, request, host) {
|
|
|
16829
17148
|
case "connector":
|
|
16830
17149
|
changes = createManagedTask(identity, await connectorTask(config, name));
|
|
16831
17150
|
break;
|
|
17151
|
+
case "http-request":
|
|
17152
|
+
changes = createManagedTask(identity, httpRequestTask(httpRequestConfigSchema.parse(config), name));
|
|
17153
|
+
break;
|
|
16832
17154
|
case "openapi":
|
|
16833
17155
|
changes = createManagedTask(identity, await prepareOpenApiTask(authoringConfigurations.openapi.parse(config), void 0, (url) => host.openapi(url), name));
|
|
16834
17156
|
break;
|
|
@@ -17047,6 +17369,7 @@ var descriptions = {
|
|
|
17047
17369
|
"poll": "Gmail polling by key; replace CONNECTION_ID with an active Gmail connection.",
|
|
17048
17370
|
"integration": "Telegram webhook integration by key; replace CONNECTION_ID with an active Telegram connection.",
|
|
17049
17371
|
"decision": "AI Decision evaluates named questions against target and returns a complete answer object per output. Configure target before running.",
|
|
17372
|
+
"http-request": "A single HTTP request. Bind url and request inputs; outputs are body, statusCode and headers.",
|
|
17050
17373
|
"openapi": "A fixed JSON API operation. Replace the example document and URL before running.",
|
|
17051
17374
|
"connector": "A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show. Set connectionId to an empty string to defer account configuration; execution will require an account.",
|
|
17052
17375
|
"code": "A JavaScript module and its node. Use Code for custom computation; use Connector Tasks for existing actions.",
|
|
@@ -17090,6 +17413,17 @@ function authoringExample(name) {
|
|
|
17090
17413
|
instructions: "Does the customer need support?"
|
|
17091
17414
|
}]);
|
|
17092
17415
|
break;
|
|
17416
|
+
case "http-request":
|
|
17417
|
+
operations = [...createManagedTask({ nodeId: "http" }, httpRequestTask()), {
|
|
17418
|
+
kind: "graph.node.input.set",
|
|
17419
|
+
nodeId: "http",
|
|
17420
|
+
handle: "url",
|
|
17421
|
+
value: {
|
|
17422
|
+
kind: "value",
|
|
17423
|
+
value: "https://example.com"
|
|
17424
|
+
}
|
|
17425
|
+
}];
|
|
17426
|
+
break;
|
|
17093
17427
|
case "openapi":
|
|
17094
17428
|
operations = createManagedTask({ nodeId: "api" }, openApiTask(selectOperation({
|
|
17095
17429
|
openapi: "3.1.0",
|