@lovable.dev/workflows-sdk 0.0.0-dev.2 → 0.0.0-dev.21

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.
@@ -0,0 +1,538 @@
1
+ import { t as defaultDurableId } from "./durable-ids-LsygHSZC.js";
2
+ //#region src/manifests/handler-source.ts
3
+ const nativeFunctionSource = /\{\s*\[native code\]\s*\}\s*$/;
4
+ function workflowHandlerSource(handler) {
5
+ const source = Function.prototype.toString.call(handler);
6
+ return nativeFunctionSource.test(source) ? void 0 : source;
7
+ }
8
+ //#endregion
9
+ //#region src/manifests/graph.ts
10
+ const durableMethods = {
11
+ step: 0,
12
+ approve: 0,
13
+ waitForEvent: 0,
14
+ sleep: 0,
15
+ sleepUntil: 0,
16
+ now: 0,
17
+ uuid: 0
18
+ };
19
+ let loaded;
20
+ async function loadTypeScript() {
21
+ if (loaded !== void 0) return loaded;
22
+ try {
23
+ const module = await import("typescript");
24
+ const api = module.default ?? module;
25
+ loaded = typeof api?.createSourceFile === "function" ? api : null;
26
+ } catch {
27
+ loaded = null;
28
+ }
29
+ return loaded;
30
+ }
31
+ async function extractWorkflowGraph(handler) {
32
+ const graph = {
33
+ source: "inferred",
34
+ scope: "handler",
35
+ complete: true,
36
+ nodes: [],
37
+ edges: [],
38
+ diagnostics: []
39
+ };
40
+ function addNode(node, parents) {
41
+ const id = `node-${graph.nodes.length}`;
42
+ graph.nodes.push({
43
+ id,
44
+ ...node
45
+ });
46
+ const seen = /* @__PURE__ */ new Set();
47
+ for (const parent of parents) {
48
+ const key = JSON.stringify(parent);
49
+ if (seen.has(key)) continue;
50
+ seen.add(key);
51
+ if (parent.kind === "order") graph.edges.push({
52
+ source: parent.source,
53
+ target: id,
54
+ kind: "order"
55
+ });
56
+ else graph.edges.push({
57
+ source: parent.source,
58
+ target: id,
59
+ kind: "branch",
60
+ outcome: parent.outcome
61
+ });
62
+ }
63
+ return [{
64
+ source: id,
65
+ kind: "order"
66
+ }];
67
+ }
68
+ function degrade(reason) {
69
+ graph.complete = false;
70
+ if (!graph.diagnostics.includes(reason)) graph.diagnostics.push(reason);
71
+ }
72
+ function unknown(reason, parents) {
73
+ degrade(reason);
74
+ return addNode({
75
+ kind: "unknown",
76
+ label: reason
77
+ }, parents);
78
+ }
79
+ const api = await loadTypeScript();
80
+ if (!api) {
81
+ unknown("Install typescript to infer step graphs", []);
82
+ return graph;
83
+ }
84
+ const ts = api;
85
+ const handlerSource = workflowHandlerSource(handler);
86
+ if (!handlerSource) {
87
+ unknown("Handler source is unavailable", []);
88
+ return graph;
89
+ }
90
+ const source = ts.createSourceFile("handler.js", `const handler = ${handlerSource};`, ts.ScriptTarget.ESNext, true, ts.ScriptKind.JS);
91
+ const declaration = source.statements[0];
92
+ const fn = declaration && ts.isVariableStatement(declaration) ? declaration.declarationList.declarations[0]?.initializer : void 0;
93
+ if (!fn || !ts.isArrowFunction(fn) && !ts.isFunctionExpression(fn)) {
94
+ unknown("Handler source is unavailable", []);
95
+ return graph;
96
+ }
97
+ const parameter = fn.parameters[0]?.name;
98
+ if (parameter && !ts.isIdentifier(parameter)) {
99
+ unknown("Destructured workflow context is not supported yet", []);
100
+ return graph;
101
+ }
102
+ const context = parameter?.text;
103
+ function contains(node, predicate, skipFunctions = false) {
104
+ if (skipFunctions && ts.isFunctionLike(node)) return false;
105
+ return predicate(node) || Boolean(ts.forEachChild(node, (child) => contains(child, predicate, skipFunctions) || void 0));
106
+ }
107
+ function durableCall(node) {
108
+ return ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression) && ts.isIdentifier(node.expression.expression) && node.expression.expression.text === context && node.expression.name.text in durableMethods;
109
+ }
110
+ function stringLiteral(node) {
111
+ return node && (ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)) ? node.text : void 0;
112
+ }
113
+ function numberLiteral(node) {
114
+ if (!node || !ts.isNumericLiteral(node)) return void 0;
115
+ const value = Number(node.text);
116
+ return Number.isFinite(value) ? value : void 0;
117
+ }
118
+ function templateReference(node, parameters) {
119
+ while (ts.isParenthesizedExpression(node)) node = node.expression;
120
+ if (ts.isIdentifier(node)) return parameters.has(node.text) ? node.text : void 0;
121
+ if (ts.isPropertyAccessExpression(node) && !node.questionDotToken) {
122
+ const expression = templateReference(node.expression, parameters);
123
+ return expression === void 0 ? void 0 : `${expression}.${node.name.text}`;
124
+ }
125
+ }
126
+ function stepIdTemplate(node, parameters) {
127
+ if (!node || !ts.isTemplateExpression(node)) return void 0;
128
+ let template = node.head.text;
129
+ for (const span of node.templateSpans) {
130
+ const reference = templateReference(span.expression, parameters);
131
+ if (reference === void 0) return void 0;
132
+ template += `{${reference}}${span.literal.text}`;
133
+ }
134
+ return template;
135
+ }
136
+ function mappedStep(node) {
137
+ while (ts.isParenthesizedExpression(node)) node = node.expression;
138
+ if (!ts.isCallExpression(node) || !ts.isPropertyAccessExpression(node.expression) || node.expression.name.text !== "map" || node.arguments.length !== 1) return;
139
+ const callback = node.arguments[0];
140
+ if (!ts.isArrowFunction(callback) && !ts.isFunctionExpression(callback)) return void 0;
141
+ const parameters = new Set(callback.parameters.flatMap((parameter) => ts.isIdentifier(parameter.name) ? [parameter.name.text] : []));
142
+ let body;
143
+ if (ts.isBlock(callback.body)) {
144
+ const statement = callback.body.statements.length === 1 ? callback.body.statements[0] : void 0;
145
+ body = statement && ts.isReturnStatement(statement) ? statement.expression : void 0;
146
+ } else body = callback.body;
147
+ while (body && (ts.isParenthesizedExpression(body) || ts.isAwaitExpression(body))) body = body.expression;
148
+ if (!body || !durableCall(body) || body.expression.name.text !== "step") return;
149
+ const template = stepIdTemplate(body.arguments[0], parameters);
150
+ return template === void 0 ? void 0 : {
151
+ call: body,
152
+ template
153
+ };
154
+ }
155
+ function readableOptions(node) {
156
+ return node && ts.isObjectLiteralExpression(node) && node.properties.every(ts.isPropertyAssignment) ? node : void 0;
157
+ }
158
+ function option(options, name) {
159
+ for (const property of options?.properties ?? []) {
160
+ if (!ts.isPropertyAssignment(property)) continue;
161
+ if ((ts.isIdentifier(property.name) || ts.isStringLiteral(property.name) ? property.name.text : void 0) === name) return property.initializer;
162
+ }
163
+ }
164
+ function branchMetadata(meta) {
165
+ const branches = option(meta, "branches");
166
+ if (!branches || !ts.isArrayLiteralExpression(branches)) return void 0;
167
+ const path = [];
168
+ for (const element of branches.elements) {
169
+ const entry = readableOptions(element);
170
+ const id = stringLiteral(option(entry, "id"));
171
+ const description = stringLiteral(option(entry, "description"));
172
+ if (id === void 0 || description === void 0) return void 0;
173
+ path.push({
174
+ id,
175
+ description
176
+ });
177
+ }
178
+ return path;
179
+ }
180
+ function operationMeta(call) {
181
+ const method = call.expression.name.text;
182
+ const optionsIndex = method === "step" ? 2 : method === "sleep" || method === "sleepUntil" || method === "waitForEvent" ? 1 : 0;
183
+ return readableOptions(option(readableOptions(call.arguments[optionsIndex]), "meta"));
184
+ }
185
+ function operationBranches(call) {
186
+ return branchMetadata(operationMeta(call));
187
+ }
188
+ function stepMetadata(call) {
189
+ const meta = readableOptions(option(readableOptions(call.arguments[2]), "meta"));
190
+ const description = stringLiteral(option(meta, "description"));
191
+ if (description === void 0) return void 0;
192
+ const groupOptions = readableOptions(option(meta, "group"));
193
+ if (!groupOptions) return { description };
194
+ const id = stringLiteral(option(groupOptions, "id"));
195
+ const label = stringLiteral(option(groupOptions, "label"));
196
+ return id === void 0 || label === void 0 ? { description } : {
197
+ description,
198
+ group: {
199
+ id,
200
+ label
201
+ }
202
+ };
203
+ }
204
+ function operationDescription(options) {
205
+ return stringLiteral(option(readableOptions(option(options, "meta")), "description"));
206
+ }
207
+ function durableStepId(argument, options, fallback) {
208
+ if (argument && !options) return void 0;
209
+ const given = option(options, "id");
210
+ return given ? stringLiteral(given) : fallback;
211
+ }
212
+ function durableNode(call, parents) {
213
+ const method = call.expression.name.text;
214
+ if (method === "step") {
215
+ const stepId = stringLiteral(call.arguments[0]);
216
+ if (stepId === void 0) return unknown("Dynamic step IDs are not supported yet", parents);
217
+ const metadata = stepMetadata(call);
218
+ if (!metadata) return unknown("Step descriptions must be static strings", parents);
219
+ return addNode({
220
+ kind: "step",
221
+ stepId,
222
+ description: metadata.description,
223
+ label: stepId
224
+ }, parents);
225
+ }
226
+ if (method === "approve") {
227
+ const options = readableOptions(call.arguments[0]);
228
+ const title = stringLiteral(option(options, "title"));
229
+ if (title === void 0) return unknown("Dynamic approval titles are not supported yet", parents);
230
+ const stepId = durableStepId(call.arguments[0], options, defaultDurableId({
231
+ kind: "approve",
232
+ title
233
+ }));
234
+ if (stepId === void 0) return unknown("Dynamic approval IDs are not supported yet", parents);
235
+ const description = stringLiteral(option(options, "description"));
236
+ if (description === void 0) return unknown("Approval descriptions must be static strings", parents);
237
+ return addNode({
238
+ kind: "approve",
239
+ stepId,
240
+ description,
241
+ config: {
242
+ title,
243
+ description
244
+ },
245
+ label: title
246
+ }, parents);
247
+ }
248
+ if (method === "waitForEvent") {
249
+ const event = stringLiteral(call.arguments[0]);
250
+ if (event === void 0) return unknown("Dynamic event names are not supported yet", parents);
251
+ const options = readableOptions(call.arguments[1]);
252
+ const stepId = durableStepId(call.arguments[1], options, defaultDurableId({
253
+ kind: "waitForEvent",
254
+ name: event
255
+ }));
256
+ if (stepId === void 0) return unknown("Dynamic waitForEvent IDs are not supported yet", parents);
257
+ const description = operationDescription(options);
258
+ if (description === void 0) return unknown("Wait descriptions must be static strings", parents);
259
+ const given = option(options, "deadline");
260
+ const deadline = numberLiteral(given);
261
+ if (given && deadline === void 0) degrade("Dynamic waitForEvent deadlines are not recorded");
262
+ return addNode({
263
+ kind: "wait-for-event",
264
+ stepId,
265
+ description,
266
+ config: {
267
+ event,
268
+ ...deadline === void 0 ? {} : { deadline }
269
+ },
270
+ label: event
271
+ }, parents);
272
+ }
273
+ if (method === "sleep") {
274
+ const ms = numberLiteral(call.arguments[0]);
275
+ if (ms === void 0) return unknown("Dynamic sleep durations are not supported yet", parents);
276
+ const options = readableOptions(call.arguments[1]);
277
+ const stepId = durableStepId(call.arguments[1], options, defaultDurableId({
278
+ kind: "sleep",
279
+ ms
280
+ }));
281
+ if (stepId === void 0) return unknown("Dynamic sleep IDs are not supported yet", parents);
282
+ const description = operationDescription(options);
283
+ if (description === void 0) return unknown("Sleep descriptions must be static strings", parents);
284
+ return addNode({
285
+ kind: "sleep",
286
+ stepId,
287
+ description,
288
+ config: { ms },
289
+ label: `sleep ${ms}ms`
290
+ }, parents);
291
+ }
292
+ if (method === "sleepUntil") {
293
+ const timestamp = numberLiteral(call.arguments[0]);
294
+ if (timestamp === void 0) return unknown("Dynamic sleepUntil timestamps are not supported yet", parents);
295
+ const options = readableOptions(call.arguments[1]);
296
+ const stepId = durableStepId(call.arguments[1], options, defaultDurableId({
297
+ kind: "sleepUntil",
298
+ timestamp
299
+ }));
300
+ if (stepId === void 0) return unknown("Dynamic sleepUntil IDs are not supported yet", parents);
301
+ const description = operationDescription(options);
302
+ if (description === void 0) return unknown("Sleep descriptions must be static strings", parents);
303
+ return addNode({
304
+ kind: "sleep-until",
305
+ stepId,
306
+ description,
307
+ config: { timestamp },
308
+ label: `sleep until ${timestamp}`
309
+ }, parents);
310
+ }
311
+ const options = readableOptions(call.arguments[0]);
312
+ const stepId = durableStepId(call.arguments[0], options, defaultDurableId({ kind: method }));
313
+ if (stepId === void 0) return unknown(`Dynamic ${method} IDs are not supported yet`, parents);
314
+ const description = operationDescription(options);
315
+ if (description === void 0) return unknown(`${method} descriptions must be static strings`, parents);
316
+ return addNode({
317
+ kind: method,
318
+ stepId,
319
+ description,
320
+ label: stepId
321
+ }, parents);
322
+ }
323
+ function path(tails, reachable = true) {
324
+ return {
325
+ tails: reachable ? tails : [],
326
+ reachable
327
+ };
328
+ }
329
+ function mergePaths(...items) {
330
+ const tails = [];
331
+ const seen = /* @__PURE__ */ new Set();
332
+ for (const item of items) for (const tail of item.tails) {
333
+ const key = JSON.stringify(tail);
334
+ if (seen.has(key)) continue;
335
+ seen.add(key);
336
+ tails.push(tail);
337
+ }
338
+ return path(tails, items.some((item) => item.reachable));
339
+ }
340
+ function expression(node, parents, awaited = false) {
341
+ if (ts.isParenthesizedExpression(node)) return expression(node.expression, parents, awaited);
342
+ if (ts.isAwaitExpression(node)) return expression(node.expression, parents, true);
343
+ if (durableCall(node)) {
344
+ let tails = awaited ? durableNode(node, parents) : unknown("Unawaited durable calls are not supported yet", parents);
345
+ if (node.arguments.some((argument) => contains(argument, durableCall))) tails = unknown("Nested durable calls are not supported yet", tails);
346
+ return {
347
+ tails,
348
+ thrown: path(tails)
349
+ };
350
+ }
351
+ if (awaited && ts.isCallExpression(node) && ts.isPropertyAccessExpression(node.expression) && ts.isIdentifier(node.expression.expression) && node.expression.expression.text === "Promise" && node.expression.name.text === "all" && node.arguments.length === 1) {
352
+ const argument = node.arguments[0];
353
+ if (ts.isArrayLiteralExpression(argument)) {
354
+ const elements = argument.elements;
355
+ if (elements.some((element) => contains(element, ts.isAwaitExpression, true))) {
356
+ const tails = unknown("Await expressions inside Promise.all are not supported yet", parents);
357
+ return {
358
+ tails,
359
+ thrown: path(tails)
360
+ };
361
+ }
362
+ if (elements.length === 0) return {
363
+ tails: parents,
364
+ thrown: path([], false)
365
+ };
366
+ const flows = elements.map((element) => {
367
+ while (ts.isParenthesizedExpression(element)) element = element.expression;
368
+ if (ts.isCallExpression(element)) return expression(element, parents, true);
369
+ const tails = unknown("Dynamic Promise.all entries are not followed", parents);
370
+ return {
371
+ tails,
372
+ thrown: path(tails)
373
+ };
374
+ });
375
+ return {
376
+ tails: flows.flatMap((flow) => flow.tails),
377
+ thrown: mergePaths(...flows.map((flow) => flow.thrown))
378
+ };
379
+ }
380
+ const mapped = mappedStep(argument);
381
+ if (mapped !== void 0) {
382
+ const metadata = stepMetadata(mapped.call);
383
+ const tails = metadata?.group ? addNode({
384
+ kind: "parallel",
385
+ groupId: metadata.group.id,
386
+ cardinality: "dynamic",
387
+ operation: {
388
+ kind: "step",
389
+ stepIdTemplate: mapped.template,
390
+ description: metadata.description
391
+ },
392
+ label: metadata.group.label
393
+ }, parents) : unknown("Dynamic parallel steps need static group metadata", parents);
394
+ return {
395
+ tails,
396
+ thrown: path(tails)
397
+ };
398
+ }
399
+ }
400
+ if (contains(node, (child) => ts.isCallExpression(child) || ts.isAwaitExpression(child) || ts.isNewExpression(child))) {
401
+ const tails = unknown("Helper calls and dynamic expressions are not followed", parents);
402
+ return {
403
+ tails,
404
+ thrown: path(tails)
405
+ };
406
+ }
407
+ if (ts.isIdentifier(node) && node.text === context) return {
408
+ tails: unknown("Workflow context aliases are not followed", parents),
409
+ thrown: path([], false)
410
+ };
411
+ return {
412
+ tails: parents,
413
+ thrown: path([], false)
414
+ };
415
+ }
416
+ function branchInfo(statement, depth) {
417
+ let result;
418
+ const visit = (node) => {
419
+ if (result) return;
420
+ if (durableCall(node)) {
421
+ result = operationBranches(node)?.[depth];
422
+ return;
423
+ }
424
+ ts.forEachChild(node, visit);
425
+ };
426
+ visit(statement.thenStatement);
427
+ if (statement.elseStatement) visit(statement.elseStatement);
428
+ return result;
429
+ }
430
+ function statementFlow(normal, thrown = path([], false), returned = path([], false)) {
431
+ return {
432
+ normal,
433
+ thrown,
434
+ returned
435
+ };
436
+ }
437
+ function statements(items, parents, branchDepth) {
438
+ let normal = path(parents);
439
+ let thrown = path([], false);
440
+ let returned = path([], false);
441
+ for (const statement of items) {
442
+ if (!normal.reachable) break;
443
+ const flow = walkStatement(statement, normal.tails, branchDepth);
444
+ normal = flow.normal;
445
+ thrown = mergePaths(thrown, flow.thrown);
446
+ returned = mergePaths(returned, flow.returned);
447
+ }
448
+ return statementFlow(normal, thrown, returned);
449
+ }
450
+ function walkStatement(statement, parents, branchDepth) {
451
+ if (ts.isBlock(statement)) return statements(statement.statements, parents, branchDepth);
452
+ if (ts.isReturnStatement(statement)) {
453
+ const result = statement.expression ? expression(statement.expression, parents, true) : {
454
+ tails: parents,
455
+ thrown: path([], false)
456
+ };
457
+ return statementFlow(path([], false), result.thrown, path(result.tails));
458
+ }
459
+ if (ts.isThrowStatement(statement)) {
460
+ const result = expression(statement.expression, parents);
461
+ return statementFlow(path([], false), mergePaths(result.thrown, path(result.tails)));
462
+ }
463
+ if (ts.isVariableStatement(statement)) {
464
+ if (statement.declarationList.declarations.some((item) => contains(item.name, (child) => ts.isIdentifier(child) && (child.text === "Promise" || child.text === context)))) return statementFlow(path(unknown("Shadowed context or Promise bindings are not supported yet", parents)));
465
+ let tails = parents;
466
+ let thrown = path([], false);
467
+ for (const item of statement.declarationList.declarations) {
468
+ if (!item.initializer) continue;
469
+ const result = expression(item.initializer, tails);
470
+ tails = result.tails;
471
+ thrown = mergePaths(thrown, result.thrown);
472
+ }
473
+ return statementFlow(path(tails), thrown);
474
+ }
475
+ if (ts.isExpressionStatement(statement)) {
476
+ const result = expression(statement.expression, parents);
477
+ return statementFlow(path(result.tails), result.thrown);
478
+ }
479
+ if (ts.isIfStatement(statement)) {
480
+ const conditionFlow = expression(statement.expression, parents);
481
+ const metadata = branchInfo(statement, branchDepth);
482
+ const condition = statement.expression.getText(source);
483
+ const branchTails = metadata ? addNode({
484
+ kind: "branch",
485
+ branchId: metadata.id,
486
+ condition,
487
+ description: metadata.description,
488
+ label: metadata.description
489
+ }, conditionFlow.tails) : conditionFlow.tails;
490
+ const sourceId = metadata ? branchTails[0]?.source : void 0;
491
+ const thenParents = sourceId ? [{
492
+ source: sourceId,
493
+ kind: "branch",
494
+ outcome: true
495
+ }] : branchTails;
496
+ const elseParents = sourceId ? [{
497
+ source: sourceId,
498
+ kind: "branch",
499
+ outcome: false
500
+ }] : branchTails;
501
+ const thenFlow = walkStatement(statement.thenStatement, thenParents, branchDepth + 1);
502
+ const elseFlow = statement.elseStatement ? walkStatement(statement.elseStatement, elseParents, branchDepth + 1) : statementFlow(path(elseParents));
503
+ return statementFlow(mergePaths(thenFlow.normal, elseFlow.normal), mergePaths(conditionFlow.thrown, thenFlow.thrown, elseFlow.thrown), mergePaths(thenFlow.returned, elseFlow.returned));
504
+ }
505
+ if (ts.isTryStatement(statement)) {
506
+ const tryFlow = walkStatement(statement.tryBlock, parents, branchDepth);
507
+ const catchBlock = statement.catchClause?.block;
508
+ const catchHasDurableOperations = catchBlock ? contains(catchBlock, durableCall) : false;
509
+ const catchHasAbruptCompletion = catchBlock ? contains(catchBlock, (node) => ts.isReturnStatement(node) || ts.isThrowStatement(node), true) : false;
510
+ let catchFlow = statementFlow(path([], false));
511
+ if (catchBlock && (tryFlow.thrown.reachable || catchHasDurableOperations || catchHasAbruptCompletion)) if (catchHasDurableOperations || catchHasAbruptCompletion) catchFlow = walkStatement(catchBlock, unknown(catchHasDurableOperations ? "Durable catch paths are conditional on errors" : "Catch completion paths are conditional on errors", tryFlow.thrown.reachable ? tryFlow.thrown.tails : parents), branchDepth);
512
+ else catchFlow = statementFlow(path(tryFlow.thrown.tails));
513
+ const normal = mergePaths(tryFlow.normal, catchFlow.normal);
514
+ const thrown = catchBlock ? catchFlow.thrown : tryFlow.thrown;
515
+ const returned = mergePaths(tryFlow.returned, catchFlow.returned);
516
+ const flow = statementFlow(normal, thrown, returned);
517
+ if (!statement.finallyBlock) return flow;
518
+ const finallyHasDurableOperations = contains(statement.finallyBlock, durableCall);
519
+ const finallyHasAbruptCompletion = contains(statement.finallyBlock, (node) => ts.isReturnStatement(node) || ts.isThrowStatement(node), true);
520
+ if (!finallyHasDurableOperations && !finallyHasAbruptCompletion) return flow;
521
+ const finallyParents = mergePaths(normal, thrown, returned);
522
+ const finallyFlow = walkStatement(statement.finallyBlock, finallyParents.tails, branchDepth);
523
+ const completedFinally = finallyFlow.normal.reachable;
524
+ return statementFlow(path(finallyFlow.normal.tails, normal.reachable && completedFinally), mergePaths(finallyFlow.thrown, path(finallyFlow.normal.tails, thrown.reachable && completedFinally)), mergePaths(finallyFlow.returned, path(finallyFlow.normal.tails, returned.reachable && completedFinally)));
525
+ }
526
+ if (ts.isEmptyStatement(statement)) return statementFlow(path(parents));
527
+ return statementFlow(path(unknown("Loops and other control flow are not supported yet", parents)));
528
+ }
529
+ const tails = [];
530
+ if (!ts.isBlock(fn.body)) {
531
+ expression(fn.body, tails, true);
532
+ return graph;
533
+ }
534
+ statements(fn.body.statements, tails, 0);
535
+ return graph;
536
+ }
537
+ //#endregion
538
+ export { extractWorkflowGraph, loadTypeScript, workflowHandlerSource as t };