@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
package/dist/common/mcp.js
CHANGED
|
@@ -8693,16 +8693,10 @@ function isSchemaKeyword(value) {
|
|
|
8693
8693
|
/** Shared by decision entry points, the editor, and durable decision storage. */
|
|
8694
8694
|
var waitCommentSchema = string$1().trim().refine((value) => [...value].length <= 2e3, "Wait comment must contain at most 2,000 Unicode code points.").nullable().optional();
|
|
8695
8695
|
//#endregion
|
|
8696
|
-
//#region src/http/common/authBindings.ts
|
|
8697
|
-
/** Never allow credentials to enter a Revision as literal node inputs. */
|
|
8698
|
-
function assertHttpAuthBindings(document) {
|
|
8699
|
-
for (const node of Object.values(document.graph.nodes)) {
|
|
8700
|
-
if (node.kind != "task" || !("executor" in node.task) || !["openapi", "http-request"].includes(node.task.executor.kind)) continue;
|
|
8701
|
-
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.");
|
|
8702
|
-
}
|
|
8703
|
-
}
|
|
8704
|
-
//#endregion
|
|
8705
8696
|
//#region src/decision/common/decision.ts
|
|
8697
|
+
function isDecisionExecutor(executor) {
|
|
8698
|
+
return executor.kind === "decision";
|
|
8699
|
+
}
|
|
8706
8700
|
var decisionLimits = {
|
|
8707
8701
|
choice: 255,
|
|
8708
8702
|
score: 10
|
|
@@ -8725,7 +8719,7 @@ function limitDecisionQuestions(questions) {
|
|
|
8725
8719
|
}
|
|
8726
8720
|
/** Loading an oversized task also updates its previously generated output schemas. */
|
|
8727
8721
|
function limitDecisionTask(task) {
|
|
8728
|
-
if (task.executor
|
|
8722
|
+
if (!isDecisionExecutor(task.executor)) return task;
|
|
8729
8723
|
const original = task.executor.questions;
|
|
8730
8724
|
const questions = limitDecisionQuestions(original);
|
|
8731
8725
|
if (questions === original) return task;
|
|
@@ -8792,6 +8786,20 @@ function answerSchema(question) {
|
|
|
8792
8786
|
};
|
|
8793
8787
|
}
|
|
8794
8788
|
//#endregion
|
|
8789
|
+
//#region src/http/common/authBindings.ts
|
|
8790
|
+
/** Never allow credentials to enter a Revision as literal inputs of an OpenAPI or HTTP request node. */
|
|
8791
|
+
function assertHttpAuthBindings(inputs) {
|
|
8792
|
+
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.");
|
|
8793
|
+
}
|
|
8794
|
+
//#endregion
|
|
8795
|
+
//#region src/http/common/hosts.ts
|
|
8796
|
+
/** Hosts of a Code `http` Capability: lowercase DNS names or IPv4 addresses; `*.example.com` matches subdomains only. */
|
|
8797
|
+
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])?$/;
|
|
8798
|
+
/** Wildcards must name a registrable suffix, so `*.com` is rejected. */
|
|
8799
|
+
function isHttpHost(value) {
|
|
8800
|
+
return httpHostPattern.test(value) && (!value.startsWith("*.") || value.slice(2).includes("."));
|
|
8801
|
+
}
|
|
8802
|
+
//#endregion
|
|
8795
8803
|
//#region src/http/common/httpRequest.ts
|
|
8796
8804
|
var parameterSchema = strictObject({
|
|
8797
8805
|
mode: _enum(["fields", "object"]).default("fields"),
|
|
@@ -8838,6 +8846,54 @@ var httpRequestConfigSchema = strictObject({
|
|
|
8838
8846
|
statusPolicy: _enum(["success", "all"]).default("success")
|
|
8839
8847
|
});
|
|
8840
8848
|
var httpRequestExecutorSchema = httpRequestConfigSchema.extend({ kind: literal("http-request") });
|
|
8849
|
+
//#endregion
|
|
8850
|
+
//#region src/state/common/state.ts
|
|
8851
|
+
var stateQuerySchema = strictObject({
|
|
8852
|
+
scope: _enum(["draft", "live"]),
|
|
8853
|
+
values: boolean().optional()
|
|
8854
|
+
});
|
|
8855
|
+
var stateClearSchema = strictObject({
|
|
8856
|
+
scope: _enum(["draft", "live"]),
|
|
8857
|
+
key: string$1().min(1).refine((key) => new TextEncoder().encode(key).length <= 256).optional()
|
|
8858
|
+
});
|
|
8859
|
+
var dedupeClearSchema = strictObject({
|
|
8860
|
+
scope: _enum(["draft", "live"]),
|
|
8861
|
+
space: string$1().regex(/^(flow|node:.+)$/)
|
|
8862
|
+
});
|
|
8863
|
+
var dedupeConfigSchema = strictObject({
|
|
8864
|
+
field: string$1().default(""),
|
|
8865
|
+
mode: _enum(["new", "increasing"]).default("new"),
|
|
8866
|
+
space: _enum(["node", "flow"]).default("node")
|
|
8867
|
+
});
|
|
8868
|
+
var dedupeExecutorSchema = dedupeConfigSchema.extend({ kind: literal("dedupe") });
|
|
8869
|
+
var flowStateViewSchema = object({
|
|
8870
|
+
version: literal(1),
|
|
8871
|
+
scope: _enum(["draft", "live"]),
|
|
8872
|
+
limits: object({
|
|
8873
|
+
maxValueBytes: number().positive(),
|
|
8874
|
+
maxValues: number().int().positive(),
|
|
8875
|
+
maxSpaces: number().int().positive(),
|
|
8876
|
+
maxIdentities: number().positive(),
|
|
8877
|
+
maxRunWrites: number().positive()
|
|
8878
|
+
}),
|
|
8879
|
+
values: array(object({
|
|
8880
|
+
key: string$1(),
|
|
8881
|
+
size: number().nonnegative(),
|
|
8882
|
+
updatedAt: number(),
|
|
8883
|
+
value: json$4().optional()
|
|
8884
|
+
})),
|
|
8885
|
+
spaces: array(object({
|
|
8886
|
+
space: string$1(),
|
|
8887
|
+
mode: _enum(["new", "increasing"]),
|
|
8888
|
+
count: number().nonnegative(),
|
|
8889
|
+
watermark: union([
|
|
8890
|
+
string$1(),
|
|
8891
|
+
number(),
|
|
8892
|
+
_null()
|
|
8893
|
+
]),
|
|
8894
|
+
updatedAt: number()
|
|
8895
|
+
}))
|
|
8896
|
+
});
|
|
8841
8897
|
function checkJsonDepth(value, depth = 0) {
|
|
8842
8898
|
if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
|
|
8843
8899
|
if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
|
|
@@ -9007,7 +9063,15 @@ var workflowCapabilitySchema = strictObject({
|
|
|
9007
9063
|
inputs: array(port$1),
|
|
9008
9064
|
outputs: array(port$1).nullable()
|
|
9009
9065
|
});
|
|
9010
|
-
var
|
|
9066
|
+
var httpCapabilitySchema = strictObject({
|
|
9067
|
+
kind: literal("http"),
|
|
9068
|
+
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.")
|
|
9069
|
+
});
|
|
9070
|
+
var capability = union([
|
|
9071
|
+
connectorCapabilitySchema,
|
|
9072
|
+
workflowCapabilitySchema,
|
|
9073
|
+
httpCapabilitySchema
|
|
9074
|
+
]);
|
|
9011
9075
|
var inline = object({
|
|
9012
9076
|
...ports$1,
|
|
9013
9077
|
name: text,
|
|
@@ -9118,7 +9182,8 @@ var managedFields = object({
|
|
|
9118
9182
|
flowId: text,
|
|
9119
9183
|
revisionId: text
|
|
9120
9184
|
}),
|
|
9121
|
-
httpRequestExecutorSchema
|
|
9185
|
+
httpRequestExecutorSchema,
|
|
9186
|
+
dedupeExecutorSchema
|
|
9122
9187
|
])
|
|
9123
9188
|
});
|
|
9124
9189
|
var managed = managedFields.transform(limitDecisionTask);
|
|
@@ -9387,7 +9452,9 @@ var revision = object({
|
|
|
9387
9452
|
literal(8),
|
|
9388
9453
|
literal(9),
|
|
9389
9454
|
literal(10),
|
|
9390
|
-
literal(11)
|
|
9455
|
+
literal(11),
|
|
9456
|
+
literal(12),
|
|
9457
|
+
literal(13)
|
|
9391
9458
|
]),
|
|
9392
9459
|
document,
|
|
9393
9460
|
modules: record$2(text, module)
|
|
@@ -9418,7 +9485,7 @@ function decodeRevisionContent(value) {
|
|
|
9418
9485
|
checkJsonDepth(value);
|
|
9419
9486
|
const content = revision.parse(value);
|
|
9420
9487
|
checkModelVersion(content);
|
|
9421
|
-
|
|
9488
|
+
assertDocumentHttpAuthBindings(content.document);
|
|
9422
9489
|
return content;
|
|
9423
9490
|
}
|
|
9424
9491
|
var shapes = {
|
|
@@ -9588,6 +9655,8 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
|
|
|
9588
9655
|
...shape
|
|
9589
9656
|
})])).values()])).min(1);
|
|
9590
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.");
|
|
9591
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.");
|
|
9592
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.");
|
|
9593
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.");
|
|
@@ -9603,6 +9672,9 @@ function checkModelVersion(content) {
|
|
|
9603
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.");
|
|
9604
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.");
|
|
9605
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
|
+
}
|
|
9606
9678
|
function resourceNameIssue(value) {
|
|
9607
9679
|
const name = value.trim();
|
|
9608
9680
|
if (name.length == 0) return "empty";
|
|
@@ -9614,6 +9686,84 @@ function resourceNameIssue(value) {
|
|
|
9614
9686
|
if (!/^[\p{L}\p{N}](?:[\p{L}\p{N} _-]*[\p{L}\p{N}])?$/u.test(name)) return "specialCharacter";
|
|
9615
9687
|
}
|
|
9616
9688
|
//#endregion
|
|
9689
|
+
//#region src/runtime/common/engineContract.ts
|
|
9690
|
+
/** v10 adds persistent Flow State to the published v9 Node compatibility and fetch contract. */
|
|
9691
|
+
var currentEngineContract = "open-flow-engine/v10";
|
|
9692
|
+
/** The published v8 Node compatibility contract, retained for existing Publications and Runs. */
|
|
9693
|
+
var nodejsEngineContract = "open-flow-engine/v8/nodejs-compat-v1";
|
|
9694
|
+
var platformSource = (contract) => `export const engineContract = ${JSON.stringify(contract)}
|
|
9695
|
+
export function identity(value) { return value }
|
|
9696
|
+
`;
|
|
9697
|
+
var v8Contract = {
|
|
9698
|
+
workflowTools: true,
|
|
9699
|
+
httpRequests: true,
|
|
9700
|
+
waitAutoContinue: true,
|
|
9701
|
+
webhookResponses: true,
|
|
9702
|
+
platformExports: /* @__PURE__ */ new Set(["engineContract", "identity"]),
|
|
9703
|
+
platformModule: "open-flow:platform",
|
|
9704
|
+
platformSource: platformSource("open-flow-engine/v8")
|
|
9705
|
+
};
|
|
9706
|
+
var nodejsContract = {
|
|
9707
|
+
...v8Contract,
|
|
9708
|
+
builtinModules: new Set([
|
|
9709
|
+
"assert",
|
|
9710
|
+
"assert/strict",
|
|
9711
|
+
"buffer",
|
|
9712
|
+
"console",
|
|
9713
|
+
"constants",
|
|
9714
|
+
"crypto",
|
|
9715
|
+
"events",
|
|
9716
|
+
"fs",
|
|
9717
|
+
"fs/promises",
|
|
9718
|
+
"os",
|
|
9719
|
+
"path",
|
|
9720
|
+
"path/posix",
|
|
9721
|
+
"process",
|
|
9722
|
+
"punycode",
|
|
9723
|
+
"querystring",
|
|
9724
|
+
"stream",
|
|
9725
|
+
"stream/promises",
|
|
9726
|
+
"stream/web",
|
|
9727
|
+
"string_decoder",
|
|
9728
|
+
"timers",
|
|
9729
|
+
"timers/promises",
|
|
9730
|
+
"url",
|
|
9731
|
+
"util",
|
|
9732
|
+
"zlib"
|
|
9733
|
+
].flatMap((name) => [name, `node:${name}`])),
|
|
9734
|
+
platformSource: platformSource(nodejsEngineContract)
|
|
9735
|
+
};
|
|
9736
|
+
var v9Contract = {
|
|
9737
|
+
...nodejsContract,
|
|
9738
|
+
codeFetch: true,
|
|
9739
|
+
platformSource: platformSource("open-flow-engine/v9")
|
|
9740
|
+
};
|
|
9741
|
+
var currentContract = {
|
|
9742
|
+
...v9Contract,
|
|
9743
|
+
flowState: true,
|
|
9744
|
+
platformSource: platformSource(currentEngineContract)
|
|
9745
|
+
};
|
|
9746
|
+
function findEngineContract(contract) {
|
|
9747
|
+
if (contract == "open-flow-engine/v10") return currentContract;
|
|
9748
|
+
if (contract == "open-flow-engine/v9") return v9Contract;
|
|
9749
|
+
if (contract == "open-flow-engine/v8") return v8Contract;
|
|
9750
|
+
if (contract == "open-flow-engine/v8/nodejs-compat-v1") return nodejsContract;
|
|
9751
|
+
if (contract == "open-flow-engine/v7" || contract == "open-flow-engine/v7/nodejs-compat-v1") return {
|
|
9752
|
+
...contract.endsWith("/nodejs-compat-v1") ? nodejsContract : v8Contract,
|
|
9753
|
+
workflowTools: false,
|
|
9754
|
+
httpRequests: false,
|
|
9755
|
+
platformSource: platformSource(contract)
|
|
9756
|
+
};
|
|
9757
|
+
if (contract == "open-flow-engine/v6" || contract == "open-flow-engine/v6/nodejs-compat-v1") return {
|
|
9758
|
+
...contract == "open-flow-engine/v6" ? v8Contract : nodejsContract,
|
|
9759
|
+
workflowTools: false,
|
|
9760
|
+
httpRequests: false,
|
|
9761
|
+
waitAutoContinue: false,
|
|
9762
|
+
webhookResponses: false,
|
|
9763
|
+
platformSource: platformSource(contract)
|
|
9764
|
+
};
|
|
9765
|
+
}
|
|
9766
|
+
//#endregion
|
|
9617
9767
|
//#region src/control/common/authoringLlm.ts
|
|
9618
9768
|
var authoringLlmConfiguration = strictObject({
|
|
9619
9769
|
mode: _enum(["chat", "json"]),
|
|
@@ -9642,9 +9792,9 @@ var authoringOpenApiSchema = strictObject({
|
|
|
9642
9792
|
});
|
|
9643
9793
|
//#endregion
|
|
9644
9794
|
//#region src/control/common/authoringSchema.ts
|
|
9645
|
-
var id$
|
|
9795
|
+
var id$3 = string$1().min(1);
|
|
9646
9796
|
var json$2 = json$4();
|
|
9647
|
-
var patch = record$2(id$
|
|
9797
|
+
var patch = record$2(id$3, json$2);
|
|
9648
9798
|
var type = _enum([
|
|
9649
9799
|
"start",
|
|
9650
9800
|
"outputs",
|
|
@@ -9662,16 +9812,17 @@ var type = _enum([
|
|
|
9662
9812
|
"decision",
|
|
9663
9813
|
"openapi",
|
|
9664
9814
|
"http-request",
|
|
9815
|
+
"dedupe",
|
|
9665
9816
|
"condition",
|
|
9666
9817
|
"value",
|
|
9667
9818
|
"wait",
|
|
9668
9819
|
"approval"
|
|
9669
9820
|
]);
|
|
9670
|
-
var referenceSchema = id$
|
|
9821
|
+
var referenceSchema = id$3.describe("An existing node reference returned by read/search, or $alias for a preceding node.add in this edit batch. For node.add.as \"step\", reference \"$step\", never bare \"step\". Aliases are local to one batch.");
|
|
9671
9822
|
var output = strictObject({
|
|
9672
9823
|
kind: literal("output"),
|
|
9673
9824
|
node: referenceSchema,
|
|
9674
|
-
port: id$
|
|
9825
|
+
port: id$3.optional().describe("Omit for a node with one output. For multiple outputs, choose a name from node details."),
|
|
9675
9826
|
field: string$1().optional()
|
|
9676
9827
|
});
|
|
9677
9828
|
var system = strictObject({
|
|
@@ -9682,7 +9833,7 @@ var system = strictObject({
|
|
|
9682
9833
|
});
|
|
9683
9834
|
var variable$1 = strictObject({
|
|
9684
9835
|
kind: literal("variable"),
|
|
9685
|
-
name: id$
|
|
9836
|
+
name: id$3
|
|
9686
9837
|
});
|
|
9687
9838
|
var authoringSourceSchema = union([
|
|
9688
9839
|
output,
|
|
@@ -9713,7 +9864,7 @@ var operand = union([
|
|
|
9713
9864
|
system,
|
|
9714
9865
|
variable$1
|
|
9715
9866
|
]);
|
|
9716
|
-
var toolSources = record$2(id$
|
|
9867
|
+
var toolSources = record$2(id$3, 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.");
|
|
9717
9868
|
var agentTool = union([workflowAgentToolSchema.omit({
|
|
9718
9869
|
id: true,
|
|
9719
9870
|
inputs: true,
|
|
@@ -9723,20 +9874,24 @@ var agentTool = union([workflowAgentToolSchema.omit({
|
|
|
9723
9874
|
id: true,
|
|
9724
9875
|
inputs: true
|
|
9725
9876
|
}).extend({ inputs: toolSources }).strict()]);
|
|
9726
|
-
var authoringCapabilities = array(union([
|
|
9727
|
-
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9877
|
+
var authoringCapabilities = array(union([
|
|
9878
|
+
connectorCapabilitySchema,
|
|
9879
|
+
strictObject({
|
|
9880
|
+
kind: literal("workflow"),
|
|
9881
|
+
name: id$3,
|
|
9882
|
+
flowId: id$3
|
|
9883
|
+
}),
|
|
9884
|
+
httpCapabilitySchema
|
|
9885
|
+
]));
|
|
9731
9886
|
var notification = strictObject({
|
|
9732
9887
|
...authoringDefinitionSchemas.connector.shape,
|
|
9733
|
-
messageHandle: id$
|
|
9734
|
-
inputs: record$2(id$
|
|
9888
|
+
messageHandle: id$3,
|
|
9889
|
+
inputs: record$2(id$3, union([strictObject({
|
|
9735
9890
|
kind: literal("value"),
|
|
9736
9891
|
value: json$2
|
|
9737
9892
|
}), strictObject({
|
|
9738
9893
|
kind: literal("input"),
|
|
9739
|
-
input: id$
|
|
9894
|
+
input: id$3
|
|
9740
9895
|
})]))
|
|
9741
9896
|
});
|
|
9742
9897
|
var field = strictObject({
|
|
@@ -9744,14 +9899,14 @@ var field = strictObject({
|
|
|
9744
9899
|
nullable: boolean().optional(),
|
|
9745
9900
|
description: string$1().optional()
|
|
9746
9901
|
});
|
|
9747
|
-
var inputFields = record$2(id$
|
|
9748
|
-
var flowInputFields = record$2(id$
|
|
9902
|
+
var inputFields = record$2(id$3, field.extend({ default: json$2.optional() })).describe("Optional business input constraints by name. A binding to a new Code, Agent, LLM, Wait or Approval input automatically declares an input accepting any JSON. Existing constraints are preserved. Omitted schema accepts any JSON; omitted nullable is true. Use default for inherited values; input.set supplies data.");
|
|
9903
|
+
var flowInputFields = record$2(id$3, field).describe("Workflow input definitions by name. Omitted schema accepts any JSON; omitted nullable is true. No defaults. Supply call values as trigger.outputs.");
|
|
9749
9904
|
var flowOutputFields = flowInputFields.describe("Workflow output definitions by name. Omitted schema accepts any JSON; omitted nullable is true. No defaults. Set values on the Outputs node with input.set or node.add.inputs.");
|
|
9750
|
-
var flowInputFieldsView = record$2(id$
|
|
9905
|
+
var flowInputFieldsView = record$2(id$3, field.extend({
|
|
9751
9906
|
schema: json$2,
|
|
9752
9907
|
nullable: boolean()
|
|
9753
9908
|
}));
|
|
9754
|
-
var outputFields = record$2(id$
|
|
9909
|
+
var outputFields = record$2(id$3, field).describe("Code return fields by name. Omitted schema accepts any JSON; omitted nullable is true.");
|
|
9755
9910
|
var expression = strictObject({
|
|
9756
9911
|
left: operand,
|
|
9757
9912
|
operator: authoringDefinitionSchemas.condition.shape.cases.element.shape.groups.element.shape.expressions.element.shape.operator,
|
|
@@ -9765,20 +9920,20 @@ var when = union([
|
|
|
9765
9920
|
]);
|
|
9766
9921
|
var authoringConfigurations = {
|
|
9767
9922
|
"webhook-response": strictObject({}),
|
|
9768
|
-
"workflow": strictObject({ flowId: id$
|
|
9923
|
+
"workflow": strictObject({ flowId: id$3 }),
|
|
9769
9924
|
"start": strictObject({ inputDefs: flowInputFields.default({}) }),
|
|
9770
9925
|
"outputs": strictObject({ outputDefs: flowOutputFields.default({}) }),
|
|
9771
|
-
"error": strictObject({ sourceFlowIds: array(id$
|
|
9926
|
+
"error": strictObject({ sourceFlowIds: array(id$3).optional() }),
|
|
9772
9927
|
"webhook": authoringDefinitionSchemas.webhook.omit({ bodyFields: true }).extend({ body: inputFields }).strict(),
|
|
9773
9928
|
"cron": strictObject({ schedule: authoringDefinitionSchemas.schedule }),
|
|
9774
9929
|
"poll": strictObject({
|
|
9775
|
-
key: id$
|
|
9776
|
-
connectionId: id$
|
|
9930
|
+
key: id$3,
|
|
9931
|
+
connectionId: id$3.optional(),
|
|
9777
9932
|
schedule: authoringDefinitionSchemas.schedule
|
|
9778
9933
|
}),
|
|
9779
9934
|
"integration": strictObject({
|
|
9780
|
-
key: id$
|
|
9781
|
-
connectionId: id$
|
|
9935
|
+
key: id$3,
|
|
9936
|
+
connectionId: id$3.optional()
|
|
9782
9937
|
}),
|
|
9783
9938
|
"code": strictObject({
|
|
9784
9939
|
inputs: inputFields,
|
|
@@ -9788,6 +9943,7 @@ var authoringConfigurations = {
|
|
|
9788
9943
|
"connector": authoringDefinitionSchemas.connector.omit({ outputMode: true }).strict(),
|
|
9789
9944
|
"openapi": authoringOpenApiSchema,
|
|
9790
9945
|
"http-request": httpRequestConfigSchema,
|
|
9946
|
+
"dedupe": dedupeConfigSchema,
|
|
9791
9947
|
"agent": authoringDefinitionSchemas.agent.omit({
|
|
9792
9948
|
prompt: true,
|
|
9793
9949
|
tools: true
|
|
@@ -9802,7 +9958,7 @@ var authoringConfigurations = {
|
|
|
9802
9958
|
"condition": strictObject({
|
|
9803
9959
|
match: _enum(["first", "all"]),
|
|
9804
9960
|
branches: array(strictObject({
|
|
9805
|
-
name: id$
|
|
9961
|
+
name: id$3,
|
|
9806
9962
|
description: string$1().optional(),
|
|
9807
9963
|
when
|
|
9808
9964
|
}))
|
|
@@ -9819,7 +9975,7 @@ var authoringConfigurations = {
|
|
|
9819
9975
|
};
|
|
9820
9976
|
var updates = strictObject({
|
|
9821
9977
|
onError: _enum(["stop", "error"]).optional(),
|
|
9822
|
-
name: id$
|
|
9978
|
+
name: id$3.optional(),
|
|
9823
9979
|
description: string$1().optional(),
|
|
9824
9980
|
icon: string$1().optional(),
|
|
9825
9981
|
maxExecutions: int().positive().optional(),
|
|
@@ -9830,13 +9986,13 @@ var updates = strictObject({
|
|
|
9830
9986
|
var authoringEditSchema = discriminatedUnion("op", [
|
|
9831
9987
|
strictObject({
|
|
9832
9988
|
op: literal("node.add"),
|
|
9833
|
-
as: id$
|
|
9989
|
+
as: id$3.regex(/^[A-Za-z][\w-]*$/).describe("Unique batch-local alias without the $ prefix. Later edits must reference this new node as $alias; the bare alias is not its node ID."),
|
|
9834
9990
|
type,
|
|
9835
|
-
name: id$
|
|
9991
|
+
name: id$3,
|
|
9836
9992
|
onError: _enum(["stop", "error"]).optional(),
|
|
9837
9993
|
retry: retryConfigurationSchema.optional(),
|
|
9838
9994
|
config: patch.optional(),
|
|
9839
|
-
inputs: record$2(id$
|
|
9995
|
+
inputs: record$2(id$3, authoringSourceSchema).optional().describe("Input data sources, applied after creation, as input.set operations. Execution edges are separate."),
|
|
9840
9996
|
code: string$1().optional(),
|
|
9841
9997
|
prompt: string$1().optional()
|
|
9842
9998
|
}),
|
|
@@ -9844,12 +10000,12 @@ var authoringEditSchema = discriminatedUnion("op", [
|
|
|
9844
10000
|
op: literal("node.update"),
|
|
9845
10001
|
node: referenceSchema,
|
|
9846
10002
|
set: updates.optional(),
|
|
9847
|
-
clear: array(array(id$
|
|
10003
|
+
clear: array(array(id$3).min(1)).optional()
|
|
9848
10004
|
}),
|
|
9849
10005
|
strictObject({
|
|
9850
10006
|
op: literal("node.refresh"),
|
|
9851
10007
|
node: referenceSchema,
|
|
9852
|
-
tool: id$
|
|
10008
|
+
tool: id$3.optional().describe("Name of a workflow tool on an Agent or Code node. Omit for a Call Workflow node.")
|
|
9853
10009
|
}),
|
|
9854
10010
|
strictObject({
|
|
9855
10011
|
op: literal("node.remove"),
|
|
@@ -9858,20 +10014,20 @@ var authoringEditSchema = discriminatedUnion("op", [
|
|
|
9858
10014
|
strictObject({
|
|
9859
10015
|
op: literal("input.set"),
|
|
9860
10016
|
node: referenceSchema,
|
|
9861
|
-
input: id$
|
|
10017
|
+
input: id$3,
|
|
9862
10018
|
source: authoringSourceSchema
|
|
9863
10019
|
}),
|
|
9864
10020
|
strictObject({
|
|
9865
10021
|
op: _enum(["edge.connect", "edge.disconnect"]),
|
|
9866
10022
|
source: referenceSchema,
|
|
9867
10023
|
target: referenceSchema,
|
|
9868
|
-
branch: id$
|
|
10024
|
+
branch: id$3.optional()
|
|
9869
10025
|
}),
|
|
9870
10026
|
strictObject({
|
|
9871
10027
|
op: literal("text.edit"),
|
|
9872
10028
|
node: referenceSchema,
|
|
9873
10029
|
field: _enum(["code", "prompt"]),
|
|
9874
|
-
oldText: id$
|
|
10030
|
+
oldText: id$3,
|
|
9875
10031
|
newText: string$1()
|
|
9876
10032
|
}),
|
|
9877
10033
|
strictObject({
|
|
@@ -9882,15 +10038,15 @@ var authoringEditSchema = discriminatedUnion("op", [
|
|
|
9882
10038
|
})
|
|
9883
10039
|
]);
|
|
9884
10040
|
var authoringRequestSchema = strictObject({
|
|
9885
|
-
baseRevision: id$
|
|
9886
|
-
requestId: id$
|
|
10041
|
+
baseRevision: id$3,
|
|
10042
|
+
requestId: id$3.max(256),
|
|
9887
10043
|
edits: array(authoringEditSchema).min(1).max(1e3)
|
|
9888
10044
|
});
|
|
9889
10045
|
var authoringReadSchema = strictObject({
|
|
9890
|
-
revision: id$
|
|
9891
|
-
nodes: array(id$
|
|
10046
|
+
revision: id$3.optional().describe("Fixed revision from a previous read; omit to read the current draft."),
|
|
10047
|
+
nodes: array(id$3).min(1).max(100).optional().describe("Node references to read in one batch. Mutually exclusive with text. Long texts return metadata."),
|
|
9892
10048
|
text: strictObject({
|
|
9893
|
-
node: id$
|
|
10049
|
+
node: id$3,
|
|
9894
10050
|
field: _enum(["code", "prompt"]),
|
|
9895
10051
|
start: int().positive().default(1),
|
|
9896
10052
|
lines: int().min(1).max(200).default(80)
|
|
@@ -9899,42 +10055,43 @@ var authoringReadSchema = strictObject({
|
|
|
9899
10055
|
not: { required: ["nodes", "text"] },
|
|
9900
10056
|
description: "Omit nodes and text for an outline; provide nodes for details, or text for an excerpt."
|
|
9901
10057
|
});
|
|
9902
|
-
strictObject({ revisionId: id$
|
|
10058
|
+
strictObject({ revisionId: id$3 });
|
|
9903
10059
|
var authoringSearchSchema = strictObject({
|
|
9904
|
-
revision: id$
|
|
9905
|
-
query: id$
|
|
10060
|
+
revision: id$3.optional(),
|
|
10061
|
+
query: id$3.max(1e3),
|
|
9906
10062
|
type: type.optional(),
|
|
9907
10063
|
offset: int().nonnegative().default(0),
|
|
9908
10064
|
limit: int().min(1).max(100).default(20)
|
|
9909
10065
|
});
|
|
9910
10066
|
var authoringSchemaQuery = strictObject({
|
|
9911
10067
|
type: type.optional(),
|
|
9912
|
-
action: id$
|
|
10068
|
+
action: id$3.optional()
|
|
9913
10069
|
}).refine((v) => v.type == null || v.action == null, "Choose type or action.");
|
|
10070
|
+
`${[...findEngineContract(currentEngineContract).builtinModules].filter((name) => !name.startsWith("node:")).join(", ")}`;
|
|
9914
10071
|
var authoringDiagnosticSchema = object({
|
|
9915
|
-
code: id$
|
|
10072
|
+
code: id$3,
|
|
9916
10073
|
message: string$1(),
|
|
9917
|
-
nodes: array(id$
|
|
10074
|
+
nodes: array(id$3),
|
|
9918
10075
|
field: string$1().optional(),
|
|
9919
10076
|
line: number().optional(),
|
|
9920
10077
|
column: number().optional()
|
|
9921
10078
|
});
|
|
9922
10079
|
var authoringCheckResponse = object({
|
|
9923
|
-
flowId: id$
|
|
9924
|
-
revisionId: id$
|
|
10080
|
+
flowId: id$3,
|
|
10081
|
+
revisionId: id$3,
|
|
9925
10082
|
valid: boolean(),
|
|
9926
10083
|
diagnostics: array(authoringDiagnosticSchema),
|
|
9927
10084
|
version: literal(1)
|
|
9928
10085
|
});
|
|
9929
10086
|
var authoringEditResponse = object({
|
|
9930
|
-
flowId: id$
|
|
10087
|
+
flowId: id$3,
|
|
9931
10088
|
saved: literal(true),
|
|
9932
|
-
revision: id$
|
|
9933
|
-
nodes: record$2(id$
|
|
10089
|
+
revision: id$3,
|
|
10090
|
+
nodes: record$2(id$3, id$3),
|
|
9934
10091
|
changes: array(object({
|
|
9935
10092
|
index: int(),
|
|
9936
|
-
op: id$
|
|
9937
|
-
node: id$
|
|
10093
|
+
op: id$3,
|
|
10094
|
+
node: id$3.optional()
|
|
9938
10095
|
})),
|
|
9939
10096
|
validation: object({
|
|
9940
10097
|
status: _enum([
|
|
@@ -9947,8 +10104,8 @@ var authoringEditResponse = object({
|
|
|
9947
10104
|
version: literal(1)
|
|
9948
10105
|
});
|
|
9949
10106
|
var authoringReadResponse = object({
|
|
9950
|
-
flowId: id$
|
|
9951
|
-
revision: id$
|
|
10107
|
+
flowId: id$3,
|
|
10108
|
+
revision: id$3,
|
|
9952
10109
|
data: object({
|
|
9953
10110
|
nodes: array(record$2(string$1(), json$2)).optional(),
|
|
9954
10111
|
edges: array(json$2).optional(),
|
|
@@ -9957,12 +10114,12 @@ var authoringReadResponse = object({
|
|
|
9957
10114
|
version: literal(1)
|
|
9958
10115
|
});
|
|
9959
10116
|
var authoringSearchResponse = object({
|
|
9960
|
-
flowId: id$
|
|
9961
|
-
revision: id$
|
|
10117
|
+
flowId: id$3,
|
|
10118
|
+
revision: id$3,
|
|
9962
10119
|
data: object({
|
|
9963
10120
|
matches: array(object({
|
|
9964
|
-
node: id$
|
|
9965
|
-
field: id$
|
|
10121
|
+
node: id$3.optional(),
|
|
10122
|
+
field: id$3,
|
|
9966
10123
|
line: int().optional(),
|
|
9967
10124
|
excerpt: string$1()
|
|
9968
10125
|
})),
|
|
@@ -9980,35 +10137,6 @@ var resultQuerySchema = strictObject({
|
|
|
9980
10137
|
maxBytes: number().int().min(1).max(1048576).default(15e3)
|
|
9981
10138
|
});
|
|
9982
10139
|
//#endregion
|
|
9983
|
-
//#region src/execution/common/engineContract.ts
|
|
9984
|
-
var currentEngineContract = "open-flow-engine/v8";
|
|
9985
|
-
`${JSON.stringify(currentEngineContract)}`, new Set([
|
|
9986
|
-
"assert",
|
|
9987
|
-
"assert/strict",
|
|
9988
|
-
"buffer",
|
|
9989
|
-
"console",
|
|
9990
|
-
"constants",
|
|
9991
|
-
"crypto",
|
|
9992
|
-
"events",
|
|
9993
|
-
"fs",
|
|
9994
|
-
"fs/promises",
|
|
9995
|
-
"os",
|
|
9996
|
-
"path",
|
|
9997
|
-
"path/posix",
|
|
9998
|
-
"process",
|
|
9999
|
-
"punycode",
|
|
10000
|
-
"querystring",
|
|
10001
|
-
"stream",
|
|
10002
|
-
"stream/promises",
|
|
10003
|
-
"stream/web",
|
|
10004
|
-
"string_decoder",
|
|
10005
|
-
"timers",
|
|
10006
|
-
"timers/promises",
|
|
10007
|
-
"url",
|
|
10008
|
-
"util",
|
|
10009
|
-
"zlib"
|
|
10010
|
-
].flatMap((name) => [name, `node:${name}`])), `${JSON.stringify("open-flow-engine/v8/nodejs-compat-v1")}`;
|
|
10011
|
-
//#endregion
|
|
10012
10140
|
//#region src/workflow/common/workflow.ts
|
|
10013
10141
|
var portSchema = object({
|
|
10014
10142
|
handle: string$1().min(1),
|
|
@@ -10091,11 +10219,14 @@ var controlErrorCode = {
|
|
|
10091
10219
|
triggerKeyInvalid: "trigger-key.invalid",
|
|
10092
10220
|
triggerKeyNotFound: "trigger-key.not-found",
|
|
10093
10221
|
triggerNotFound: "trigger.not-found",
|
|
10222
|
+
tagInvalid: "tag.invalid",
|
|
10223
|
+
tagConflict: "tag.conflict",
|
|
10224
|
+
tagNotFound: "tag.not-found",
|
|
10094
10225
|
variableInvalid: "variable.invalid",
|
|
10095
10226
|
variableLimitReached: "variable.limit-reached",
|
|
10096
10227
|
variableNotFound: "variable.not-found"
|
|
10097
10228
|
};
|
|
10098
|
-
controlErrorCode.eventSourceInvalid, controlErrorCode.eventSourceIdentityUnavailable, controlErrorCode.eventSourceNotFound, controlErrorCode.eventSourceConflict, controlErrorCode.authenticationRequired, controlErrorCode.authorizationDenied, controlErrorCode.bindingUnresolved, controlErrorCode.connectorActionNotFound, controlErrorCode.connectorAccessConflict, controlErrorCode.connectorAccessInvalid, controlErrorCode.connectorAccessRequired, controlErrorCode.connectorAccessUnsupported, controlErrorCode.connectorUnconfigured, controlErrorCode.connectorUnavailable, controlErrorCode.connectorConsoleUnconfigured, controlErrorCode.engineUnavailable, controlErrorCode.engineUnsupported, controlErrorCode.flowInvalid, controlErrorCode.flowRepairRequired, controlErrorCode.flowUpgradeRequired, controlErrorCode.flowNotFound, controlErrorCode.flowBusy, controlErrorCode.flowConflict, controlErrorCode.flowPresentationConflict, controlErrorCode.flowRevisionConflict, controlErrorCode.liveConflict, controlErrorCode.liveNotFound, controlErrorCode.pageInvalidCursor, controlErrorCode.publicationConflict, controlErrorCode.publicationNotFound, controlErrorCode.publicationUnsupported, controlErrorCode.publishOperationNotFound, controlErrorCode.routeNotFound, controlErrorCode.runConflict, controlErrorCode.runEventsExpired, controlErrorCode.runInvalid, controlErrorCode.runNotFound, controlErrorCode.runNotTerminal, controlErrorCode.runOverloaded, controlErrorCode.runWaitNotFound, controlErrorCode.triggerKeyInvalid, controlErrorCode.triggerKeyNotFound, controlErrorCode.triggerNotFound, controlErrorCode.variableInvalid, controlErrorCode.variableLimitReached, controlErrorCode.variableNotFound;
|
|
10229
|
+
controlErrorCode.eventSourceInvalid, controlErrorCode.eventSourceIdentityUnavailable, controlErrorCode.eventSourceNotFound, controlErrorCode.eventSourceConflict, controlErrorCode.authenticationRequired, controlErrorCode.authorizationDenied, controlErrorCode.bindingUnresolved, controlErrorCode.connectorActionNotFound, controlErrorCode.connectorAccessConflict, controlErrorCode.connectorAccessInvalid, controlErrorCode.connectorAccessRequired, controlErrorCode.connectorAccessUnsupported, controlErrorCode.connectorUnconfigured, controlErrorCode.connectorUnavailable, controlErrorCode.connectorConsoleUnconfigured, controlErrorCode.engineUnavailable, controlErrorCode.engineUnsupported, controlErrorCode.flowInvalid, controlErrorCode.flowRepairRequired, controlErrorCode.flowUpgradeRequired, controlErrorCode.flowNotFound, controlErrorCode.flowBusy, controlErrorCode.flowConflict, controlErrorCode.flowPresentationConflict, controlErrorCode.flowRevisionConflict, controlErrorCode.liveConflict, controlErrorCode.liveNotFound, controlErrorCode.pageInvalidCursor, controlErrorCode.publicationConflict, controlErrorCode.publicationNotFound, controlErrorCode.publicationUnsupported, controlErrorCode.publishOperationNotFound, controlErrorCode.routeNotFound, controlErrorCode.runConflict, controlErrorCode.runEventsExpired, controlErrorCode.runInvalid, controlErrorCode.runNotFound, controlErrorCode.runNotTerminal, controlErrorCode.runOverloaded, controlErrorCode.runWaitNotFound, controlErrorCode.triggerKeyInvalid, controlErrorCode.triggerKeyNotFound, controlErrorCode.triggerNotFound, controlErrorCode.tagInvalid, controlErrorCode.tagConflict, controlErrorCode.tagNotFound, controlErrorCode.variableInvalid, controlErrorCode.variableLimitReached, controlErrorCode.variableNotFound;
|
|
10099
10230
|
var ApiError = class extends Error {
|
|
10100
10231
|
constructor(status, code, message, details) {
|
|
10101
10232
|
super(message);
|
|
@@ -10572,7 +10703,7 @@ function decodeEntries(values, current) {
|
|
|
10572
10703
|
return parsed.data;
|
|
10573
10704
|
}
|
|
10574
10705
|
//#endregion
|
|
10575
|
-
//#region src/
|
|
10706
|
+
//#region src/connector/common/providerIconSprite.ts
|
|
10576
10707
|
/** Optional artwork must never make an otherwise usable catalog unavailable. */
|
|
10577
10708
|
function providerIconAppearance(metadata, position) {
|
|
10578
10709
|
if (!metadata || typeof metadata != "object" || !position || typeof position != "object") return {};
|
|
@@ -11004,6 +11135,30 @@ function connectorProvider(value) {
|
|
|
11004
11135
|
};
|
|
11005
11136
|
}
|
|
11006
11137
|
//#endregion
|
|
11138
|
+
//#region src/event-source/common/view.ts
|
|
11139
|
+
var id$2 = string$1().min(1).max(256);
|
|
11140
|
+
/** Public projection of a source that Connector validates and Open Flow exposes unchanged. */
|
|
11141
|
+
var eventSourceViewSchema = object({
|
|
11142
|
+
appId: id$2.nullable(),
|
|
11143
|
+
workspaceId: id$2.optional(),
|
|
11144
|
+
installationId: id$2.optional(),
|
|
11145
|
+
organizationId: id$2.optional(),
|
|
11146
|
+
projectId: id$2.optional(),
|
|
11147
|
+
projectKey: id$2.optional(),
|
|
11148
|
+
subscriptionStatus: _enum([
|
|
11149
|
+
"idle",
|
|
11150
|
+
"pending",
|
|
11151
|
+
"ready",
|
|
11152
|
+
"error"
|
|
11153
|
+
]).optional(),
|
|
11154
|
+
lastError: string$1().optional(),
|
|
11155
|
+
signingSecretConfigured: boolean().optional(),
|
|
11156
|
+
manageSubscriptions: boolean().nullable(),
|
|
11157
|
+
verificationTokenConfigured: boolean().nullable(),
|
|
11158
|
+
encryptKeyConfigured: boolean().nullable(),
|
|
11159
|
+
verifiedAt: string$1().nullable()
|
|
11160
|
+
});
|
|
11161
|
+
//#endregion
|
|
11007
11162
|
//#region src/control/common/eventSources.ts
|
|
11008
11163
|
var id$1 = string$1().min(1).max(256);
|
|
11009
11164
|
var eventType = string$1().regex(/^[a-z][a-z0-9_.:]{0,127}$/);
|
|
@@ -11023,29 +11178,12 @@ var eventSourceSchema = object({
|
|
|
11023
11178
|
"fireflies",
|
|
11024
11179
|
"jira"
|
|
11025
11180
|
]),
|
|
11026
|
-
|
|
11027
|
-
workspaceId: id$1.optional(),
|
|
11028
|
-
installationId: id$1.optional(),
|
|
11029
|
-
organizationId: id$1.optional(),
|
|
11030
|
-
projectId: id$1.optional(),
|
|
11031
|
-
projectKey: id$1.optional(),
|
|
11032
|
-
subscriptionStatus: _enum([
|
|
11033
|
-
"idle",
|
|
11034
|
-
"pending",
|
|
11035
|
-
"ready",
|
|
11036
|
-
"error"
|
|
11037
|
-
]).optional(),
|
|
11038
|
-
lastError: string$1().optional(),
|
|
11039
|
-
signingSecretConfigured: boolean().optional(),
|
|
11181
|
+
...eventSourceViewSchema.shape,
|
|
11040
11182
|
connectionId: id$1,
|
|
11041
11183
|
teamId: id$1.nullable(),
|
|
11042
11184
|
enabled: boolean(),
|
|
11043
11185
|
eventTypes: array(eventType),
|
|
11044
|
-
manageSubscriptions: boolean().nullable(),
|
|
11045
|
-
verificationTokenConfigured: boolean().nullable(),
|
|
11046
|
-
encryptKeyConfigured: boolean().nullable(),
|
|
11047
11186
|
endpointUrl: string$1().nullable(),
|
|
11048
|
-
verifiedAt: string$1().nullable(),
|
|
11049
11187
|
lastReceivedAt: string$1().nullable(),
|
|
11050
11188
|
updatedAt: string$1(),
|
|
11051
11189
|
consumers: array(object({
|
|
@@ -11054,21 +11192,6 @@ var eventSourceSchema = object({
|
|
|
11054
11192
|
triggerNodeId: id$1
|
|
11055
11193
|
}))
|
|
11056
11194
|
});
|
|
11057
|
-
eventSourceSchema.pick({
|
|
11058
|
-
appId: true,
|
|
11059
|
-
workspaceId: true,
|
|
11060
|
-
installationId: true,
|
|
11061
|
-
organizationId: true,
|
|
11062
|
-
projectId: true,
|
|
11063
|
-
projectKey: true,
|
|
11064
|
-
subscriptionStatus: true,
|
|
11065
|
-
lastError: true,
|
|
11066
|
-
signingSecretConfigured: true,
|
|
11067
|
-
manageSubscriptions: true,
|
|
11068
|
-
verificationTokenConfigured: true,
|
|
11069
|
-
encryptKeyConfigured: true,
|
|
11070
|
-
verifiedAt: true
|
|
11071
|
-
});
|
|
11072
11195
|
function decodeEventSource(value) {
|
|
11073
11196
|
return eventSourceSchema.parse(value);
|
|
11074
11197
|
}
|
|
@@ -11369,6 +11492,7 @@ function flow$1(value) {
|
|
|
11369
11492
|
publicationId: string(target.publicationId),
|
|
11370
11493
|
revisionId: string(target.revisionId)
|
|
11371
11494
|
} },
|
|
11495
|
+
tagIds: source.tagIds === void 0 ? [] : strings(source.tagIds),
|
|
11372
11496
|
createdAt: string(source.createdAt),
|
|
11373
11497
|
...source.connectorTeamId == null ? {} : { connectorTeamId: string(source.connectorTeamId) },
|
|
11374
11498
|
draftRevisionId: string(source.draftRevisionId),
|
|
@@ -11803,6 +11927,33 @@ function randomId() {
|
|
|
11803
11927
|
return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
11804
11928
|
}
|
|
11805
11929
|
//#endregion
|
|
11930
|
+
//#region src/control/common/tags.ts
|
|
11931
|
+
function normalizeFlowQuery(query = {}) {
|
|
11932
|
+
return {
|
|
11933
|
+
query: query.query?.trim().toLowerCase() ?? "",
|
|
11934
|
+
tagIds: [...new Set(query.tagIds ?? [])].toSorted(),
|
|
11935
|
+
untagged: query.untagged ?? false
|
|
11936
|
+
};
|
|
11937
|
+
}
|
|
11938
|
+
function decodeTag(value) {
|
|
11939
|
+
const source = record(value);
|
|
11940
|
+
if (source.version != 1) return invalidResponse();
|
|
11941
|
+
return {
|
|
11942
|
+
tagId: string(source.tagId),
|
|
11943
|
+
name: string(source.name),
|
|
11944
|
+
version: 1
|
|
11945
|
+
};
|
|
11946
|
+
}
|
|
11947
|
+
function decodeTagListItem(value) {
|
|
11948
|
+
const source = record(value);
|
|
11949
|
+
const referenceCount = integer(source.referenceCount);
|
|
11950
|
+
if (referenceCount < 0) return invalidResponse();
|
|
11951
|
+
return {
|
|
11952
|
+
...decodeTag(source),
|
|
11953
|
+
referenceCount
|
|
11954
|
+
};
|
|
11955
|
+
}
|
|
11956
|
+
//#endregion
|
|
11806
11957
|
//#region src/control/common/api.ts
|
|
11807
11958
|
function decodeRunEvent(value) {
|
|
11808
11959
|
const source = record(value);
|
|
@@ -11906,7 +12057,7 @@ function decodeRunEvent(value) {
|
|
|
11906
12057
|
switch (kind) {
|
|
11907
12058
|
case "node.started": {
|
|
11908
12059
|
const nodeKind = payload.nodeKind;
|
|
11909
|
-
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "decision" && nodeKind !== "openapi" && nodeKind !== "http-request" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "value" && nodeKind !== "outputs" && nodeKind !== "webhook-response" && nodeKind !== "workflow" && nodeKind !== "wait") return invalidResponse();
|
|
12060
|
+
if (nodeKind !== void 0 && nodeKind !== "approval" && nodeKind !== "condition" && nodeKind !== "connector" && nodeKind !== "javascript" && nodeKind !== "decision" && nodeKind !== "openapi" && nodeKind !== "http-request" && nodeKind !== "dedupe" && nodeKind !== "llm" && nodeKind !== "agent" && nodeKind !== "value" && nodeKind !== "outputs" && nodeKind !== "webhook-response" && nodeKind !== "workflow" && nodeKind !== "wait") return invalidResponse();
|
|
11910
12061
|
return {
|
|
11911
12062
|
...base,
|
|
11912
12063
|
kind,
|
|
@@ -12033,6 +12184,10 @@ var ControlClient = class {
|
|
|
12033
12184
|
}
|
|
12034
12185
|
async listFlows(options = {}) {
|
|
12035
12186
|
const parameters = new URLSearchParams();
|
|
12187
|
+
const filter = normalizeFlowQuery(options);
|
|
12188
|
+
if (filter.query) parameters.set("query", filter.query);
|
|
12189
|
+
if (filter.tagIds.length) parameters.set("tagIds", filter.tagIds.join(","));
|
|
12190
|
+
if (filter.untagged) parameters.set("untagged", "true");
|
|
12036
12191
|
if (options.cursor != null) parameters.set("cursor", options.cursor);
|
|
12037
12192
|
if (options.limit != null) parameters.set("limit", String(options.limit));
|
|
12038
12193
|
if (options.includeTotal != null) parameters.set("includeTotal", String(options.includeTotal));
|
|
@@ -12122,15 +12277,17 @@ var ControlClient = class {
|
|
|
12122
12277
|
file,
|
|
12123
12278
|
name: options.name,
|
|
12124
12279
|
teamId: options.teamId,
|
|
12280
|
+
tagIds: options.tagIds,
|
|
12125
12281
|
version: 1
|
|
12126
12282
|
})
|
|
12127
12283
|
}));
|
|
12128
12284
|
}
|
|
12129
|
-
async createFlow(name, idempotencyKey = `flow-${randomId()}`, teamId) {
|
|
12285
|
+
async createFlow(name, idempotencyKey = `flow-${randomId()}`, teamId, tagIds) {
|
|
12130
12286
|
return flow$1(await this.request("/v1/flows", {
|
|
12131
12287
|
body: JSON.stringify({
|
|
12132
12288
|
name,
|
|
12133
12289
|
...teamId == null ? {} : { teamId },
|
|
12290
|
+
...tagIds == null ? {} : { tagIds },
|
|
12134
12291
|
version: 1
|
|
12135
12292
|
}),
|
|
12136
12293
|
headers: { "idempotency-key": idempotencyKey },
|
|
@@ -12165,15 +12322,68 @@ var ControlClient = class {
|
|
|
12165
12322
|
if (source.version != 1 || !Array.isArray(source.listeners)) return invalidResponse();
|
|
12166
12323
|
return source.listeners.map(errorListener);
|
|
12167
12324
|
}
|
|
12168
|
-
async
|
|
12169
|
-
|
|
12325
|
+
async listTags(signal) {
|
|
12326
|
+
const source = record(await this.request("/v1/tags", { signal }));
|
|
12327
|
+
if (source.version != 1 || !Array.isArray(source.tags)) return invalidResponse();
|
|
12328
|
+
return {
|
|
12329
|
+
tags: source.tags.map(decodeTagListItem),
|
|
12330
|
+
version: 1
|
|
12331
|
+
};
|
|
12332
|
+
}
|
|
12333
|
+
async createTag(name) {
|
|
12334
|
+
return decodeTag(await this.request("/v1/tags", {
|
|
12335
|
+
method: "POST",
|
|
12170
12336
|
body: JSON.stringify({
|
|
12171
12337
|
name,
|
|
12172
12338
|
version: 1
|
|
12173
|
-
})
|
|
12174
|
-
|
|
12339
|
+
})
|
|
12340
|
+
}));
|
|
12341
|
+
}
|
|
12342
|
+
async renameTag(tagId, name) {
|
|
12343
|
+
return decodeTag(await this.request(`/v1/tags/${segment(tagId)}`, {
|
|
12344
|
+
method: "PATCH",
|
|
12345
|
+
body: JSON.stringify({
|
|
12346
|
+
name,
|
|
12347
|
+
version: 1
|
|
12348
|
+
})
|
|
12175
12349
|
}));
|
|
12176
12350
|
}
|
|
12351
|
+
async deleteTag(tagId) {
|
|
12352
|
+
if (record(await this.request(`/v1/tags/${segment(tagId)}`, { method: "DELETE" })).version != 1) invalidResponse();
|
|
12353
|
+
}
|
|
12354
|
+
async setFlowTags(flowId, tagIds) {
|
|
12355
|
+
return flow$1(await this.request(`/v1/flows/${segment(flowId)}/tags`, {
|
|
12356
|
+
method: "PUT",
|
|
12357
|
+
body: JSON.stringify({
|
|
12358
|
+
tagIds,
|
|
12359
|
+
version: 1
|
|
12360
|
+
})
|
|
12361
|
+
}));
|
|
12362
|
+
}
|
|
12363
|
+
async updateFlow(flowId, changes) {
|
|
12364
|
+
return flow$1(await this.request(`/v1/flows/${segment(flowId)}`, {
|
|
12365
|
+
method: "PATCH",
|
|
12366
|
+
body: JSON.stringify({
|
|
12367
|
+
...changes,
|
|
12368
|
+
version: 1
|
|
12369
|
+
})
|
|
12370
|
+
}));
|
|
12371
|
+
}
|
|
12372
|
+
async getFlowState(flowId, scope, values = false) {
|
|
12373
|
+
const result = flowStateViewSchema.safeParse(await this.request(`/v1/flows/${segment(flowId)}/state?scope=${scope}&values=${values}`));
|
|
12374
|
+
return result.success && result.data.scope === scope ? result.data : invalidResponse();
|
|
12375
|
+
}
|
|
12376
|
+
async clearFlowState(flowId, scope, key) {
|
|
12377
|
+
const source = record(await this.request(`/v1/flows/${segment(flowId)}/state?scope=${scope}${key == null ? "" : `&key=${encodeURIComponent(key)}`}`, { method: "DELETE" }));
|
|
12378
|
+
if (source.version !== 1 || source.cleared !== true) invalidResponse();
|
|
12379
|
+
}
|
|
12380
|
+
async clearFlowDedupe(flowId, scope, space) {
|
|
12381
|
+
const source = record(await this.request(`/v1/flows/${segment(flowId)}/dedupe?scope=${scope}&space=${encodeURIComponent(space)}`, { method: "DELETE" }));
|
|
12382
|
+
if (source.version !== 1 || source.cleared !== true) invalidResponse();
|
|
12383
|
+
}
|
|
12384
|
+
async renameFlow(flowId, name) {
|
|
12385
|
+
return this.updateFlow(flowId, { name });
|
|
12386
|
+
}
|
|
12177
12387
|
async deleteFlow(flowId) {
|
|
12178
12388
|
return flow$1(await this.request(`/v1/flows/${segment(flowId)}`, { method: "DELETE" }));
|
|
12179
12389
|
}
|
|
@@ -12925,6 +13135,9 @@ function tool(description, schema, readOnly, idempotent = true) {
|
|
|
12925
13135
|
};
|
|
12926
13136
|
}
|
|
12927
13137
|
var mcpTools = {
|
|
13138
|
+
flow_state: tool("Inspect Flow state usage, business keys and deduplication spaces. Values are omitted unless requested. Scope is required.", stateQuerySchema.extend({ flowId: flow }), true),
|
|
13139
|
+
flow_state_clear: tool("Delete one business state key or clear all business values. Explicit draft/live scope is required; live changes production state immediately.", stateClearSchema.extend({ flowId: flow }), false),
|
|
13140
|
+
flow_dedupe_clear: tool("Clear one deduplication space (flow or node:<id>). Explicit draft/live scope is required; live changes production history immediately.", dedupeClearSchema.extend({ flowId: flow }), false),
|
|
12928
13141
|
flow_canvas: tool("Broadcast a transient canvas command to connected Workbenches viewing this Flow. Success only confirms Server broadcast, not delivery or execution. No replay, session selection or Presentation save. Pan uses screen pixels (positive right/down); zoom is an absolute ratio (0.1–3); fit includes all nodes. Repeating pan moves again.", strictObject({
|
|
12929
13142
|
flowId: flow,
|
|
12930
13143
|
command: canvasCommandSchema
|