@fluidgrids/workflows 2026.1028.2 → 2026.1030.1
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 +181 -11
- package/dist/{activation-BBh1p82z.d.cts → activation-DqUfpHzk.d.cts} +1 -1
- package/dist/{activation-DnhG7SmF.d.ts → activation-xpx1oWuo.d.ts} +1 -1
- package/dist/{chunk-VRHHBPT6.js → chunk-2D3MYIIF.js} +1212 -128
- package/dist/chunk-3U2NU7YC.cjs +124 -0
- package/dist/{chunk-NEIUQASE.cjs → chunk-4QKB4ARC.cjs} +3 -3
- package/dist/{chunk-GBQ33SIZ.cjs → chunk-54FLQNUM.cjs} +12 -1
- package/dist/chunk-5HIVIV53.js +330 -0
- package/dist/chunk-5MFVJM76.js +1222 -0
- package/dist/{chunk-JD2VQIDZ.cjs → chunk-672KMMBK.cjs} +2 -2
- package/dist/{chunk-C5OLWZ42.js → chunk-6A2FGSUS.js} +22 -14
- package/dist/{chunk-XKJA7KX3.js → chunk-6OLN6BMB.js} +52 -3
- package/dist/{chunk-6FSHT5IL.js → chunk-7EZIANC7.js} +1 -1
- package/dist/{chunk-2J6TF7YI.cjs → chunk-A5SXCA62.cjs} +10 -3
- package/dist/{chunk-BO6OVILK.js → chunk-AC6ZEXVR.js} +10 -4
- package/dist/{chunk-ABFZWYHT.js → chunk-AE5Q6ZAJ.js} +315 -50
- package/dist/chunk-C4F5KJTI.js +293 -0
- package/dist/{chunk-IISBRUWJ.js → chunk-G5H32GIG.js} +1 -1
- package/dist/chunk-GEQDGUGB.cjs +2719 -0
- package/dist/{chunk-XHXIDVEC.js → chunk-HCM7ZC7Q.js} +1 -1
- package/dist/chunk-HMZUGSMU.cjs +1554 -0
- package/dist/{chunk-SAOBPYYJ.cjs → chunk-IQPXHQQQ.cjs} +8 -4
- package/dist/{chunk-P6TA5EZT.cjs → chunk-ISOIA7NV.cjs} +335 -58
- package/dist/chunk-JSC75O5C.cjs +167 -0
- package/dist/chunk-M272AHEX.js +25 -0
- package/dist/{chunk-BD7ZPG53.js → chunk-NWQ5WRLE.js} +10 -2
- package/dist/chunk-ODZ2IAR2.cjs +1247 -0
- package/dist/chunk-Q4MWQNJK.cjs +28 -0
- package/dist/{chunk-HWJZVOG7.js → chunk-SR7TR5KX.js} +6 -2
- package/dist/{chunk-FEW3JBYA.cjs → chunk-TCTE7DX5.cjs} +3 -3
- package/dist/{chunk-623FVQSN.cjs → chunk-TYF56RGB.cjs} +123 -0
- package/dist/chunk-VA4OFR72.cjs +324 -0
- package/dist/chunk-VU5S5A7V.js +150 -0
- package/dist/chunk-YEHR4NNE.js +1522 -0
- package/dist/{chunk-FMSW2HDF.cjs → chunk-ZCGKGDCL.cjs} +23 -15
- package/dist/codegen/index.d.cts +2 -2
- package/dist/codegen/index.d.ts +2 -2
- package/dist/collect-6NIEufHd.d.ts +103 -0
- package/dist/collect-CcTCKqx6.d.cts +103 -0
- package/dist/{file-BOoHZgoQ.d.cts → file-BxYpwjRQ.d.cts} +1007 -21
- package/dist/{file-yuPCFU5b.d.ts → file-CFdPQJI9.d.ts} +1007 -21
- package/dist/history/index.cjs +375 -86
- package/dist/history/index.d.cts +590 -12
- package/dist/history/index.d.ts +590 -12
- package/dist/history/index.js +50 -4
- package/dist/index.cjs +156 -50
- package/dist/index.d.cts +38 -58
- package/dist/index.d.ts +38 -58
- package/dist/index.js +6 -4
- package/dist/interceptors-CNcr2dlk.d.ts +159 -0
- package/dist/interceptors-CqkNZVfI.d.cts +159 -0
- package/dist/ir/index.cjs +362 -38
- package/dist/ir/index.d.cts +282 -7
- package/dist/ir/index.d.ts +282 -7
- package/dist/ir/index.js +329 -23
- package/dist/{lower-BzmUz0sq.d.cts → lower-BtRfIW2A.d.cts} +56 -8
- package/dist/{lower-_-iT4HYs.d.ts → lower-CpsMFOFX.d.ts} +56 -8
- package/dist/{manifest-C8N6HDYl.d.ts → manifest-D-I_twys.d.ts} +1 -1
- package/dist/{manifest-0OLw0i7k.d.cts → manifest-DahBQVM8.d.cts} +1 -1
- package/dist/node-evaluator-DGQDPSPI.cjs +24 -0
- package/dist/node-evaluator-LEEVD7H7.js +14 -0
- package/dist/payload-fields-BVRQn2yH.d.cts +122 -0
- package/dist/payload-fields-oOBWxDiG.d.ts +122 -0
- package/dist/quickjs/index.cjs +28 -27
- package/dist/quickjs/index.d.cts +6 -6
- package/dist/quickjs/index.d.ts +6 -6
- package/dist/quickjs/index.js +10 -9
- package/dist/roundtrip/index.cjs +259 -51
- package/dist/roundtrip/index.d.cts +100 -9
- package/dist/roundtrip/index.d.ts +100 -9
- package/dist/roundtrip/index.js +177 -11
- package/dist/runtime/index.cjs +21 -20
- package/dist/runtime/index.d.cts +184 -15
- package/dist/runtime/index.d.ts +184 -15
- package/dist/runtime/index.js +8 -7
- package/dist/testing/index.cjs +1122 -115
- package/dist/testing/index.d.cts +294 -13
- package/dist/testing/index.d.ts +294 -13
- package/dist/testing/index.js +1086 -84
- package/dist/{types-DV-HX_Gt.d.ts → types-Bv2i4cBX.d.cts} +244 -33
- package/dist/{types-CpBBjaGX.d.cts → types-DGx-b9eq.d.ts} +244 -33
- package/dist/{types-BGoPzgcl.d.ts → types-V7jEEUaL.d.cts} +20 -1
- package/dist/{types-BGoPzgcl.d.cts → types-V7jEEUaL.d.ts} +20 -1
- package/dist/{workflow-Bpr3vnA_.d.ts → workflow-B18OeF7g.d.ts} +2 -2
- package/dist/workflow-BGnv8SS6.d.ts +803 -0
- package/dist/{workflow-FXUkpIBc.d.cts → workflow-BJPFv3cp.d.cts} +2 -2
- package/dist/workflow-DS32Gtws.d.cts +803 -0
- package/fixtures/histories/activity-options-updated.history.json +159 -0
- package/fixtures/histories/activity-paused-unpaused.history.json +160 -0
- package/fixtures/histories/auto-upgrade-patched.history.json +276 -0
- package/fixtures/histories/benign-failure.history.json +146 -0
- package/fixtures/histories/cancel-activity-try-cancel.history.json +150 -0
- package/fixtures/histories/child-cancel-wait-requested.history.json +217 -0
- package/fixtures/histories/child-options-roundtrip.history.json +192 -0
- package/fixtures/histories/codec-opaque.history.json +229 -0
- package/fixtures/histories/continue-as-new-last-result.history.json +86 -0
- package/fixtures/histories/continue-as-new-options.history.json +99 -0
- package/fixtures/histories/continue-as-new-r1-long-task-queue.history.json +78 -0
- package/fixtures/histories/continue-as-new-r1-retry-options.history.json +83 -0
- package/fixtures/histories/dynamic-workflow.history.json +150 -0
- package/fixtures/histories/execution-timeout-chain.history.json +98 -0
- package/fixtures/histories/external-cancel-resolved.history.json +123 -0
- package/fixtures/histories/external-cancel-unknown-target.history.json +127 -0
- package/fixtures/histories/failure-error-types-fails-run.history.json +144 -0
- package/fixtures/histories/handler-drain-warn.history.json +222 -0
- package/fixtures/histories/heartbeat-details-on-retry.history.json +145 -0
- package/fixtures/histories/interceptor-headers.history.json +339 -0
- package/fixtures/histories/local-activity-abandoned-at-completion.history.json +73 -0
- package/fixtures/histories/local-activity-cancelled-in-scope.history.json +118 -0
- package/fixtures/histories/local-activity-completed.history.json +157 -0
- package/fixtures/histories/local-activity-failed.history.json +93 -0
- package/fixtures/histories/local-activity-retry-in-task.history.json +88 -0
- package/fixtures/histories/query-custom.history.json +213 -0
- package/fixtures/histories/query-default-handler.history.json +120 -0
- package/fixtures/histories/reset-forked-reapplied-signals.history.json +239 -0
- package/fixtures/histories/reset-reapplied-update-admitted.history.json +228 -0
- package/fixtures/histories/run-retry-last-failure.history.json +90 -0
- package/fixtures/histories/run-timeout.history.json +159 -0
- package/fixtures/histories/schedule-to-start-timeout.history.json +132 -0
- package/fixtures/histories/search-attributes-upserted.history.json +177 -0
- package/fixtures/histories/start-delay-signal-ends-delay.history.json +155 -0
- package/fixtures/histories/typeerror-task-retry-100.history.json +137 -0
- package/fixtures/histories/update-accepted-completed.history.json +45 -30
- package/fixtures/histories/update-default-handler.history.json +246 -0
- package/fixtures/histories/update-handler-awaits-activity.history.json +196 -0
- package/fixtures/histories/update-not-handled.history.json +138 -0
- package/fixtures/histories/update-rejected-no-event.history.json +190 -0
- package/fixtures/histories/update-with-start-admitted.history.json +150 -0
- package/fixtures/histories/user-activity-cancel.history.json +149 -0
- package/fixtures/histories/user-activity-retry.history.json +143 -0
- package/fixtures/histories/user-activity.history.json +149 -0
- package/package.json +1 -1
- package/schema/bridge-v2.schema.json +1062 -0
- package/schema/history-file.schema.json +538 -83
- package/schema/ir-v2.schema.json +290 -0
- package/schema/payload-fields.json +162 -0
- package/schema/run-event.schema.json +503 -82
- package/schema/workflow-command.schema.json +372 -69
- package/schema/workflow-task.schema.json +924 -171
- package/dist/assemble-BLqQ8lSu.d.cts +0 -39
- package/dist/assemble-DWgaXHd-.d.ts +0 -39
- package/dist/chunk-DHTLALBL.cjs +0 -80
- package/dist/chunk-DJYMDLV5.js +0 -227
- package/dist/chunk-I5LR3D2K.js +0 -869
- package/dist/chunk-M4BBAERY.cjs +0 -1635
- package/dist/chunk-N23SKIG4.js +0 -73
- package/dist/chunk-PZCVF76Q.cjs +0 -868
- package/dist/chunk-QQ6ULXHI.cjs +0 -885
- package/dist/chunk-UK3WM7YZ.cjs +0 -75
- package/dist/chunk-VOKMAAJP.js +0 -848
- package/dist/node-evaluator-4MSDKWOG.cjs +0 -22
- package/dist/node-evaluator-SX4LEYQC.js +0 -12
- package/dist/workflow-C2a05WUJ.d.ts +0 -444
- package/dist/workflow-J-yYixny.d.cts +0 -444
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var chunkFR7KYWRO_cjs = require('./chunk-FR7KYWRO.cjs');
|
|
4
|
-
|
|
5
3
|
// src/durable/definitions.ts
|
|
6
4
|
function checkName(name, what) {
|
|
7
5
|
if (typeof name !== "string" || name === "" || name.startsWith("__"))
|
|
@@ -86,16 +84,36 @@ var ApplicationError = class extends WorkflowFailure {
|
|
|
86
84
|
}
|
|
87
85
|
};
|
|
88
86
|
var ActivityFailure = class extends WorkflowFailure {
|
|
89
|
-
constructor(message, activityId, nodeType, operation, cause) {
|
|
87
|
+
constructor(message, activityId, nodeType, operation, cause, activityName) {
|
|
90
88
|
super(message, cause instanceof WorkflowFailure ? cause.errorType : "UNKNOWN", { cause });
|
|
91
89
|
this.activityId = activityId;
|
|
92
90
|
this.nodeType = nodeType;
|
|
93
91
|
this.operation = operation;
|
|
92
|
+
this.activityName = activityName;
|
|
94
93
|
this.name = "ActivityFailure";
|
|
95
94
|
}
|
|
96
95
|
activityId;
|
|
97
96
|
nodeType;
|
|
98
97
|
operation;
|
|
98
|
+
activityName;
|
|
99
|
+
};
|
|
100
|
+
var ActivityPausedError = class extends ApplicationError {
|
|
101
|
+
constructor(message = "The activity was paused", details) {
|
|
102
|
+
super(message, {
|
|
103
|
+
type: "ActivityPausedError",
|
|
104
|
+
errorType: "TRANSIENT",
|
|
105
|
+
...details !== void 0 ? { details } : {}
|
|
106
|
+
});
|
|
107
|
+
this.name = "ActivityPausedError";
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
var QueryHandlerSideEffect = class extends Error {
|
|
111
|
+
constructor(what) {
|
|
112
|
+
super(
|
|
113
|
+
`${what} is not allowed in a query handler or an update validator; they must not change the run`
|
|
114
|
+
);
|
|
115
|
+
this.name = "QueryHandlerSideEffect";
|
|
116
|
+
}
|
|
99
117
|
};
|
|
100
118
|
var ChildRunFailure = class extends WorkflowFailure {
|
|
101
119
|
constructor(message, childId, childRunId, cause) {
|
|
@@ -234,23 +252,15 @@ function failureToError(failure, depth = 0) {
|
|
|
234
252
|
return error;
|
|
235
253
|
}
|
|
236
254
|
|
|
237
|
-
// src/durable/durations.ts
|
|
238
|
-
function toMs(value, what = "duration") {
|
|
239
|
-
const ms = chunkFR7KYWRO_cjs.durationMs(value, "ms");
|
|
240
|
-
if (ms === void 0) throw new TypeError(`${what} "${String(value)}" is not a duration`);
|
|
241
|
-
return Math.round(ms);
|
|
242
|
-
}
|
|
243
|
-
function optionalMs(value, what) {
|
|
244
|
-
return value === void 0 ? void 0 : toMs(value, what);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
255
|
exports.ActivityFailure = ActivityFailure;
|
|
256
|
+
exports.ActivityPausedError = ActivityPausedError;
|
|
248
257
|
exports.ApplicationError = ApplicationError;
|
|
249
258
|
exports.CancelledFailure = CancelledFailure;
|
|
250
259
|
exports.ChildRunFailure = ChildRunFailure;
|
|
251
260
|
exports.DeterminismViolation = DeterminismViolation;
|
|
252
261
|
exports.HistoryLimitExceeded = HistoryLimitExceeded;
|
|
253
262
|
exports.PhaseCFeatureError = PhaseCFeatureError;
|
|
263
|
+
exports.QueryHandlerSideEffect = QueryHandlerSideEffect;
|
|
254
264
|
exports.ServerFailure = ServerFailure;
|
|
255
265
|
exports.TerminatedFailure = TerminatedFailure;
|
|
256
266
|
exports.TimeoutFailure = TimeoutFailure;
|
|
@@ -262,6 +272,4 @@ exports.errorToFailure = errorToFailure;
|
|
|
262
272
|
exports.failureToError = failureToError;
|
|
263
273
|
exports.isCancellation = isCancellation;
|
|
264
274
|
exports.isRunFailure = isRunFailure;
|
|
265
|
-
exports.optionalMs = optionalMs;
|
|
266
275
|
exports.signalName = signalName;
|
|
267
|
-
exports.toMs = toMs;
|
package/dist/codegen/index.d.cts
CHANGED
package/dist/codegen/index.d.ts
CHANGED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { P as Position, J as JsonObject, d as ConnectionRef, i as WorkflowAuthoring, W as WorkflowDefinition, b as WorkflowInterface, k as WorkflowConfig } from './types-V7jEEUaL.js';
|
|
2
|
+
import { T as Tier1Recording, x as Tier1Workflow } from './workflow-B18OeF7g.js';
|
|
3
|
+
|
|
4
|
+
declare const LAYOUT_FORMAT = "fluidgrids.layout";
|
|
5
|
+
declare const LAYOUT_FORMAT_VERSION = 1;
|
|
6
|
+
/**
|
|
7
|
+
* The layout sidecar (`workflows/<key>.layout.json`): canvas positions, sticky
|
|
8
|
+
* notes and `meta.layout`, kept out of the code so it stays readable.
|
|
9
|
+
*/
|
|
10
|
+
interface LayoutSidecar {
|
|
11
|
+
format: typeof LAYOUT_FORMAT;
|
|
12
|
+
formatVersion: typeof LAYOUT_FORMAT_VERSION;
|
|
13
|
+
positions: Record<string, Position>;
|
|
14
|
+
stickyNotes?: JsonObject[];
|
|
15
|
+
metaLayout?: JsonObject;
|
|
16
|
+
}
|
|
17
|
+
/** How connection names in code resolve to connection references. */
|
|
18
|
+
type ConnectionResolver = Readonly<Record<string, ConnectionRef>> | ((name: string) => ConnectionRef | undefined);
|
|
19
|
+
interface AssembleOptions {
|
|
20
|
+
layout?: LayoutSidecar;
|
|
21
|
+
connections?: ConnectionResolver;
|
|
22
|
+
/** TEST-only pinned data (`workflows/<key>.pinned.json`). */
|
|
23
|
+
pinnedData?: JsonObject;
|
|
24
|
+
/** Provenance; defaults to `{ mode: 'canvas', generator: 'sdk-ts', generatorVersion }`. */
|
|
25
|
+
authoring?: WorkflowAuthoring;
|
|
26
|
+
}
|
|
27
|
+
/** Connection names used in code that the target workspace does not have. */
|
|
28
|
+
declare class UnresolvedConnectionsError extends Error {
|
|
29
|
+
readonly names: string[];
|
|
30
|
+
constructor(names: string[]);
|
|
31
|
+
}
|
|
32
|
+
/** Validate a parsed layout sidecar. */
|
|
33
|
+
declare function parseLayoutSidecar(value: unknown): LayoutSidecar;
|
|
34
|
+
/** Assemble IR v2 from a recording. */
|
|
35
|
+
declare function assembleRecording(recording: Tier1Recording, options?: AssembleOptions): WorkflowDefinition;
|
|
36
|
+
/** Lower a tier-1 workflow to IR v2 (spec 10 §1 `toIR`). */
|
|
37
|
+
declare function toIR(workflow: Tier1Workflow, options?: AssembleOptions): WorkflowDefinition;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Runs inside the evaluation isolate at the end of a bundle: gathers the
|
|
41
|
+
* recordings of every exported `defineWorkflow` value and the declarations of
|
|
42
|
+
* every exported tier-2 `workflow()` as one JSON string, the only thing that
|
|
43
|
+
* leaves the isolate.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
declare const COLLECTION_FORMAT = "fluidgrids.tier1-collection";
|
|
47
|
+
interface CollectedWorkflow {
|
|
48
|
+
module: string;
|
|
49
|
+
exportName: string;
|
|
50
|
+
recording: Tier1Recording;
|
|
51
|
+
}
|
|
52
|
+
/** The trigger a standalone tier-2 workflow declares. */
|
|
53
|
+
interface CollectedTrigger {
|
|
54
|
+
nodeType: string;
|
|
55
|
+
version?: string;
|
|
56
|
+
operation?: string;
|
|
57
|
+
args?: JsonObject;
|
|
58
|
+
id?: string;
|
|
59
|
+
}
|
|
60
|
+
/** One exported tier-2 workflow (C-ABI `durable` entries of the collection). */
|
|
61
|
+
interface CollectedDurableWorkflow {
|
|
62
|
+
module: string;
|
|
63
|
+
exportName: string;
|
|
64
|
+
/** The workflow key it gets when standalone. */
|
|
65
|
+
name: string;
|
|
66
|
+
title?: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
taskQueue: string;
|
|
69
|
+
interface: WorkflowInterface;
|
|
70
|
+
standalone?: boolean;
|
|
71
|
+
trigger?: CollectedTrigger;
|
|
72
|
+
/** Run-level settings the declaration lowers into `config` (R2). */
|
|
73
|
+
config?: WorkflowConfig;
|
|
74
|
+
/** Runtime features its options use (C-FEATURES): `autoUpgrade`, `runRetry`, `timeouts`, `dynamic`. */
|
|
75
|
+
features?: string[];
|
|
76
|
+
/** A dynamic workflow (Phase C): `lower()` writes it as `code.exports.workflows["*"]`. */
|
|
77
|
+
dynamic?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/** An exported user-activity implementation found in the workflow bundle (Phase C). */
|
|
80
|
+
interface CollectedActivityImplementation {
|
|
81
|
+
module: string;
|
|
82
|
+
exportName: string;
|
|
83
|
+
name: string;
|
|
84
|
+
}
|
|
85
|
+
interface Tier1Collection {
|
|
86
|
+
format: typeof COLLECTION_FORMAT;
|
|
87
|
+
workflows: CollectedWorkflow[];
|
|
88
|
+
/** Tier-2 functions; absent when the bundle has none. */
|
|
89
|
+
durable?: CollectedDurableWorkflow[];
|
|
90
|
+
/** User-activity implementations exported by bundle modules; they belong on a worker. */
|
|
91
|
+
activityImplementations?: CollectedActivityImplementation[];
|
|
92
|
+
/**
|
|
93
|
+
* Modules that export a binding named `interceptors`, whatever its value:
|
|
94
|
+
* the runtime registers those exports as workflow interceptors, so
|
|
95
|
+
* `lower()` reports the `interceptors` feature from the evaluated modules
|
|
96
|
+
* rather than from the source text (C-FEATURES).
|
|
97
|
+
*/
|
|
98
|
+
interceptorModules?: string[];
|
|
99
|
+
}
|
|
100
|
+
/** Collect the workflows exported by each module, as JSON. */
|
|
101
|
+
declare function collectWorkflowExports(modules: ReadonlyArray<readonly [string, Record<string, unknown>]>): string;
|
|
102
|
+
|
|
103
|
+
export { type AssembleOptions as A, COLLECTION_FORMAT as C, LAYOUT_FORMAT as L, type Tier1Collection as T, UnresolvedConnectionsError as U, type CollectedDurableWorkflow as a, type CollectedTrigger as b, type CollectedWorkflow as c, type ConnectionResolver as d, LAYOUT_FORMAT_VERSION as e, type LayoutSidecar as f, assembleRecording as g, collectWorkflowExports as h, parseLayoutSidecar as p, toIR as t };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { P as Position, J as JsonObject, d as ConnectionRef, i as WorkflowAuthoring, W as WorkflowDefinition, b as WorkflowInterface, k as WorkflowConfig } from './types-V7jEEUaL.cjs';
|
|
2
|
+
import { T as Tier1Recording, x as Tier1Workflow } from './workflow-BJPFv3cp.cjs';
|
|
3
|
+
|
|
4
|
+
declare const LAYOUT_FORMAT = "fluidgrids.layout";
|
|
5
|
+
declare const LAYOUT_FORMAT_VERSION = 1;
|
|
6
|
+
/**
|
|
7
|
+
* The layout sidecar (`workflows/<key>.layout.json`): canvas positions, sticky
|
|
8
|
+
* notes and `meta.layout`, kept out of the code so it stays readable.
|
|
9
|
+
*/
|
|
10
|
+
interface LayoutSidecar {
|
|
11
|
+
format: typeof LAYOUT_FORMAT;
|
|
12
|
+
formatVersion: typeof LAYOUT_FORMAT_VERSION;
|
|
13
|
+
positions: Record<string, Position>;
|
|
14
|
+
stickyNotes?: JsonObject[];
|
|
15
|
+
metaLayout?: JsonObject;
|
|
16
|
+
}
|
|
17
|
+
/** How connection names in code resolve to connection references. */
|
|
18
|
+
type ConnectionResolver = Readonly<Record<string, ConnectionRef>> | ((name: string) => ConnectionRef | undefined);
|
|
19
|
+
interface AssembleOptions {
|
|
20
|
+
layout?: LayoutSidecar;
|
|
21
|
+
connections?: ConnectionResolver;
|
|
22
|
+
/** TEST-only pinned data (`workflows/<key>.pinned.json`). */
|
|
23
|
+
pinnedData?: JsonObject;
|
|
24
|
+
/** Provenance; defaults to `{ mode: 'canvas', generator: 'sdk-ts', generatorVersion }`. */
|
|
25
|
+
authoring?: WorkflowAuthoring;
|
|
26
|
+
}
|
|
27
|
+
/** Connection names used in code that the target workspace does not have. */
|
|
28
|
+
declare class UnresolvedConnectionsError extends Error {
|
|
29
|
+
readonly names: string[];
|
|
30
|
+
constructor(names: string[]);
|
|
31
|
+
}
|
|
32
|
+
/** Validate a parsed layout sidecar. */
|
|
33
|
+
declare function parseLayoutSidecar(value: unknown): LayoutSidecar;
|
|
34
|
+
/** Assemble IR v2 from a recording. */
|
|
35
|
+
declare function assembleRecording(recording: Tier1Recording, options?: AssembleOptions): WorkflowDefinition;
|
|
36
|
+
/** Lower a tier-1 workflow to IR v2 (spec 10 §1 `toIR`). */
|
|
37
|
+
declare function toIR(workflow: Tier1Workflow, options?: AssembleOptions): WorkflowDefinition;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Runs inside the evaluation isolate at the end of a bundle: gathers the
|
|
41
|
+
* recordings of every exported `defineWorkflow` value and the declarations of
|
|
42
|
+
* every exported tier-2 `workflow()` as one JSON string, the only thing that
|
|
43
|
+
* leaves the isolate.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
declare const COLLECTION_FORMAT = "fluidgrids.tier1-collection";
|
|
47
|
+
interface CollectedWorkflow {
|
|
48
|
+
module: string;
|
|
49
|
+
exportName: string;
|
|
50
|
+
recording: Tier1Recording;
|
|
51
|
+
}
|
|
52
|
+
/** The trigger a standalone tier-2 workflow declares. */
|
|
53
|
+
interface CollectedTrigger {
|
|
54
|
+
nodeType: string;
|
|
55
|
+
version?: string;
|
|
56
|
+
operation?: string;
|
|
57
|
+
args?: JsonObject;
|
|
58
|
+
id?: string;
|
|
59
|
+
}
|
|
60
|
+
/** One exported tier-2 workflow (C-ABI `durable` entries of the collection). */
|
|
61
|
+
interface CollectedDurableWorkflow {
|
|
62
|
+
module: string;
|
|
63
|
+
exportName: string;
|
|
64
|
+
/** The workflow key it gets when standalone. */
|
|
65
|
+
name: string;
|
|
66
|
+
title?: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
taskQueue: string;
|
|
69
|
+
interface: WorkflowInterface;
|
|
70
|
+
standalone?: boolean;
|
|
71
|
+
trigger?: CollectedTrigger;
|
|
72
|
+
/** Run-level settings the declaration lowers into `config` (R2). */
|
|
73
|
+
config?: WorkflowConfig;
|
|
74
|
+
/** Runtime features its options use (C-FEATURES): `autoUpgrade`, `runRetry`, `timeouts`, `dynamic`. */
|
|
75
|
+
features?: string[];
|
|
76
|
+
/** A dynamic workflow (Phase C): `lower()` writes it as `code.exports.workflows["*"]`. */
|
|
77
|
+
dynamic?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/** An exported user-activity implementation found in the workflow bundle (Phase C). */
|
|
80
|
+
interface CollectedActivityImplementation {
|
|
81
|
+
module: string;
|
|
82
|
+
exportName: string;
|
|
83
|
+
name: string;
|
|
84
|
+
}
|
|
85
|
+
interface Tier1Collection {
|
|
86
|
+
format: typeof COLLECTION_FORMAT;
|
|
87
|
+
workflows: CollectedWorkflow[];
|
|
88
|
+
/** Tier-2 functions; absent when the bundle has none. */
|
|
89
|
+
durable?: CollectedDurableWorkflow[];
|
|
90
|
+
/** User-activity implementations exported by bundle modules; they belong on a worker. */
|
|
91
|
+
activityImplementations?: CollectedActivityImplementation[];
|
|
92
|
+
/**
|
|
93
|
+
* Modules that export a binding named `interceptors`, whatever its value:
|
|
94
|
+
* the runtime registers those exports as workflow interceptors, so
|
|
95
|
+
* `lower()` reports the `interceptors` feature from the evaluated modules
|
|
96
|
+
* rather than from the source text (C-FEATURES).
|
|
97
|
+
*/
|
|
98
|
+
interceptorModules?: string[];
|
|
99
|
+
}
|
|
100
|
+
/** Collect the workflows exported by each module, as JSON. */
|
|
101
|
+
declare function collectWorkflowExports(modules: ReadonlyArray<readonly [string, Record<string, unknown>]>): string;
|
|
102
|
+
|
|
103
|
+
export { type AssembleOptions as A, COLLECTION_FORMAT as C, LAYOUT_FORMAT as L, type Tier1Collection as T, UnresolvedConnectionsError as U, type CollectedDurableWorkflow as a, type CollectedTrigger as b, type CollectedWorkflow as c, type ConnectionResolver as d, LAYOUT_FORMAT_VERSION as e, type LayoutSidecar as f, assembleRecording as g, collectWorkflowExports as h, parseLayoutSidecar as p, toIR as t };
|