@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
|
@@ -7,7 +7,12 @@ export interface EngineContract {
|
|
|
7
7
|
readonly webhookResponses?: boolean;
|
|
8
8
|
readonly workflowTools?: boolean;
|
|
9
9
|
readonly httpRequests?: boolean;
|
|
10
|
+
/** Code may call `context.fetch` for hosts declared by its `http` Capability. */
|
|
11
|
+
readonly codeFetch?: boolean;
|
|
12
|
+
readonly flowState?: boolean;
|
|
10
13
|
}
|
|
11
|
-
|
|
14
|
+
/** v10 adds persistent Flow State to the published v9 Node compatibility and fetch contract. */
|
|
15
|
+
export declare const currentEngineContract = "open-flow-engine/v10";
|
|
16
|
+
/** The published v8 Node compatibility contract, retained for existing Publications and Runs. */
|
|
12
17
|
export declare const nodejsEngineContract = "open-flow-engine/v8/nodejs-compat-v1";
|
|
13
18
|
export declare function findEngineContract(contract: string): EngineContract | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Public projection of a source that Connector validates and Open Flow exposes unchanged. */
|
|
3
|
+
export declare const eventSourceViewSchema: z.ZodObject<{
|
|
4
|
+
appId: z.ZodNullable<z.ZodString>;
|
|
5
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
6
|
+
installationId: z.ZodOptional<z.ZodString>;
|
|
7
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
8
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
9
|
+
projectKey: z.ZodOptional<z.ZodString>;
|
|
10
|
+
subscriptionStatus: z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
error: "error";
|
|
12
|
+
idle: "idle";
|
|
13
|
+
pending: "pending";
|
|
14
|
+
ready: "ready";
|
|
15
|
+
}>>;
|
|
16
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
17
|
+
signingSecretConfigured: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
manageSubscriptions: z.ZodNullable<z.ZodBoolean>;
|
|
19
|
+
verificationTokenConfigured: z.ZodNullable<z.ZodBoolean>;
|
|
20
|
+
encryptKeyConfigured: z.ZodNullable<z.ZodBoolean>;
|
|
21
|
+
verifiedAt: z.ZodNullable<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EventSourceDefinition, SourceConfiguration } from './event-source-definition.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { eventSourceViewSchema } from './event-
|
|
3
|
+
import { eventSourceViewSchema } from './event-source-view.js';
|
|
4
4
|
export type { EventSourceDefinition, SourceConfiguration, SourceEvent, SourceSubscription, SourceOperation, SourceReference, SourceReferenceOperation, } from './event-source-definition.js';
|
|
5
5
|
export { SourceIdentityError } from './event-source-definition.js';
|
|
6
6
|
export declare function eventSourceDefinition(kind: string): EventSourceDefinition;
|
|
@@ -5569,71 +5569,6 @@ function json(params) {
|
|
|
5569
5569
|
return jsonSchema;
|
|
5570
5570
|
}
|
|
5571
5571
|
//#endregion
|
|
5572
|
-
//#region src/control/common/eventSources.ts
|
|
5573
|
-
var id = string().min(1).max(256);
|
|
5574
|
-
var eventType = string().regex(/^[a-z][a-z0-9_.:]{0,127}$/);
|
|
5575
|
-
var name = string().trim().min(1).max(128);
|
|
5576
|
-
var eventSourceViewSchema = object({
|
|
5577
|
-
version: literal(1),
|
|
5578
|
-
sourceId: id,
|
|
5579
|
-
revision: int().positive(),
|
|
5580
|
-
name,
|
|
5581
|
-
provider: _enum([
|
|
5582
|
-
"feishu",
|
|
5583
|
-
"feishu_app_bot",
|
|
5584
|
-
"slackbot",
|
|
5585
|
-
"intercom",
|
|
5586
|
-
"sentry",
|
|
5587
|
-
"zoom",
|
|
5588
|
-
"fireflies",
|
|
5589
|
-
"jira"
|
|
5590
|
-
]),
|
|
5591
|
-
appId: id.nullable(),
|
|
5592
|
-
workspaceId: id.optional(),
|
|
5593
|
-
installationId: id.optional(),
|
|
5594
|
-
organizationId: id.optional(),
|
|
5595
|
-
projectId: id.optional(),
|
|
5596
|
-
projectKey: id.optional(),
|
|
5597
|
-
subscriptionStatus: _enum([
|
|
5598
|
-
"idle",
|
|
5599
|
-
"pending",
|
|
5600
|
-
"ready",
|
|
5601
|
-
"error"
|
|
5602
|
-
]).optional(),
|
|
5603
|
-
lastError: string().optional(),
|
|
5604
|
-
signingSecretConfigured: boolean().optional(),
|
|
5605
|
-
connectionId: id,
|
|
5606
|
-
teamId: id.nullable(),
|
|
5607
|
-
enabled: boolean(),
|
|
5608
|
-
eventTypes: array(eventType),
|
|
5609
|
-
manageSubscriptions: boolean().nullable(),
|
|
5610
|
-
verificationTokenConfigured: boolean().nullable(),
|
|
5611
|
-
encryptKeyConfigured: boolean().nullable(),
|
|
5612
|
-
endpointUrl: string().nullable(),
|
|
5613
|
-
verifiedAt: string().nullable(),
|
|
5614
|
-
lastReceivedAt: string().nullable(),
|
|
5615
|
-
updatedAt: string(),
|
|
5616
|
-
consumers: array(object({
|
|
5617
|
-
flowId: id,
|
|
5618
|
-
flowName: string(),
|
|
5619
|
-
triggerNodeId: id
|
|
5620
|
-
}))
|
|
5621
|
-
}).pick({
|
|
5622
|
-
appId: true,
|
|
5623
|
-
workspaceId: true,
|
|
5624
|
-
installationId: true,
|
|
5625
|
-
organizationId: true,
|
|
5626
|
-
projectId: true,
|
|
5627
|
-
projectKey: true,
|
|
5628
|
-
subscriptionStatus: true,
|
|
5629
|
-
lastError: true,
|
|
5630
|
-
signingSecretConfigured: true,
|
|
5631
|
-
manageSubscriptions: true,
|
|
5632
|
-
verificationTokenConfigured: true,
|
|
5633
|
-
encryptKeyConfigured: true,
|
|
5634
|
-
verifiedAt: true
|
|
5635
|
-
});
|
|
5636
|
-
//#endregion
|
|
5637
5572
|
//#region src/event-source/common/catalog.generated.json
|
|
5638
5573
|
var catalog_generated_default = [
|
|
5639
5574
|
{
|
|
@@ -5704,6 +5639,30 @@ var catalog_generated_default = [
|
|
|
5704
5639
|
//#region src/event-source/common/definition.ts
|
|
5705
5640
|
var SourceIdentityError = class extends Error {};
|
|
5706
5641
|
//#endregion
|
|
5642
|
+
//#region src/event-source/common/view.ts
|
|
5643
|
+
var id = string().min(1).max(256);
|
|
5644
|
+
/** Public projection of a source that Connector validates and Open Flow exposes unchanged. */
|
|
5645
|
+
var eventSourceViewSchema = object({
|
|
5646
|
+
appId: id.nullable(),
|
|
5647
|
+
workspaceId: id.optional(),
|
|
5648
|
+
installationId: id.optional(),
|
|
5649
|
+
organizationId: id.optional(),
|
|
5650
|
+
projectId: id.optional(),
|
|
5651
|
+
projectKey: id.optional(),
|
|
5652
|
+
subscriptionStatus: _enum([
|
|
5653
|
+
"idle",
|
|
5654
|
+
"pending",
|
|
5655
|
+
"ready",
|
|
5656
|
+
"error"
|
|
5657
|
+
]).optional(),
|
|
5658
|
+
lastError: string().optional(),
|
|
5659
|
+
signingSecretConfigured: boolean().optional(),
|
|
5660
|
+
manageSubscriptions: boolean().nullable(),
|
|
5661
|
+
verificationTokenConfigured: boolean().nullable(),
|
|
5662
|
+
encryptKeyConfigured: boolean().nullable(),
|
|
5663
|
+
verifiedAt: string().nullable()
|
|
5664
|
+
});
|
|
5665
|
+
//#endregion
|
|
5707
5666
|
//#region src/event-source/common/index.ts
|
|
5708
5667
|
function eventSourceDefinition(kind) {
|
|
5709
5668
|
for (const entry of catalog_generated_default) if (entry.kind === kind) return entry;
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const eventSourceViewSchema: z.ZodObject<{
|
|
3
|
-
appId: z.ZodNullable<z.ZodString>;
|
|
4
|
-
workspaceId: z.ZodOptional<z.ZodString>;
|
|
5
|
-
installationId: z.ZodOptional<z.ZodString>;
|
|
6
|
-
organizationId: z.ZodOptional<z.ZodString>;
|
|
7
|
-
projectId: z.ZodOptional<z.ZodString>;
|
|
8
|
-
projectKey: z.ZodOptional<z.ZodString>;
|
|
9
|
-
subscriptionStatus: z.ZodOptional<z.ZodEnum<{
|
|
10
|
-
error: "error";
|
|
11
|
-
idle: "idle";
|
|
12
|
-
pending: "pending";
|
|
13
|
-
ready: "ready";
|
|
14
|
-
}>>;
|
|
15
|
-
lastError: z.ZodOptional<z.ZodString>;
|
|
16
|
-
signingSecretConfigured: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
-
manageSubscriptions: z.ZodNullable<z.ZodBoolean>;
|
|
18
|
-
verificationTokenConfigured: z.ZodNullable<z.ZodBoolean>;
|
|
19
|
-
encryptKeyConfigured: z.ZodNullable<z.ZodBoolean>;
|
|
20
|
-
verifiedAt: z.ZodNullable<z.ZodString>;
|
|
21
|
-
}, z.core.$strip>;
|
|
22
1
|
export interface CreateFeishuEventSource {
|
|
23
2
|
readonly kind?: 'feishu';
|
|
24
3
|
readonly version: 1;
|
|
@@ -2887,6 +2887,9 @@ function createSchemaComparer() {
|
|
|
2887
2887
|
createSchemaComparer();
|
|
2888
2888
|
//#endregion
|
|
2889
2889
|
//#region src/decision/common/decision.ts
|
|
2890
|
+
function isDecisionExecutor(executor) {
|
|
2891
|
+
return executor.kind === "decision";
|
|
2892
|
+
}
|
|
2890
2893
|
var decisionLimits = {
|
|
2891
2894
|
choice: 255,
|
|
2892
2895
|
score: 10
|
|
@@ -2909,7 +2912,7 @@ function limitDecisionQuestions(questions) {
|
|
|
2909
2912
|
}
|
|
2910
2913
|
/** Loading an oversized task also updates its previously generated output schemas. */
|
|
2911
2914
|
function limitDecisionTask(task) {
|
|
2912
|
-
if (task.executor
|
|
2915
|
+
if (!isDecisionExecutor(task.executor)) return task;
|
|
2913
2916
|
const original = task.executor.questions;
|
|
2914
2917
|
const questions = limitDecisionQuestions(original);
|
|
2915
2918
|
if (questions === original) return task;
|
|
@@ -3009,15 +3012,6 @@ function decisionTask(questions = [defaultDecisionQuestion()], name = "AI Decisi
|
|
|
3009
3012
|
};
|
|
3010
3013
|
}
|
|
3011
3014
|
//#endregion
|
|
3012
|
-
//#region src/http/common/authBindings.ts
|
|
3013
|
-
/** Never allow credentials to enter a Revision as literal node inputs. */
|
|
3014
|
-
function assertHttpAuthBindings(document) {
|
|
3015
|
-
for (const node of Object.values(document.graph.nodes)) {
|
|
3016
|
-
if (node.kind != "task" || !("executor" in node.task) || !["openapi", "http-request"].includes(node.task.executor.kind)) continue;
|
|
3017
|
-
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.");
|
|
3018
|
-
}
|
|
3019
|
-
}
|
|
3020
|
-
//#endregion
|
|
3021
3015
|
//#region src/flow/common/inputValue.ts
|
|
3022
3016
|
/** Converts explicit user values at authoring boundaries, never persisted legacy data. */
|
|
3023
3017
|
function inputValues(values) {
|
|
@@ -8707,6 +8701,20 @@ function datetime(params) {
|
|
|
8707
8701
|
return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
|
|
8708
8702
|
}
|
|
8709
8703
|
//#endregion
|
|
8704
|
+
//#region src/http/common/authBindings.ts
|
|
8705
|
+
/** Never allow credentials to enter a Revision as literal inputs of an OpenAPI or HTTP request node. */
|
|
8706
|
+
function assertHttpAuthBindings(inputs) {
|
|
8707
|
+
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.");
|
|
8708
|
+
}
|
|
8709
|
+
//#endregion
|
|
8710
|
+
//#region src/http/common/hosts.ts
|
|
8711
|
+
/** Hosts of a Code `http` Capability: lowercase DNS names or IPv4 addresses; `*.example.com` matches subdomains only. */
|
|
8712
|
+
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])?$/;
|
|
8713
|
+
/** Wildcards must name a registrable suffix, so `*.com` is rejected. */
|
|
8714
|
+
function isHttpHost(value) {
|
|
8715
|
+
return httpHostPattern.test(value) && (!value.startsWith("*.") || value.slice(2).includes("."));
|
|
8716
|
+
}
|
|
8717
|
+
//#endregion
|
|
8710
8718
|
//#region src/http/common/httpRequest.ts
|
|
8711
8719
|
var parameterSchema = strictObject({
|
|
8712
8720
|
mode: _enum(["fields", "object"]).default("fields"),
|
|
@@ -8752,6 +8760,51 @@ var httpRequestExecutorSchema = strictObject({
|
|
|
8752
8760
|
]).default("auto"),
|
|
8753
8761
|
statusPolicy: _enum(["success", "all"]).default("success")
|
|
8754
8762
|
}).extend({ kind: literal("http-request") });
|
|
8763
|
+
strictObject({
|
|
8764
|
+
scope: _enum(["draft", "live"]),
|
|
8765
|
+
values: boolean().optional()
|
|
8766
|
+
});
|
|
8767
|
+
strictObject({
|
|
8768
|
+
scope: _enum(["draft", "live"]),
|
|
8769
|
+
key: string().min(1).refine((key) => new TextEncoder().encode(key).length <= 256).optional()
|
|
8770
|
+
});
|
|
8771
|
+
strictObject({
|
|
8772
|
+
scope: _enum(["draft", "live"]),
|
|
8773
|
+
space: string().regex(/^(flow|node:.+)$/)
|
|
8774
|
+
});
|
|
8775
|
+
var dedupeExecutorSchema = strictObject({
|
|
8776
|
+
field: string().default(""),
|
|
8777
|
+
mode: _enum(["new", "increasing"]).default("new"),
|
|
8778
|
+
space: _enum(["node", "flow"]).default("node")
|
|
8779
|
+
}).extend({ kind: literal("dedupe") });
|
|
8780
|
+
object({
|
|
8781
|
+
version: literal(1),
|
|
8782
|
+
scope: _enum(["draft", "live"]),
|
|
8783
|
+
limits: object({
|
|
8784
|
+
maxValueBytes: number().positive(),
|
|
8785
|
+
maxValues: number().int().positive(),
|
|
8786
|
+
maxSpaces: number().int().positive(),
|
|
8787
|
+
maxIdentities: number().positive(),
|
|
8788
|
+
maxRunWrites: number().positive()
|
|
8789
|
+
}),
|
|
8790
|
+
values: array(object({
|
|
8791
|
+
key: string(),
|
|
8792
|
+
size: number().nonnegative(),
|
|
8793
|
+
updatedAt: number(),
|
|
8794
|
+
value: json$1().optional()
|
|
8795
|
+
})),
|
|
8796
|
+
spaces: array(object({
|
|
8797
|
+
space: string(),
|
|
8798
|
+
mode: _enum(["new", "increasing"]),
|
|
8799
|
+
count: number().nonnegative(),
|
|
8800
|
+
watermark: union([
|
|
8801
|
+
string(),
|
|
8802
|
+
number(),
|
|
8803
|
+
_null()
|
|
8804
|
+
]),
|
|
8805
|
+
updatedAt: number()
|
|
8806
|
+
}))
|
|
8807
|
+
});
|
|
8755
8808
|
function checkJsonDepth(value, depth = 0) {
|
|
8756
8809
|
if (depth > 64) throw new TypeError("Value exceeds the maximum JSON depth.");
|
|
8757
8810
|
if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
|
|
@@ -8929,7 +8982,14 @@ var workflowCapabilitySchema = strictObject({
|
|
|
8929
8982
|
inputs: array(port),
|
|
8930
8983
|
outputs: array(port).nullable()
|
|
8931
8984
|
});
|
|
8932
|
-
var capability = union([
|
|
8985
|
+
var capability = union([
|
|
8986
|
+
connectorCapabilitySchema,
|
|
8987
|
+
workflowCapabilitySchema,
|
|
8988
|
+
strictObject({
|
|
8989
|
+
kind: literal("http"),
|
|
8990
|
+
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.")
|
|
8991
|
+
})
|
|
8992
|
+
]);
|
|
8933
8993
|
var inline = object({
|
|
8934
8994
|
...ports,
|
|
8935
8995
|
name: text,
|
|
@@ -9040,7 +9100,8 @@ var managedFields = object({
|
|
|
9040
9100
|
flowId: text,
|
|
9041
9101
|
revisionId: text
|
|
9042
9102
|
}),
|
|
9043
|
-
httpRequestExecutorSchema
|
|
9103
|
+
httpRequestExecutorSchema,
|
|
9104
|
+
dedupeExecutorSchema
|
|
9044
9105
|
])
|
|
9045
9106
|
});
|
|
9046
9107
|
var managed = managedFields.transform(limitDecisionTask);
|
|
@@ -9309,7 +9370,9 @@ var revision = object({
|
|
|
9309
9370
|
literal(8),
|
|
9310
9371
|
literal(9),
|
|
9311
9372
|
literal(10),
|
|
9312
|
-
literal(11)
|
|
9373
|
+
literal(11),
|
|
9374
|
+
literal(12),
|
|
9375
|
+
literal(13)
|
|
9313
9376
|
]),
|
|
9314
9377
|
document,
|
|
9315
9378
|
modules: record$1(text, module)
|
|
@@ -9340,7 +9403,7 @@ function decodeRevisionContent(value) {
|
|
|
9340
9403
|
checkJsonDepth(value);
|
|
9341
9404
|
const content = revision.parse(value);
|
|
9342
9405
|
checkModelVersion(content);
|
|
9343
|
-
|
|
9406
|
+
assertDocumentHttpAuthBindings(content.document);
|
|
9344
9407
|
return content;
|
|
9345
9408
|
}
|
|
9346
9409
|
var shapes = {
|
|
@@ -9510,6 +9573,8 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
|
|
|
9510
9573
|
...shape
|
|
9511
9574
|
})])).values()])).min(1);
|
|
9512
9575
|
function checkModelVersion(content) {
|
|
9576
|
+
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.");
|
|
9577
|
+
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.");
|
|
9513
9578
|
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.");
|
|
9514
9579
|
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.");
|
|
9515
9580
|
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.");
|
|
@@ -9525,6 +9590,9 @@ function checkModelVersion(content) {
|
|
|
9525
9590
|
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.");
|
|
9526
9591
|
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.");
|
|
9527
9592
|
}
|
|
9593
|
+
function assertDocumentHttpAuthBindings(content) {
|
|
9594
|
+
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);
|
|
9595
|
+
}
|
|
9528
9596
|
//#endregion
|
|
9529
9597
|
//#region src/flow/common/condition.ts
|
|
9530
9598
|
var unaryOperator = (operator) => operator.startsWith("is");
|
|
@@ -9584,7 +9652,7 @@ function setConditionInput(node, handle, mapping) {
|
|
|
9584
9652
|
//#endregion
|
|
9585
9653
|
//#region src/flow/common/errorHandling.ts
|
|
9586
9654
|
function supportsNodeErrorHandling(node) {
|
|
9587
|
-
return supportsNodeRetry(node);
|
|
9655
|
+
return supportsNodeRetry(node) || node.kind === "task" && "executor" in node.task && node.task.executor.kind === "dedupe";
|
|
9588
9656
|
}
|
|
9589
9657
|
//#endregion
|
|
9590
9658
|
//#region src/flow/common/change.ts
|
|
@@ -9603,6 +9671,8 @@ function decodeTaskCapabilities(value) {
|
|
|
9603
9671
|
if (workflowToolNameIssue(item.name, names)) throw new TypeError("Workflow tool names must be unique provider-compatible names.");
|
|
9604
9672
|
names.add(item.name);
|
|
9605
9673
|
}
|
|
9674
|
+
const http = parsed.filter((item) => item.kind == "http");
|
|
9675
|
+
if (http.length > 1 || http.some((item) => new Set(item.hosts).size != item.hosts.length)) throw new TypeError("Code declares HTTP hosts once, without duplicates.");
|
|
9606
9676
|
let connectorIndex = 0;
|
|
9607
9677
|
return parsed.map((item) => item.kind == "connector" ? connectors[connectorIndex++] : item);
|
|
9608
9678
|
}
|
|
@@ -9733,10 +9803,10 @@ function isTriggerNode(node) {
|
|
|
9733
9803
|
function upgradeDecodedRevisionContent(content) {
|
|
9734
9804
|
const graph = content.document.graph;
|
|
9735
9805
|
const hasManual = Object.values(graph.nodes).some((node) => node.kind == "manual");
|
|
9736
|
-
if (!hasManual && content.modelVersion ==
|
|
9806
|
+
if (!hasManual && content.modelVersion == 13) return content;
|
|
9737
9807
|
return {
|
|
9738
9808
|
...content,
|
|
9739
|
-
modelVersion:
|
|
9809
|
+
modelVersion: 13,
|
|
9740
9810
|
document: {
|
|
9741
9811
|
...content.document,
|
|
9742
9812
|
graph: hasManual ? {
|
|
@@ -9771,7 +9841,7 @@ function invalid(message) {
|
|
|
9771
9841
|
throw new FlowChangeError(message);
|
|
9772
9842
|
}
|
|
9773
9843
|
function applyFlowChanges(content, operations) {
|
|
9774
|
-
const source = content.modelVersion !=
|
|
9844
|
+
const source = content.modelVersion != 13 || Object.values(content.document.graph.nodes).some((node) => node.kind == "manual") ? decodeRevisionContent(content) : content;
|
|
9775
9845
|
const document = { ...source.document };
|
|
9776
9846
|
const modules = { ...source.modules };
|
|
9777
9847
|
for (const operation of operations) switch (operation.kind) {
|
|
@@ -10216,10 +10286,10 @@ function applyFlowChanges(content, operations) {
|
|
|
10216
10286
|
break;
|
|
10217
10287
|
}
|
|
10218
10288
|
}
|
|
10219
|
-
|
|
10289
|
+
assertDocumentHttpAuthBindings(document);
|
|
10220
10290
|
return upgradeDecodedRevisionContent({
|
|
10221
10291
|
document,
|
|
10222
|
-
modelVersion:
|
|
10292
|
+
modelVersion: 13,
|
|
10223
10293
|
modules
|
|
10224
10294
|
});
|
|
10225
10295
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChangeOperation, FlowDocument, JsonValue, RevisionContent } from './flow-change.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
export declare const currentFlowModelVersion =
|
|
3
|
+
export declare const currentFlowModelVersion = 13;
|
|
4
4
|
export declare const connectorCapabilitySchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
5
5
|
kind: z.ZodLiteral<"connector">;
|
|
6
6
|
action: z.ZodString;
|
|
@@ -46,6 +46,10 @@ export declare const workflowCapabilitySchema: z.ZodObject<{
|
|
|
46
46
|
handle: z.ZodString;
|
|
47
47
|
}, z.core.$strip>>>;
|
|
48
48
|
}, z.core.$strict>;
|
|
49
|
+
export declare const httpCapabilitySchema: z.ZodObject<{
|
|
50
|
+
kind: z.ZodLiteral<"http">;
|
|
51
|
+
hosts: z.ZodArray<z.ZodString>;
|
|
52
|
+
}, z.core.$strict>;
|
|
49
53
|
export declare const agentToolFields: {
|
|
50
54
|
id: z.ZodString;
|
|
51
55
|
name: z.ZodString;
|
|
@@ -345,6 +349,9 @@ export declare const authoringDefinitionSchemas: {
|
|
|
345
349
|
nullable: z.ZodBoolean;
|
|
346
350
|
handle: z.ZodString;
|
|
347
351
|
}, z.core.$strip>>>;
|
|
352
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
353
|
+
kind: z.ZodLiteral<"http">;
|
|
354
|
+
hosts: z.ZodArray<z.ZodString>;
|
|
348
355
|
}, z.core.$strict>]>>;
|
|
349
356
|
connector: z.ZodObject<{
|
|
350
357
|
action: z.ZodString;
|
|
@@ -474,3 +481,4 @@ export declare function parseOperation<Value>(candidate: unknown, index: number,
|
|
|
474
481
|
export declare function decodeChangeOperation(candidate: unknown, index: number): ChangeOperation;
|
|
475
482
|
export declare function decodeChangeOperations(value: unknown): readonly ChangeOperation[];
|
|
476
483
|
export declare function changeOperationsSchema(kind?: string): JsonValue;
|
|
484
|
+
export declare function assertDocumentHttpAuthBindings(content: FlowDocument): void;
|