@oomol-lab/open-flow 0.1.0-beta.74 → 0.1.0-beta.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/browser/{ContentIcon-CUQHjQIw.js → ContentIcon-Cm1hbVzW.js} +4 -3
- package/dist/browser/{FlowCanvas-Dtf8_cQp.js → FlowCanvas-NzKtla_c.js} +62 -62
- package/dist/browser/{createResourceDialog-DI9pL-Yr.js → createResourceDialog-BgdedQqu.js} +3 -3
- package/dist/browser/{dialog-BYJGvItc.js → dialog-aSElFFw2.js} +322 -26
- package/dist/browser/{exportSvg-BOoy7-Db.js → exportSvg-Dcz4HTo_.js} +2 -2
- package/dist/browser/{flowChanges-RL-H4CjD.js → flowChanges-NZyS7HSp.js} +490 -438
- package/dist/browser/{flowWorkspace-BkDsETj0.js → flowWorkspace-Bl0SDehy.js} +499 -61
- package/dist/browser/preview.css +696 -825
- package/dist/browser/preview.js +1399 -717
- package/dist/browser/theme.css +114 -262
- package/dist/browser/{tooltip-wZJRB9oP.js → tooltip-3XMK9jkr.js} +1 -1
- package/dist/browser/{typeScriptSession-CSRwWmZm.js → typeScriptSession-C9sBGOKZ.js} +1 -1
- package/dist/browser/ui.css +354 -460
- package/dist/browser/ui.js +1 -1
- package/dist/browser/workbench.css +696 -825
- package/dist/browser/workbench.js +13 -7
- package/dist/browser/{workbenchSelect-BcWPWGzw.js → workbenchSelect-DBGP7Y4Z.js} +2 -2
- package/dist/command/index.js +41 -43
- package/dist/common/authoring.d.ts +5 -5
- package/dist/common/authoringExamples.d.ts +3 -2
- package/dist/common/authoringSchema.d.ts +70 -4
- package/dist/common/connector-proxy.d.ts +1 -1
- package/dist/common/control-api-conformance.js +250 -138
- package/dist/common/control-api.d.ts +3 -2
- package/dist/common/control-api.js +246 -134
- package/dist/common/control-requests.d.ts +3 -3
- package/dist/common/control-requests.js +353 -79
- 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 -19
- package/dist/common/flow-change-schema.d.ts +9 -1
- package/dist/common/flow-change.d.ts +7 -201
- package/dist/common/flow-change.js +96 -23
- package/dist/common/flow-encoding.js +89 -21
- package/dist/common/flow-graph.d.ts +2 -1
- 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 +3 -5
- package/dist/common/flow-semantics.js +816 -586
- 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 +164 -0
- package/dist/common/http-request.js +5272 -0
- package/dist/common/integration-trigger.d.ts +2 -1
- package/dist/common/mcp.d.ts +3 -3
- package/dist/common/mcp.js +248 -136
- 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 +11 -9
- package/dist/common/runtime-contract.d.ts +23 -1
- package/dist/common/runtime-contract.js +607 -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 +1 -1
- package/dist/common/scheduler.d.ts +2 -2
- package/dist/common/scheduler.js +95 -25
- 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 -3
- package/dist/common/webhook-trigger.d.ts +3 -1
- package/dist/common/webhook-trigger.js +12 -11
- package/dist/common/workflow.d.ts +3 -12
- package/dist/common/workflow.js +25 -23
- package/dist/index.d.ts +41 -14
- package/package.json +9 -1
- package/skills/open-flow/references/flow-authoring.md +1 -0
- package/skills/open-flow/references/flow-n8n-conversion.md +19 -15
- package/src/base/common/json.ts +1 -1
- package/src/connector/common/proxy.ts +1 -1
- package/src/control/common/api.ts +7 -5
- package/src/control/common/authoring.ts +14 -3
- package/src/control/common/authoringExamples.ts +8 -0
- package/src/control/common/authoringSchema.ts +38 -25
- 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/eventSources.ts +2 -29
- 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 +5 -3
- package/src/execution/common/scheduler.ts +2 -1
- package/src/flow/common/change.ts +59 -192
- package/src/flow/common/changeSchema.ts +39 -5
- package/src/flow/common/connectionUsage.ts +1 -1
- package/src/flow/common/graph.ts +10 -4
- 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 +3 -5
- package/src/flow/common/semantics.ts +71 -7
- package/src/flow/common/webhookResponse.ts +4 -8
- package/src/flow/common/workflowReferences.ts +31 -0
- package/src/http/common/authBindings.ts +9 -0
- package/src/http/common/headers.ts +5 -0
- package/src/http/common/hosts.ts +13 -0
- package/src/http/common/httpRequest.ts +266 -0
- package/src/openapi/common/openapi.ts +9 -5
- package/src/{execution → runtime}/common/engineContract.ts +24 -15
- package/src/runtime/common/nodejsCompat.ts +275 -0
- package/src/runtime/common/nodejsGuest.generated.json +47 -0
- package/src/runtime/common/runtime.ts +1138 -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 +7 -4
- 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 +44 -15
- package/src/workflow/common/workflow.ts +3 -44
- package/src/execution/common/runtime.ts +0 -563
- package/src/openapi/common/authBindings.ts +0 -12
- /package/src/{control → connector}/common/providerIconSprite.ts +0 -0
package/dist/common/openapi.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { JsonValue,
|
|
1
|
+
import type { JsonValue, ManagedTaskDefinitionOf, TaskExecutor } from './flow-model.js';
|
|
2
2
|
type ObjectValue = {
|
|
3
3
|
[key: string]: JsonValue;
|
|
4
4
|
};
|
|
@@ -36,14 +36,14 @@ export declare function securityOptions(value: JsonValue, path: string, method:
|
|
|
36
36
|
}[];
|
|
37
37
|
export declare function snapshot(documentValue: JsonValue, path: string, method: string): JsonValue;
|
|
38
38
|
export declare function authHandles(auth: readonly OpenApiAuth[]): string[];
|
|
39
|
-
export declare function openApiTask(config: OpenApiExecutor, name?: string):
|
|
39
|
+
export declare function openApiTask(config: OpenApiExecutor, name?: string): ManagedTaskDefinitionOf<OpenApiExecutor>;
|
|
40
40
|
export interface OpenApiFieldIssue {
|
|
41
41
|
readonly field: 'sourceUrl' | 'operation' | 'serverUrl';
|
|
42
42
|
readonly message: string;
|
|
43
43
|
}
|
|
44
44
|
/** The canvas validator and property panel share the same configuration contract. */
|
|
45
|
-
export declare function openApiFieldIssues(task:
|
|
46
|
-
export declare function openApiIssues(task:
|
|
45
|
+
export declare function openApiFieldIssues<Executor extends TaskExecutor>(task: ManagedTaskDefinitionOf<Executor>): OpenApiFieldIssue[];
|
|
46
|
+
export declare function openApiIssues(task: ManagedTaskDefinitionOf<TaskExecutor>): string[];
|
|
47
47
|
export declare function selectOperation(value: JsonValue, sourceUrl: string, path: string, method: string): OpenApiExecutor;
|
|
48
48
|
export declare function buildRequest(config: OpenApiExecutor, input: Readonly<Record<string, JsonValue>>): {
|
|
49
49
|
url: string;
|
package/dist/common/openapi.js
CHANGED
|
@@ -3946,6 +3946,9 @@ function schema(doc, schemaValue) {
|
|
|
3946
3946
|
...Object.keys(defs).length ? { $defs: defs } : {}
|
|
3947
3947
|
};
|
|
3948
3948
|
}
|
|
3949
|
+
function isOpenApiExecutor(executor) {
|
|
3950
|
+
return executor.kind == "openapi";
|
|
3951
|
+
}
|
|
3949
3952
|
function parameters(config) {
|
|
3950
3953
|
const doc = parseOpenApi(config.document);
|
|
3951
3954
|
const { item, op } = operation(doc, config.path, config.method);
|
|
@@ -4067,7 +4070,7 @@ function inlineSchema(value, index) {
|
|
|
4067
4070
|
}
|
|
4068
4071
|
/** The canvas validator and property panel share the same configuration contract. */
|
|
4069
4072
|
function openApiFieldIssues(task) {
|
|
4070
|
-
if (task.executor
|
|
4073
|
+
if (!isOpenApiExecutor(task.executor)) return [];
|
|
4071
4074
|
const config = task.executor;
|
|
4072
4075
|
let field = "sourceUrl";
|
|
4073
4076
|
try {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export { resolveTriggerConfig, triggerConfigValues } from './trigger-config.js';
|
|
2
2
|
import type { ConnectorProxy } from './connector-proxy.js';
|
|
3
|
-
import type { JsonValue
|
|
3
|
+
import type { JsonValue } from './flow-model.js';
|
|
4
4
|
import type { TriggerConfigOption, TriggerConfigOptionsContext } from './trigger-config-options.js';
|
|
5
|
+
import type { TriggerKeySnapshot, TriggerSchedule } from './trigger-model.js';
|
|
5
6
|
export declare const maximumPollCheckpointBytes: number;
|
|
6
7
|
export declare const maximumPollDedupeKeyBytes = 1024;
|
|
7
8
|
export declare const maximumPollEventsPerPage = 100;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
//#region src/http/common/headers.ts
|
|
2
|
+
/** Header names are case-insensitive; never silently combine duplicate business fields. */
|
|
3
|
+
function httpHeaderNameIssue(name, names) {
|
|
4
|
+
if (!/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(name)) return "invalid";
|
|
5
|
+
if (names.some((candidate) => candidate.toLowerCase() === name.toLowerCase())) return "duplicate";
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
1
8
|
//#region src/flow/common/webhookResponse.ts
|
|
2
9
|
function webhookResponseAllowsBody(status) {
|
|
3
10
|
return status !== 204 && status !== 205 && status !== 304;
|
|
4
11
|
}
|
|
5
|
-
|
|
12
|
+
({
|
|
6
13
|
jsonSchema: {
|
|
7
14
|
type: "object",
|
|
8
15
|
additionalProperties: { type: [
|
|
@@ -12,13 +19,7 @@ var webhookHeadersPort = {
|
|
|
12
19
|
] }
|
|
13
20
|
},
|
|
14
21
|
nullable: true
|
|
15
|
-
};
|
|
16
|
-
/** Header names are case-insensitive; never silently combine duplicate business fields. */
|
|
17
|
-
function webhookHeaderNameIssue(name, names) {
|
|
18
|
-
if (!/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(name)) return "invalid";
|
|
19
|
-
if (names.some((candidate) => candidate.toLowerCase() === name.toLowerCase())) return "duplicate";
|
|
20
|
-
}
|
|
21
|
-
webhookHeadersPort.jsonSchema;
|
|
22
|
+
}).jsonSchema;
|
|
22
23
|
function validWebhookStatus(value) {
|
|
23
24
|
return typeof value === "number" && Number.isInteger(value) && value >= 200 && value <= 599 && webhookResponseAllowsBody(value);
|
|
24
25
|
}
|
|
@@ -28,7 +29,7 @@ function webhookHeaderValues(source) {
|
|
|
28
29
|
const headers = {};
|
|
29
30
|
const names = [];
|
|
30
31
|
for (const [name, value] of Object.entries(source)) {
|
|
31
|
-
if (
|
|
32
|
+
if (httpHeaderNameIssue(name, names) != null) return;
|
|
32
33
|
if (typeof value !== "string" && typeof value !== "boolean" && !(typeof value === "number" && Number.isFinite(value))) return;
|
|
33
34
|
const text = String(value);
|
|
34
35
|
if ([...text].some((character) => character.charCodeAt(0) > 255 || /[\0\r\n]/.test(character))) return;
|
|
@@ -52,6 +53,7 @@ var nodeKinds = /* @__PURE__ */ new Set([
|
|
|
52
53
|
"decision",
|
|
53
54
|
"javascript",
|
|
54
55
|
"openapi",
|
|
56
|
+
"http-request",
|
|
55
57
|
"llm",
|
|
56
58
|
"value",
|
|
57
59
|
"wait",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CodeModule, ConnectorCapability, TaskCapability, JsonValue } from './flow-
|
|
1
|
+
import type { CodeModule, ConnectorCapability, TaskCapability, JsonValue } from './flow-model.js';
|
|
2
2
|
export { currentEngineContract, nodejsEngineContract, findEngineContract, type EngineContract } from './engine-contract.js';
|
|
3
3
|
export type RuntimeModule = Pick<CodeModule, 'imports' | 'source'>;
|
|
4
4
|
/** Snapshot a Task result before JSON transport can discard or coerce invalid values. */
|
|
@@ -97,6 +97,28 @@ export interface DecisionTaskInvocation {
|
|
|
97
97
|
readonly version: 1;
|
|
98
98
|
}
|
|
99
99
|
export type InvokeDecisionTask = (invocation: DecisionTaskInvocation) => Promise<LlmTaskResult>;
|
|
100
|
+
/**
|
|
101
|
+
* Serialized into the sandbox before the Capability helpers that use it; keep it self-contained. Encodes in guest
|
|
102
|
+
* JavaScript, because Node compatibility `atob`/`btoa` route through bounded Host primitives.
|
|
103
|
+
*/
|
|
104
|
+
export declare function createBase64(): Readonly<{
|
|
105
|
+
encode(bytes: Uint8Array): string;
|
|
106
|
+
decode(text: unknown): Uint8Array;
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* Serialized into the sandbox; keep it self-contained. Transfers bytes as base64 chunks through
|
|
110
|
+
* `artifact.write`, `artifact.put` and `artifact.read` so each Capability message stays bounded.
|
|
111
|
+
*/
|
|
112
|
+
export declare function createArtifacts(invoke: (kind: string, payload: JsonValue) => Promise<RuntimeCapabilityResponse>, { decode, encode }?: ReturnType<typeof createBase64>): Readonly<{
|
|
113
|
+
put(data: unknown, options: unknown): Promise<JsonValue>;
|
|
114
|
+
open(ref: unknown): Promise<Uint8Array>;
|
|
115
|
+
}>;
|
|
116
|
+
/**
|
|
117
|
+
* Serialized into the sandbox; keep it self-contained. `context.fetch` sends one `http.fetch` Capability call per request.
|
|
118
|
+
* The Host authorizes the URL against the node's `http` Capability, does not follow redirects and adds no credentials.
|
|
119
|
+
* Request and response bodies are limited to 1 MiB; the response is a read-only subset of the Fetch `Response`.
|
|
120
|
+
*/
|
|
121
|
+
export declare function createFetch(invoke: (kind: string, payload: JsonValue) => Promise<RuntimeCapabilityResponse>, { decode, encode }?: ReturnType<typeof createBase64>): (input: unknown, init?: unknown) => Promise<unknown>;
|
|
100
122
|
/** Serialized into the sandbox alongside the strict JSON snapshot helper. */
|
|
101
123
|
export declare function createWorkflows(invoke: (payload: JsonValue) => Promise<RuntimeCapabilityResponse>): Readonly<{
|
|
102
124
|
call(name: string, input?: Readonly<Record<string, JsonValue>>): Promise<JsonValue>;
|