@oomol-lab/open-flow 0.1.0-beta.75 → 0.1.0-beta.77
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/README.md +3 -1
- package/dist/browser/{ContentIcon-FCpKiwjp.js → ContentIcon-VZQO8VZU.js} +9 -6
- package/dist/browser/{FlowCanvas-dzRBnlUT.js → FlowCanvas-BNGDMaWr.js} +75 -63
- package/dist/browser/{createResourceDialog-BeYDdUl-.js → createResourceDialog-BmtakfVg.js} +63 -57
- package/dist/browser/{dialog-ZtpsFbl4.js → dialog-BcFBfRB1.js} +126 -32
- package/dist/browser/{exportSvg-DqXw1yf-.js → exportSvg-CG8hEUNk.js} +2 -2
- package/dist/browser/{flowChanges-b_5UobFj.js → flowChanges-BGo_4Ypo.js} +6063 -11285
- package/dist/browser/{flowWorkspace-ItojZbO4.js → flowWorkspace-BFHGev7s.js} +1065 -2570
- package/dist/browser/preview.css +626 -653
- package/dist/browser/preview.js +1907 -9663
- package/dist/browser/theme.css +117 -263
- package/dist/browser/{tooltip-wZJRB9oP.js → tooltip-BAWSUexx.js} +2 -2
- package/dist/browser/{typeScriptSession-CSRwWmZm.js → typeScriptSession-CRoezJPN.js} +1 -1
- package/dist/browser/ui.css +464 -463
- package/dist/browser/ui.js +4 -3
- package/dist/browser/workbench.css +9891 -9897
- package/dist/browser/workbench.d.ts +6 -2
- package/dist/browser/workbench.js +838 -499
- package/dist/browser/{workbenchSelect-M441Lz0d.js → workbenchSelect-CjK-xdm3.js} +2 -2
- package/dist/command/index.js +48 -50
- package/dist/common/authoring.d.ts +5 -5
- package/dist/common/authoringExamples.d.ts +3 -2
- package/dist/common/authoringSchema.d.ts +26 -4
- package/dist/common/connector-proxy.d.ts +1 -1
- package/dist/common/control-api-conformance.js +352 -144
- package/dist/common/control-api-errors.d.ts +12 -0
- package/dist/common/control-api.d.ts +38 -4
- package/dist/common/control-api.js +373 -162
- package/dist/common/control-requests.d.ts +22 -3
- package/dist/common/control-requests.js +268 -28
- package/dist/common/cron-trigger.d.ts +2 -1
- package/dist/common/decision.d.ts +4 -4
- package/dist/common/decision.js +5 -2
- package/dist/common/engine-contract.d.ts +6 -1
- package/dist/common/event-source-definition.d.ts +1 -1
- package/dist/common/event-source-view.d.ts +22 -0
- package/dist/common/event-source.d.ts +1 -1
- package/dist/common/event-source.js +24 -65
- package/dist/common/event-sources.d.ts +0 -21
- package/dist/common/flow-authoring.js +90 -20
- package/dist/common/flow-change-schema.d.ts +9 -1
- package/dist/common/flow-change.d.ts +8 -202
- package/dist/common/flow-change.js +96 -24
- package/dist/common/flow-encoding.js +89 -21
- package/dist/common/flow-input-value.d.ts +1 -1
- package/dist/common/flow-model.d.ts +121 -0
- package/dist/common/flow-notifications.d.ts +1 -1
- package/dist/common/flow-retry.d.ts +2 -4
- package/dist/common/flow-semantics.js +161 -80
- package/dist/common/flow-state.d.ts +123 -0
- package/dist/common/flow-state.js +5852 -0
- package/dist/common/flow-workflowReferences.d.ts +8 -0
- package/dist/common/flowInspection.d.ts +1 -1
- package/dist/common/http-hosts.d.ts +6 -0
- package/dist/common/http-request.d.ts +13 -5
- package/dist/common/http-request.js +23 -5
- package/dist/common/integration-trigger.d.ts +2 -1
- package/dist/common/mcp.d.ts +96 -3
- package/dist/common/mcp.js +355 -142
- package/dist/common/openapi.d.ts +4 -4
- package/dist/common/openapi.js +4 -1
- package/dist/common/poll-trigger.d.ts +2 -1
- package/dist/common/run-events.js +1 -0
- package/dist/common/runtime-contract.d.ts +37 -1
- package/dist/common/runtime-contract.js +717 -72
- package/dist/common/runtime-nodejs-compat.d.ts +44 -0
- package/dist/common/runtime-nodejs-compat.js +5870 -0
- package/dist/common/scheduler-checkpoint.d.ts +1 -1
- package/dist/common/scheduler-node-execution.d.ts +2 -1
- package/dist/common/scheduler.d.ts +2 -2
- package/dist/common/scheduler.js +76 -6
- package/dist/common/state-conformance.d.ts +16 -0
- package/dist/common/tags.d.ts +4 -0
- package/dist/common/trigger-catalog.d.ts +1 -7
- 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 -1
- package/dist/common/trigger-localization.d.ts +8 -2
- package/dist/common/trigger-model.d.ts +101 -0
- package/dist/common/webhook-response.d.ts +1 -1
- package/dist/common/webhook-trigger.d.ts +3 -1
- package/dist/common/workflow.d.ts +3 -12
- package/dist/common/workflow.js +25 -23
- package/dist/index.d.ts +52 -14
- package/package.json +9 -1
- package/src/base/common/json.ts +1 -1
- package/src/connector/common/proxy.ts +1 -1
- package/src/control/common/api.ts +90 -16
- package/src/control/common/authoring.ts +6 -1
- package/src/control/common/authoringExamples.ts +8 -0
- package/src/control/common/authoringSchema.ts +26 -13
- package/src/control/common/authoringTools.ts +1 -1
- package/src/control/common/conformance.ts +1 -1
- package/src/control/common/connectorDecoders.ts +1 -1
- package/src/control/common/errors.ts +6 -0
- package/src/control/common/eventSources.ts +2 -29
- package/src/control/common/flowDecoders.ts +1 -0
- package/src/control/common/mcp.ts +16 -0
- package/src/control/common/requests.ts +10 -2
- package/src/control/common/tags.ts +20 -0
- package/src/control/common/triggerCatalog.ts +1 -8
- package/src/decision/common/decision.ts +15 -7
- package/src/event-source/common/definition.ts +1 -1
- package/src/event-source/common/index.ts +1 -1
- package/src/event-source/common/view.ts +20 -0
- package/src/execution/common/checkpoint.ts +1 -1
- package/src/execution/common/events.ts +3 -0
- package/src/execution/common/node-execution.ts +4 -1
- package/src/execution/common/scheduler.ts +3 -1
- package/src/flow/common/change.ts +60 -193
- package/src/flow/common/changeSchema.ts +39 -4
- package/src/flow/common/connectionUsage.ts +1 -1
- package/src/flow/common/errorHandling.ts +1 -1
- package/src/flow/common/inputValue.ts +1 -1
- package/src/flow/common/model.ts +130 -0
- package/src/flow/common/modules.ts +1 -1
- package/src/flow/common/portChanges.ts +1 -1
- package/src/flow/common/retry.ts +2 -4
- package/src/flow/common/semantics.ts +31 -4
- package/src/flow/common/webhookResponse.ts +1 -1
- package/src/flow/common/workflowReferences.ts +31 -0
- package/src/http/common/authBindings.ts +6 -9
- package/src/http/common/hosts.ts +13 -0
- package/src/http/common/httpRequest.ts +30 -15
- package/src/openapi/common/openapi.ts +9 -5
- package/src/{execution → runtime}/common/engineContract.ts +23 -15
- package/src/runtime/common/nodejsCompat.ts +275 -0
- package/src/runtime/common/nodejsGuest.generated.json +47 -0
- package/src/runtime/common/runtime.ts +1254 -0
- package/src/state/common/conformance.ts +86 -0
- package/src/state/common/state.ts +169 -0
- package/src/trigger/common/config.ts +1 -1
- package/src/trigger/common/configOptions.ts +1 -1
- package/src/trigger/common/contract.ts +2 -1
- package/src/trigger/common/cron.ts +2 -1
- package/src/trigger/common/integration.ts +2 -1
- package/src/trigger/common/model.ts +87 -0
- package/src/trigger/common/poll.ts +2 -1
- package/src/trigger/common/webhook.ts +3 -1
- package/src/trigger/providers/fieldDescriptions.ts +1 -1
- package/src/trigger/providers/localization.ts +9 -2
- package/src/trigger/providers/remote.ts +1 -1
- package/src/types/index.ts +55 -15
- package/src/workflow/common/workflow.ts +3 -44
- package/src/execution/common/runtime.ts +0 -563
- /package/src/{control → connector}/common/providerIconSprite.ts +0 -0
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
//#region src/http/common/authBindings.ts
|
|
2
|
-
/** Never allow credentials to enter a Revision as literal node inputs. */
|
|
3
|
-
function assertHttpAuthBindings(document) {
|
|
4
|
-
for (const node of Object.values(document.graph.nodes)) {
|
|
5
|
-
if (node.kind != "task" || !("executor" in node.task) || !["openapi", "http-request"].includes(node.task.executor.kind)) continue;
|
|
6
|
-
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.");
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
10
1
|
//#region ../../node_modules/.bun/dequal@2.0.3/node_modules/dequal/lite/index.mjs
|
|
11
2
|
var has = Object.prototype.hasOwnProperty;
|
|
12
3
|
function dequal(foo, bar) {
|
|
@@ -8462,6 +8453,9 @@ function createSchemaComparer() {
|
|
|
8462
8453
|
createSchemaComparer();
|
|
8463
8454
|
//#endregion
|
|
8464
8455
|
//#region src/decision/common/decision.ts
|
|
8456
|
+
function isDecisionExecutor(executor) {
|
|
8457
|
+
return executor.kind === "decision";
|
|
8458
|
+
}
|
|
8465
8459
|
var decisionLimits = {
|
|
8466
8460
|
choice: 255,
|
|
8467
8461
|
score: 10
|
|
@@ -8484,7 +8478,7 @@ function limitDecisionQuestions(questions) {
|
|
|
8484
8478
|
}
|
|
8485
8479
|
/** Loading an oversized task also updates its previously generated output schemas. */
|
|
8486
8480
|
function limitDecisionTask(task) {
|
|
8487
|
-
if (task.executor
|
|
8481
|
+
if (!isDecisionExecutor(task.executor)) return task;
|
|
8488
8482
|
const original = task.executor.questions;
|
|
8489
8483
|
const questions = limitDecisionQuestions(original);
|
|
8490
8484
|
if (questions === original) return task;
|
|
@@ -8551,6 +8545,20 @@ function answerSchema(question) {
|
|
|
8551
8545
|
};
|
|
8552
8546
|
}
|
|
8553
8547
|
//#endregion
|
|
8548
|
+
//#region src/http/common/authBindings.ts
|
|
8549
|
+
/** Never allow credentials to enter a Revision as literal inputs of an OpenAPI or HTTP request node. */
|
|
8550
|
+
function assertHttpAuthBindings(inputs) {
|
|
8551
|
+
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.");
|
|
8552
|
+
}
|
|
8553
|
+
//#endregion
|
|
8554
|
+
//#region src/http/common/hosts.ts
|
|
8555
|
+
/** Hosts of a Code `http` Capability: lowercase DNS names or IPv4 addresses; `*.example.com` matches subdomains only. */
|
|
8556
|
+
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])?$/;
|
|
8557
|
+
/** Wildcards must name a registrable suffix, so `*.com` is rejected. */
|
|
8558
|
+
function isHttpHost(value) {
|
|
8559
|
+
return httpHostPattern.test(value) && (!value.startsWith("*.") || value.slice(2).includes("."));
|
|
8560
|
+
}
|
|
8561
|
+
//#endregion
|
|
8554
8562
|
//#region src/http/common/httpRequest.ts
|
|
8555
8563
|
var parameterSchema = strictObject({
|
|
8556
8564
|
mode: _enum(["fields", "object"]).default("fields"),
|
|
@@ -8596,6 +8604,51 @@ var httpRequestExecutorSchema = strictObject({
|
|
|
8596
8604
|
]).default("auto"),
|
|
8597
8605
|
statusPolicy: _enum(["success", "all"]).default("success")
|
|
8598
8606
|
}).extend({ kind: literal("http-request") });
|
|
8607
|
+
strictObject({
|
|
8608
|
+
scope: _enum(["draft", "live"]),
|
|
8609
|
+
values: boolean().optional()
|
|
8610
|
+
});
|
|
8611
|
+
strictObject({
|
|
8612
|
+
scope: _enum(["draft", "live"]),
|
|
8613
|
+
key: string().min(1).refine((key) => new TextEncoder().encode(key).length <= 256).optional()
|
|
8614
|
+
});
|
|
8615
|
+
strictObject({
|
|
8616
|
+
scope: _enum(["draft", "live"]),
|
|
8617
|
+
space: string().regex(/^(flow|node:.+)$/)
|
|
8618
|
+
});
|
|
8619
|
+
var dedupeExecutorSchema = strictObject({
|
|
8620
|
+
field: string().default(""),
|
|
8621
|
+
mode: _enum(["new", "increasing"]).default("new"),
|
|
8622
|
+
space: _enum(["node", "flow"]).default("node")
|
|
8623
|
+
}).extend({ kind: literal("dedupe") });
|
|
8624
|
+
object({
|
|
8625
|
+
version: literal(1),
|
|
8626
|
+
scope: _enum(["draft", "live"]),
|
|
8627
|
+
limits: object({
|
|
8628
|
+
maxValueBytes: number().positive(),
|
|
8629
|
+
maxValues: number().int().positive(),
|
|
8630
|
+
maxSpaces: number().int().positive(),
|
|
8631
|
+
maxIdentities: number().positive(),
|
|
8632
|
+
maxRunWrites: number().positive()
|
|
8633
|
+
}),
|
|
8634
|
+
values: array(object({
|
|
8635
|
+
key: string(),
|
|
8636
|
+
size: number().nonnegative(),
|
|
8637
|
+
updatedAt: number(),
|
|
8638
|
+
value: json$1().optional()
|
|
8639
|
+
})),
|
|
8640
|
+
spaces: array(object({
|
|
8641
|
+
space: string(),
|
|
8642
|
+
mode: _enum(["new", "increasing"]),
|
|
8643
|
+
count: number().nonnegative(),
|
|
8644
|
+
watermark: union([
|
|
8645
|
+
string(),
|
|
8646
|
+
number(),
|
|
8647
|
+
_null()
|
|
8648
|
+
]),
|
|
8649
|
+
updatedAt: number()
|
|
8650
|
+
}))
|
|
8651
|
+
});
|
|
8599
8652
|
//#endregion
|
|
8600
8653
|
//#region src/flow/common/json.ts
|
|
8601
8654
|
var maxJsonDepth = 64;
|
|
@@ -8764,7 +8817,14 @@ var workflowCapabilitySchema = strictObject({
|
|
|
8764
8817
|
inputs: array(port),
|
|
8765
8818
|
outputs: array(port).nullable()
|
|
8766
8819
|
});
|
|
8767
|
-
var capability = union([
|
|
8820
|
+
var capability = union([
|
|
8821
|
+
connectorCapabilitySchema,
|
|
8822
|
+
workflowCapabilitySchema,
|
|
8823
|
+
strictObject({
|
|
8824
|
+
kind: literal("http"),
|
|
8825
|
+
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.")
|
|
8826
|
+
})
|
|
8827
|
+
]);
|
|
8768
8828
|
var inline = object({
|
|
8769
8829
|
...ports,
|
|
8770
8830
|
name: text,
|
|
@@ -8875,7 +8935,8 @@ var managedFields = object({
|
|
|
8875
8935
|
flowId: text,
|
|
8876
8936
|
revisionId: text
|
|
8877
8937
|
}),
|
|
8878
|
-
httpRequestExecutorSchema
|
|
8938
|
+
httpRequestExecutorSchema,
|
|
8939
|
+
dedupeExecutorSchema
|
|
8879
8940
|
])
|
|
8880
8941
|
});
|
|
8881
8942
|
var managed = managedFields.transform(limitDecisionTask);
|
|
@@ -9128,7 +9189,9 @@ var revision = object({
|
|
|
9128
9189
|
literal(8),
|
|
9129
9190
|
literal(9),
|
|
9130
9191
|
literal(10),
|
|
9131
|
-
literal(11)
|
|
9192
|
+
literal(11),
|
|
9193
|
+
literal(12),
|
|
9194
|
+
literal(13)
|
|
9132
9195
|
]),
|
|
9133
9196
|
document,
|
|
9134
9197
|
modules: record$1(text, module)
|
|
@@ -9383,14 +9446,14 @@ function repairRevisionEnvelope(value) {
|
|
|
9383
9446
|
checkJsonDepth(value);
|
|
9384
9447
|
const envelopeSource = record(value);
|
|
9385
9448
|
if (envelopeSource.kind != "open-flow-flow-revision" || envelopeSource.version != 1) throw new TypeError("The value is not an Open Flow Revision envelope.");
|
|
9386
|
-
if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion >
|
|
9449
|
+
if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion > 13) throw new TypeError("The Flow model is newer than this package.");
|
|
9387
9450
|
let sourceDocument = record(envelopeSource.modelVersion == 1 || envelopeSource.modelVersion == 2 ? upgradeLegacyDocument(envelopeSource.document) : envelopeSource.document);
|
|
9388
9451
|
if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion < 6) sourceDocument = upgradeTaskNodes(sourceDocument);
|
|
9389
9452
|
sourceDocument = record(normalizeDocument(sourceDocument));
|
|
9390
9453
|
const bindings = record(sourceDocument.bindings);
|
|
9391
9454
|
const sourceGraph = repairGraph(sourceDocument.graph, bindings);
|
|
9392
9455
|
return decodeRevisionContent({
|
|
9393
|
-
modelVersion:
|
|
9456
|
+
modelVersion: 13,
|
|
9394
9457
|
document: {
|
|
9395
9458
|
bindings: repairedEntries(sourceDocument.bindings, binding),
|
|
9396
9459
|
graph: sourceGraph
|
|
@@ -9406,7 +9469,7 @@ function decodeRevisionContent(value) {
|
|
|
9406
9469
|
checkJsonDepth(value);
|
|
9407
9470
|
const content = revision.parse(value);
|
|
9408
9471
|
checkModelVersion(content);
|
|
9409
|
-
|
|
9472
|
+
assertDocumentHttpAuthBindings(content.document);
|
|
9410
9473
|
return content;
|
|
9411
9474
|
}
|
|
9412
9475
|
function decodeRevisionEnvelope(value) {
|
|
@@ -9418,7 +9481,7 @@ function decodeRevisionEnvelope(value) {
|
|
|
9418
9481
|
} : value;
|
|
9419
9482
|
const content = envelope$1.parse(candidate);
|
|
9420
9483
|
checkModelVersion(content);
|
|
9421
|
-
|
|
9484
|
+
assertDocumentHttpAuthBindings(content.document);
|
|
9422
9485
|
return {
|
|
9423
9486
|
modelVersion: content.modelVersion,
|
|
9424
9487
|
document: content.document,
|
|
@@ -9592,6 +9655,8 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
|
|
|
9592
9655
|
...shape
|
|
9593
9656
|
})])).values()])).min(1);
|
|
9594
9657
|
function checkModelVersion(content) {
|
|
9658
|
+
if (content.modelVersion < 13 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind === "task" && "executor" in candidateNode.task && candidateNode.task.executor.kind === "dedupe")) throw new Error("Deduplication requires Flow model v13.");
|
|
9659
|
+
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.");
|
|
9595
9660
|
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.");
|
|
9596
9661
|
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.");
|
|
9597
9662
|
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.");
|
|
@@ -9607,6 +9672,9 @@ function checkModelVersion(content) {
|
|
|
9607
9672
|
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.");
|
|
9608
9673
|
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.");
|
|
9609
9674
|
}
|
|
9675
|
+
function assertDocumentHttpAuthBindings(content) {
|
|
9676
|
+
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);
|
|
9677
|
+
}
|
|
9610
9678
|
//#endregion
|
|
9611
9679
|
//#region src/flow/common/condition.ts
|
|
9612
9680
|
function clearConditionBinding(operand) {
|
|
@@ -9649,10 +9717,10 @@ function upgradeRevisionContent(content) {
|
|
|
9649
9717
|
function upgradeDecodedRevisionContent(content) {
|
|
9650
9718
|
const graph = content.document.graph;
|
|
9651
9719
|
const hasManual = Object.values(graph.nodes).some((node) => node.kind == "manual");
|
|
9652
|
-
if (!hasManual && content.modelVersion ==
|
|
9720
|
+
if (!hasManual && content.modelVersion == 13) return content;
|
|
9653
9721
|
return {
|
|
9654
9722
|
...content,
|
|
9655
|
-
modelVersion:
|
|
9723
|
+
modelVersion: 13,
|
|
9656
9724
|
document: {
|
|
9657
9725
|
...content.document,
|
|
9658
9726
|
graph: hasManual ? {
|
|
@@ -9728,7 +9796,7 @@ function clearNodeConnections(graph, connectionId) {
|
|
|
9728
9796
|
return [id, node];
|
|
9729
9797
|
}
|
|
9730
9798
|
const capabilities = node.task.capabilities?.map((capability) => {
|
|
9731
|
-
if (capability.kind == "workflow") return capability;
|
|
9799
|
+
if (capability.kind == "workflow" || capability.kind == "http") return capability;
|
|
9732
9800
|
if (!("mode" in capability)) {
|
|
9733
9801
|
if ("action" in capability) {
|
|
9734
9802
|
const { connectionId: selected, ...rest } = capability;
|
|
@@ -10224,7 +10292,7 @@ function revisionRepairKind(bytes) {
|
|
|
10224
10292
|
return;
|
|
10225
10293
|
}
|
|
10226
10294
|
const source = value;
|
|
10227
|
-
return typeof source.modelVersion == "number" && source.modelVersion <
|
|
10295
|
+
return typeof source.modelVersion == "number" && source.modelVersion < 13 ? "upgrade" : "repair";
|
|
10228
10296
|
}
|
|
10229
10297
|
function repairRevision(bytes) {
|
|
10230
10298
|
return repairRevisionEnvelope(revisionValue(bytes));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FixedInputValue, InputValues, InputMapping, JsonValue } from './flow-
|
|
1
|
+
import type { FixedInputValue, InputValues, InputMapping, JsonValue } from './flow-model.js';
|
|
2
2
|
/** An explicit clear suppresses the default; absent mappings still inherit it. */
|
|
3
3
|
export declare function inputValue(mapping: InputMapping | undefined, fallback: JsonValue | undefined): JsonValue | undefined;
|
|
4
4
|
/** Converts explicit user values at authoring boundaries, never persisted legacy data. */
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { JsonValue, Port, PortDefinition } from '../index.js';
|
|
2
|
+
export type { JsonValue, Port, PortDefinition } from '../index.js';
|
|
3
|
+
/** Primitives shared by every node family. Node unions and graph operations belong to change.ts. */
|
|
4
|
+
export interface RetryConfiguration {
|
|
5
|
+
readonly maxRetries: number;
|
|
6
|
+
readonly intervalMs: number;
|
|
7
|
+
}
|
|
8
|
+
export interface InputPortDefinition extends PortDefinition {
|
|
9
|
+
readonly value?: JsonValue;
|
|
10
|
+
}
|
|
11
|
+
export interface InputPort extends InputPortDefinition {
|
|
12
|
+
readonly handle: string;
|
|
13
|
+
}
|
|
14
|
+
export interface Group {
|
|
15
|
+
readonly collapsed?: boolean;
|
|
16
|
+
readonly group: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function portsByHandle<Value extends Port>(ports: readonly (Value | Group)[]): Readonly<Record<string, Value>>;
|
|
19
|
+
export interface NodeSource {
|
|
20
|
+
readonly system?: true;
|
|
21
|
+
readonly field?: string;
|
|
22
|
+
readonly kind: 'node';
|
|
23
|
+
readonly nodeId: string;
|
|
24
|
+
readonly output: string;
|
|
25
|
+
}
|
|
26
|
+
export interface BindingSource {
|
|
27
|
+
readonly bindingId: string;
|
|
28
|
+
readonly kind: 'binding';
|
|
29
|
+
}
|
|
30
|
+
export type FixedInputValue = {
|
|
31
|
+
readonly kind: 'unset';
|
|
32
|
+
} | {
|
|
33
|
+
readonly kind: 'value';
|
|
34
|
+
readonly value: JsonValue;
|
|
35
|
+
};
|
|
36
|
+
export type InputValues = Readonly<Record<string, FixedInputValue>>;
|
|
37
|
+
export type InputMapping = FixedInputValue | {
|
|
38
|
+
readonly kind: 'sources';
|
|
39
|
+
readonly sources: readonly (BindingSource | NodeSource)[];
|
|
40
|
+
};
|
|
41
|
+
export interface GraphNodeBase {
|
|
42
|
+
readonly description?: string;
|
|
43
|
+
readonly icon?: string;
|
|
44
|
+
readonly inputs: Readonly<Record<string, InputMapping>>;
|
|
45
|
+
readonly name?: string;
|
|
46
|
+
readonly maxExecutions?: number;
|
|
47
|
+
readonly timeoutMs?: number;
|
|
48
|
+
readonly retry?: RetryConfiguration;
|
|
49
|
+
readonly onError?: 'stop' | 'error';
|
|
50
|
+
}
|
|
51
|
+
export type Source = BindingSource | NodeSource;
|
|
52
|
+
export interface WorkflowCapability {
|
|
53
|
+
readonly kind: 'workflow';
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly flowId: string;
|
|
56
|
+
readonly revisionId: string;
|
|
57
|
+
readonly inputs: readonly Port[];
|
|
58
|
+
readonly outputs: readonly Port[] | null;
|
|
59
|
+
}
|
|
60
|
+
/** Hosts that Code may call through `context.fetch`; requires Flow model 12 and Engine v9. */
|
|
61
|
+
export interface HttpCapability {
|
|
62
|
+
readonly kind: 'http';
|
|
63
|
+
readonly hosts: readonly string[];
|
|
64
|
+
}
|
|
65
|
+
export type TaskCapability = ConnectorCapability | WorkflowCapability | HttpCapability;
|
|
66
|
+
export interface ConnectorAccessCapability {
|
|
67
|
+
readonly actionHints?: readonly string[];
|
|
68
|
+
readonly connectionHints?: readonly {
|
|
69
|
+
readonly action: string;
|
|
70
|
+
readonly connectionId: string;
|
|
71
|
+
readonly alias?: string;
|
|
72
|
+
}[];
|
|
73
|
+
readonly kind: 'connector';
|
|
74
|
+
}
|
|
75
|
+
export interface ConnectorActionCapability {
|
|
76
|
+
readonly action: string;
|
|
77
|
+
readonly connections: readonly {
|
|
78
|
+
readonly connectionId: string;
|
|
79
|
+
readonly alias?: string;
|
|
80
|
+
}[];
|
|
81
|
+
readonly connectionId?: string;
|
|
82
|
+
readonly kind: 'connector';
|
|
83
|
+
}
|
|
84
|
+
export type ConnectorPermissionCapability = {
|
|
85
|
+
readonly kind: 'connector';
|
|
86
|
+
readonly mode: 'shared';
|
|
87
|
+
} | {
|
|
88
|
+
readonly kind: 'connector';
|
|
89
|
+
readonly mode: 'independent';
|
|
90
|
+
readonly actions: readonly {
|
|
91
|
+
readonly action: string;
|
|
92
|
+
readonly connectionId?: string;
|
|
93
|
+
}[];
|
|
94
|
+
};
|
|
95
|
+
export type ConnectorCapability = ConnectorAccessCapability | ConnectorActionCapability | ConnectorPermissionCapability;
|
|
96
|
+
export interface TaskDefinitionBase {
|
|
97
|
+
readonly inputs: readonly (InputPort | Group)[];
|
|
98
|
+
readonly name: string;
|
|
99
|
+
readonly outputs: readonly (Port | Group)[];
|
|
100
|
+
}
|
|
101
|
+
export interface InlineTaskDefinition extends TaskDefinitionBase {
|
|
102
|
+
readonly capabilities?: readonly TaskCapability[];
|
|
103
|
+
readonly moduleId: string;
|
|
104
|
+
}
|
|
105
|
+
/** The executor shape every managed Task shares; each node family narrows it with its own executor. */
|
|
106
|
+
export interface TaskExecutor {
|
|
107
|
+
readonly kind: string;
|
|
108
|
+
}
|
|
109
|
+
export interface ManagedTaskDefinitionOf<Executor extends TaskExecutor> extends TaskDefinitionBase {
|
|
110
|
+
readonly executor: Executor;
|
|
111
|
+
}
|
|
112
|
+
export interface WorkflowExecutor {
|
|
113
|
+
readonly kind: 'workflow';
|
|
114
|
+
readonly flowId: string;
|
|
115
|
+
readonly revisionId: string;
|
|
116
|
+
}
|
|
117
|
+
export interface CodeModule {
|
|
118
|
+
readonly imports: readonly string[];
|
|
119
|
+
readonly name: string;
|
|
120
|
+
readonly source: string;
|
|
121
|
+
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { GraphNode } from './flow-change.js';
|
|
2
|
+
import type { RetryConfiguration } from './flow-model.js';
|
|
2
3
|
import { z } from 'zod';
|
|
3
|
-
export
|
|
4
|
-
readonly maxRetries: number;
|
|
5
|
-
readonly intervalMs: number;
|
|
6
|
-
}
|
|
4
|
+
export type { RetryConfiguration } from './flow-model.js';
|
|
7
5
|
export declare const retryNodeTypes: readonly ['code', 'connector', 'openapi', 'http-request', 'llm', 'decision'];
|
|
8
6
|
export declare const nodeRetryLimits: {
|
|
9
7
|
readonly maxRetries: 5;
|