@mastra/inngest 0.10.3 → 0.10.5-alpha.0
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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +21 -0
- package/dist/_tsup-dts-rollup.d.cts +48 -14
- package/dist/_tsup-dts-rollup.d.ts +48 -14
- package/dist/index.cjs +144 -26
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +144 -27
- package/package.json +13 -12
- package/src/index.test.ts +228 -137
- package/src/index.ts +275 -40
package/src/index.test.ts
CHANGED
|
@@ -7,8 +7,8 @@ import { realtimeMiddleware } from '@inngest/realtime';
|
|
|
7
7
|
import { createTool, Mastra, Telemetry } from '@mastra/core';
|
|
8
8
|
import { Agent } from '@mastra/core/agent';
|
|
9
9
|
import { RuntimeContext } from '@mastra/core/runtime-context';
|
|
10
|
-
import { DefaultStorage } from '@mastra/core/storage/libsql';
|
|
11
10
|
import { createHonoServer } from '@mastra/deployer/server';
|
|
11
|
+
import { DefaultStorage } from '@mastra/libsql';
|
|
12
12
|
import { $ } from 'execa';
|
|
13
13
|
import getPort from 'get-port';
|
|
14
14
|
import { Inngest } from 'inngest';
|
|
@@ -67,9 +67,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
67
67
|
|
|
68
68
|
const mastra = new Mastra({
|
|
69
69
|
storage: new DefaultStorage({
|
|
70
|
-
|
|
71
|
-
url: ':memory:',
|
|
72
|
-
},
|
|
70
|
+
url: ':memory:',
|
|
73
71
|
}),
|
|
74
72
|
workflows: {
|
|
75
73
|
'test-workflow': workflow,
|
|
@@ -144,9 +142,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
144
142
|
|
|
145
143
|
const mastra = new Mastra({
|
|
146
144
|
storage: new DefaultStorage({
|
|
147
|
-
|
|
148
|
-
url: ':memory:',
|
|
149
|
-
},
|
|
145
|
+
url: ':memory:',
|
|
150
146
|
}),
|
|
151
147
|
workflows: {
|
|
152
148
|
'test-workflow': workflow,
|
|
@@ -227,9 +223,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
227
223
|
|
|
228
224
|
const mastra = new Mastra({
|
|
229
225
|
storage: new DefaultStorage({
|
|
230
|
-
|
|
231
|
-
url: ':memory:',
|
|
232
|
-
},
|
|
226
|
+
url: ':memory:',
|
|
233
227
|
}),
|
|
234
228
|
workflows: {
|
|
235
229
|
'test-workflow': workflow,
|
|
@@ -265,6 +259,186 @@ describe('MastraInngestWorkflow', () => {
|
|
|
265
259
|
|
|
266
260
|
srv.close();
|
|
267
261
|
});
|
|
262
|
+
|
|
263
|
+
it('should execute a a sleep step', async ctx => {
|
|
264
|
+
const inngest = new Inngest({
|
|
265
|
+
id: 'mastra',
|
|
266
|
+
baseUrl: `http://localhost:${(ctx as any).inngestPort}`,
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
const { createWorkflow, createStep } = init(inngest);
|
|
270
|
+
|
|
271
|
+
const execute = vi.fn<any>().mockResolvedValue({ result: 'success' });
|
|
272
|
+
const step1 = createStep({
|
|
273
|
+
id: 'step1',
|
|
274
|
+
execute,
|
|
275
|
+
inputSchema: z.object({}),
|
|
276
|
+
outputSchema: z.object({ result: z.string() }),
|
|
277
|
+
});
|
|
278
|
+
const step2 = createStep({
|
|
279
|
+
id: 'step2',
|
|
280
|
+
execute: async ({ inputData }) => {
|
|
281
|
+
return { result: 'slept successfully: ' + inputData.result };
|
|
282
|
+
},
|
|
283
|
+
inputSchema: z.object({ result: z.string() }),
|
|
284
|
+
outputSchema: z.object({ result: z.string() }),
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
const workflow = createWorkflow({
|
|
288
|
+
id: 'test-workflow',
|
|
289
|
+
inputSchema: z.object({}),
|
|
290
|
+
outputSchema: z.object({
|
|
291
|
+
result: z.string(),
|
|
292
|
+
}),
|
|
293
|
+
steps: [step1],
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
workflow.then(step1).sleep(1000).then(step2).commit();
|
|
297
|
+
|
|
298
|
+
const mastra = new Mastra({
|
|
299
|
+
storage: new DefaultStorage({
|
|
300
|
+
url: ':memory:',
|
|
301
|
+
}),
|
|
302
|
+
workflows: {
|
|
303
|
+
'test-workflow': workflow,
|
|
304
|
+
},
|
|
305
|
+
server: {
|
|
306
|
+
apiRoutes: [
|
|
307
|
+
{
|
|
308
|
+
path: '/inngest/api',
|
|
309
|
+
method: 'ALL',
|
|
310
|
+
createHandler: async ({ mastra }) => inngestServe({ mastra, inngest }),
|
|
311
|
+
},
|
|
312
|
+
],
|
|
313
|
+
},
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
const app = await createHonoServer(mastra);
|
|
317
|
+
|
|
318
|
+
const srv = serve({
|
|
319
|
+
fetch: app.fetch,
|
|
320
|
+
port: (ctx as any).handlerPort,
|
|
321
|
+
});
|
|
322
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
323
|
+
|
|
324
|
+
const run = workflow.createRun();
|
|
325
|
+
const startTime = Date.now();
|
|
326
|
+
const result = await run.start({ inputData: {} });
|
|
327
|
+
const endTime = Date.now();
|
|
328
|
+
|
|
329
|
+
expect(execute).toHaveBeenCalled();
|
|
330
|
+
expect(result.steps['step1']).toEqual({
|
|
331
|
+
status: 'success',
|
|
332
|
+
output: { result: 'success' },
|
|
333
|
+
// payload: {},
|
|
334
|
+
// startedAt: expect.any(Number),
|
|
335
|
+
// endedAt: expect.any(Number),
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
expect(result.steps['step2']).toEqual({
|
|
339
|
+
status: 'success',
|
|
340
|
+
output: { result: 'slept successfully: success' },
|
|
341
|
+
// payload: { result: 'success' },
|
|
342
|
+
// startedAt: expect.any(Number),
|
|
343
|
+
// endedAt: expect.any(Number),
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
expect(endTime - startTime).toBeGreaterThan(1000);
|
|
347
|
+
|
|
348
|
+
srv.close();
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
it('should execute a a sleep until step', async ctx => {
|
|
352
|
+
const inngest = new Inngest({
|
|
353
|
+
id: 'mastra',
|
|
354
|
+
baseUrl: `http://localhost:${(ctx as any).inngestPort}`,
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
const { createWorkflow, createStep } = init(inngest);
|
|
358
|
+
|
|
359
|
+
const execute = vi.fn<any>().mockResolvedValue({ result: 'success' });
|
|
360
|
+
const step1 = createStep({
|
|
361
|
+
id: 'step1',
|
|
362
|
+
execute,
|
|
363
|
+
inputSchema: z.object({}),
|
|
364
|
+
outputSchema: z.object({ result: z.string() }),
|
|
365
|
+
});
|
|
366
|
+
const step2 = createStep({
|
|
367
|
+
id: 'step2',
|
|
368
|
+
execute: async ({ inputData }) => {
|
|
369
|
+
return { result: 'slept successfully: ' + inputData.result };
|
|
370
|
+
},
|
|
371
|
+
inputSchema: z.object({ result: z.string() }),
|
|
372
|
+
outputSchema: z.object({ result: z.string() }),
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
const workflow = createWorkflow({
|
|
376
|
+
id: 'test-workflow',
|
|
377
|
+
inputSchema: z.object({}),
|
|
378
|
+
outputSchema: z.object({
|
|
379
|
+
result: z.string(),
|
|
380
|
+
}),
|
|
381
|
+
steps: [step1],
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
workflow
|
|
385
|
+
.then(step1)
|
|
386
|
+
.sleepUntil(new Date(Date.now() + 1000))
|
|
387
|
+
.then(step2)
|
|
388
|
+
.commit();
|
|
389
|
+
|
|
390
|
+
const mastra = new Mastra({
|
|
391
|
+
storage: new DefaultStorage({
|
|
392
|
+
url: ':memory:',
|
|
393
|
+
}),
|
|
394
|
+
workflows: {
|
|
395
|
+
'test-workflow': workflow,
|
|
396
|
+
},
|
|
397
|
+
server: {
|
|
398
|
+
apiRoutes: [
|
|
399
|
+
{
|
|
400
|
+
path: '/inngest/api',
|
|
401
|
+
method: 'ALL',
|
|
402
|
+
createHandler: async ({ mastra }) => inngestServe({ mastra, inngest }),
|
|
403
|
+
},
|
|
404
|
+
],
|
|
405
|
+
},
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
const app = await createHonoServer(mastra);
|
|
409
|
+
|
|
410
|
+
const srv = serve({
|
|
411
|
+
fetch: app.fetch,
|
|
412
|
+
port: (ctx as any).handlerPort,
|
|
413
|
+
});
|
|
414
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
415
|
+
|
|
416
|
+
const run = workflow.createRun();
|
|
417
|
+
const startTime = Date.now();
|
|
418
|
+
const result = await run.start({ inputData: {} });
|
|
419
|
+
const endTime = Date.now();
|
|
420
|
+
|
|
421
|
+
expect(execute).toHaveBeenCalled();
|
|
422
|
+
expect(result.steps['step1']).toEqual({
|
|
423
|
+
status: 'success',
|
|
424
|
+
output: { result: 'success' },
|
|
425
|
+
// payload: {},
|
|
426
|
+
// startedAt: expect.any(Number),
|
|
427
|
+
// endedAt: expect.any(Number),
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
expect(result.steps['step2']).toEqual({
|
|
431
|
+
status: 'success',
|
|
432
|
+
output: { result: 'slept successfully: success' },
|
|
433
|
+
// payload: { result: 'success' },
|
|
434
|
+
// startedAt: expect.any(Number),
|
|
435
|
+
// endedAt: expect.any(Number),
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
expect(endTime - startTime).toBeGreaterThan(1000);
|
|
439
|
+
|
|
440
|
+
srv.close();
|
|
441
|
+
});
|
|
268
442
|
});
|
|
269
443
|
|
|
270
444
|
describe('Variable Resolution', () => {
|
|
@@ -301,9 +475,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
301
475
|
|
|
302
476
|
const mastra = new Mastra({
|
|
303
477
|
storage: new DefaultStorage({
|
|
304
|
-
|
|
305
|
-
url: ':memory:',
|
|
306
|
-
},
|
|
478
|
+
url: ':memory:',
|
|
307
479
|
}),
|
|
308
480
|
workflows: {
|
|
309
481
|
'test-workflow': workflow,
|
|
@@ -390,9 +562,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
390
562
|
|
|
391
563
|
const mastra = new Mastra({
|
|
392
564
|
storage: new DefaultStorage({
|
|
393
|
-
|
|
394
|
-
url: ':memory:',
|
|
395
|
-
},
|
|
565
|
+
url: ':memory:',
|
|
396
566
|
}),
|
|
397
567
|
workflows: {
|
|
398
568
|
'test-workflow': workflow,
|
|
@@ -459,9 +629,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
459
629
|
|
|
460
630
|
const mastra = new Mastra({
|
|
461
631
|
storage: new DefaultStorage({
|
|
462
|
-
|
|
463
|
-
url: ':memory:',
|
|
464
|
-
},
|
|
632
|
+
url: ':memory:',
|
|
465
633
|
}),
|
|
466
634
|
workflows: {
|
|
467
635
|
'test-workflow': workflow,
|
|
@@ -536,9 +704,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
536
704
|
|
|
537
705
|
const mastra = new Mastra({
|
|
538
706
|
storage: new DefaultStorage({
|
|
539
|
-
|
|
540
|
-
url: ':memory:',
|
|
541
|
-
},
|
|
707
|
+
url: ':memory:',
|
|
542
708
|
}),
|
|
543
709
|
workflows: {
|
|
544
710
|
'test-workflow': workflow,
|
|
@@ -620,9 +786,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
620
786
|
|
|
621
787
|
const mastra = new Mastra({
|
|
622
788
|
storage: new DefaultStorage({
|
|
623
|
-
|
|
624
|
-
url: ':memory:',
|
|
625
|
-
},
|
|
789
|
+
url: ':memory:',
|
|
626
790
|
}),
|
|
627
791
|
workflows: {
|
|
628
792
|
'test-workflow': workflow,
|
|
@@ -725,9 +889,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
725
889
|
|
|
726
890
|
const mastra = new Mastra({
|
|
727
891
|
storage: new DefaultStorage({
|
|
728
|
-
|
|
729
|
-
url: ':memory:',
|
|
730
|
-
},
|
|
892
|
+
url: ':memory:',
|
|
731
893
|
}),
|
|
732
894
|
workflows: {
|
|
733
895
|
'test-workflow': workflow,
|
|
@@ -803,9 +965,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
803
965
|
|
|
804
966
|
const mastra = new Mastra({
|
|
805
967
|
storage: new DefaultStorage({
|
|
806
|
-
|
|
807
|
-
url: ':memory:',
|
|
808
|
-
},
|
|
968
|
+
url: ':memory:',
|
|
809
969
|
}),
|
|
810
970
|
workflows: {
|
|
811
971
|
'test-workflow': workflow,
|
|
@@ -910,9 +1070,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
910
1070
|
|
|
911
1071
|
const mastra = new Mastra({
|
|
912
1072
|
storage: new DefaultStorage({
|
|
913
|
-
|
|
914
|
-
url: ':memory:',
|
|
915
|
-
},
|
|
1073
|
+
url: ':memory:',
|
|
916
1074
|
}),
|
|
917
1075
|
workflows: {
|
|
918
1076
|
'test-workflow': workflow,
|
|
@@ -995,9 +1153,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
995
1153
|
|
|
996
1154
|
const mastra = new Mastra({
|
|
997
1155
|
storage: new DefaultStorage({
|
|
998
|
-
|
|
999
|
-
url: ':memory:',
|
|
1000
|
-
},
|
|
1156
|
+
url: ':memory:',
|
|
1001
1157
|
}),
|
|
1002
1158
|
workflows: {
|
|
1003
1159
|
'test-workflow': workflow,
|
|
@@ -1065,9 +1221,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
1065
1221
|
|
|
1066
1222
|
const mastra = new Mastra({
|
|
1067
1223
|
storage: new DefaultStorage({
|
|
1068
|
-
|
|
1069
|
-
url: ':memory:',
|
|
1070
|
-
},
|
|
1224
|
+
url: ':memory:',
|
|
1071
1225
|
}),
|
|
1072
1226
|
workflows: {
|
|
1073
1227
|
'test-workflow': workflow,
|
|
@@ -1151,9 +1305,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
1151
1305
|
|
|
1152
1306
|
const mastra = new Mastra({
|
|
1153
1307
|
storage: new DefaultStorage({
|
|
1154
|
-
|
|
1155
|
-
url: ':memory:',
|
|
1156
|
-
},
|
|
1308
|
+
url: ':memory:',
|
|
1157
1309
|
}),
|
|
1158
1310
|
workflows: {
|
|
1159
1311
|
'test-workflow': workflow,
|
|
@@ -1247,9 +1399,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
1247
1399
|
|
|
1248
1400
|
const mastra = new Mastra({
|
|
1249
1401
|
storage: new DefaultStorage({
|
|
1250
|
-
|
|
1251
|
-
url: ':memory:',
|
|
1252
|
-
},
|
|
1402
|
+
url: ':memory:',
|
|
1253
1403
|
}),
|
|
1254
1404
|
workflows: {
|
|
1255
1405
|
'main-workflow': mainWorkflow,
|
|
@@ -1377,9 +1527,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
1377
1527
|
|
|
1378
1528
|
const mastra = new Mastra({
|
|
1379
1529
|
storage: new DefaultStorage({
|
|
1380
|
-
|
|
1381
|
-
url: ':memory:',
|
|
1382
|
-
},
|
|
1530
|
+
url: ':memory:',
|
|
1383
1531
|
}),
|
|
1384
1532
|
workflows: {
|
|
1385
1533
|
'test-workflow': workflow,
|
|
@@ -1481,9 +1629,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
1481
1629
|
|
|
1482
1630
|
const mastra = new Mastra({
|
|
1483
1631
|
storage: new DefaultStorage({
|
|
1484
|
-
|
|
1485
|
-
url: ':memory:',
|
|
1486
|
-
},
|
|
1632
|
+
url: ':memory:',
|
|
1487
1633
|
}),
|
|
1488
1634
|
workflows: {
|
|
1489
1635
|
'test-workflow': counterWorkflow,
|
|
@@ -1586,9 +1732,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
1586
1732
|
|
|
1587
1733
|
const mastra = new Mastra({
|
|
1588
1734
|
storage: new DefaultStorage({
|
|
1589
|
-
|
|
1590
|
-
url: ':memory:',
|
|
1591
|
-
},
|
|
1735
|
+
url: ':memory:',
|
|
1592
1736
|
}),
|
|
1593
1737
|
workflows: {
|
|
1594
1738
|
'test-workflow': counterWorkflow,
|
|
@@ -1677,9 +1821,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
1677
1821
|
|
|
1678
1822
|
const mastra = new Mastra({
|
|
1679
1823
|
storage: new DefaultStorage({
|
|
1680
|
-
|
|
1681
|
-
url: ':memory:',
|
|
1682
|
-
},
|
|
1824
|
+
url: ':memory:',
|
|
1683
1825
|
}),
|
|
1684
1826
|
workflows: {
|
|
1685
1827
|
'test-workflow': counterWorkflow,
|
|
@@ -1832,9 +1974,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
1832
1974
|
|
|
1833
1975
|
const mastra = new Mastra({
|
|
1834
1976
|
storage: new DefaultStorage({
|
|
1835
|
-
|
|
1836
|
-
url: ':memory:',
|
|
1837
|
-
},
|
|
1977
|
+
url: ':memory:',
|
|
1838
1978
|
}),
|
|
1839
1979
|
workflows: {
|
|
1840
1980
|
'test-workflow': counterWorkflow,
|
|
@@ -1983,9 +2123,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
1983
2123
|
|
|
1984
2124
|
const mastra = new Mastra({
|
|
1985
2125
|
storage: new DefaultStorage({
|
|
1986
|
-
|
|
1987
|
-
url: ':memory:',
|
|
1988
|
-
},
|
|
2126
|
+
url: ':memory:',
|
|
1989
2127
|
}),
|
|
1990
2128
|
workflows: {
|
|
1991
2129
|
'test-workflow': counterWorkflow,
|
|
@@ -2157,9 +2295,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
2157
2295
|
|
|
2158
2296
|
const mastra = new Mastra({
|
|
2159
2297
|
storage: new DefaultStorage({
|
|
2160
|
-
|
|
2161
|
-
url: ':memory:',
|
|
2162
|
-
},
|
|
2298
|
+
url: ':memory:',
|
|
2163
2299
|
}),
|
|
2164
2300
|
workflows: {
|
|
2165
2301
|
'test-workflow': workflow,
|
|
@@ -2225,9 +2361,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
2225
2361
|
|
|
2226
2362
|
const mastra = new Mastra({
|
|
2227
2363
|
storage: new DefaultStorage({
|
|
2228
|
-
|
|
2229
|
-
url: ':memory:',
|
|
2230
|
-
},
|
|
2364
|
+
url: ':memory:',
|
|
2231
2365
|
}),
|
|
2232
2366
|
workflows: {
|
|
2233
2367
|
'test-workflow': workflow,
|
|
@@ -2359,9 +2493,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
2359
2493
|
|
|
2360
2494
|
const mastra = new Mastra({
|
|
2361
2495
|
storage: new DefaultStorage({
|
|
2362
|
-
|
|
2363
|
-
url: ':memory:',
|
|
2364
|
-
},
|
|
2496
|
+
url: ':memory:',
|
|
2365
2497
|
}),
|
|
2366
2498
|
workflows: {
|
|
2367
2499
|
'test-workflow': workflow,
|
|
@@ -2432,9 +2564,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
2432
2564
|
|
|
2433
2565
|
const mastra = new Mastra({
|
|
2434
2566
|
storage: new DefaultStorage({
|
|
2435
|
-
|
|
2436
|
-
url: ':memory:',
|
|
2437
|
-
},
|
|
2567
|
+
url: ':memory:',
|
|
2438
2568
|
}),
|
|
2439
2569
|
workflows: {
|
|
2440
2570
|
'test-workflow': workflow,
|
|
@@ -2620,9 +2750,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
2620
2750
|
|
|
2621
2751
|
const mastra = new Mastra({
|
|
2622
2752
|
storage: new DefaultStorage({
|
|
2623
|
-
|
|
2624
|
-
url: ':memory:',
|
|
2625
|
-
},
|
|
2753
|
+
url: ':memory:',
|
|
2626
2754
|
}),
|
|
2627
2755
|
workflows: {
|
|
2628
2756
|
'test-workflow': workflow,
|
|
@@ -2792,9 +2920,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
2792
2920
|
|
|
2793
2921
|
// Create a new storage instance for initial run
|
|
2794
2922
|
const initialStorage = new DefaultStorage({
|
|
2795
|
-
|
|
2796
|
-
url: 'file::memory:',
|
|
2797
|
-
},
|
|
2923
|
+
url: 'file::memory:',
|
|
2798
2924
|
});
|
|
2799
2925
|
const mastra = new Mastra({
|
|
2800
2926
|
storage: initialStorage,
|
|
@@ -2946,9 +3072,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
2946
3072
|
|
|
2947
3073
|
const mastra = new Mastra({
|
|
2948
3074
|
storage: new DefaultStorage({
|
|
2949
|
-
|
|
2950
|
-
url: ':memory:',
|
|
2951
|
-
},
|
|
3075
|
+
url: ':memory:',
|
|
2952
3076
|
}),
|
|
2953
3077
|
workflows: {
|
|
2954
3078
|
'test-workflow': workflow,
|
|
@@ -3150,9 +3274,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
3150
3274
|
|
|
3151
3275
|
const mastra = new Mastra({
|
|
3152
3276
|
storage: new DefaultStorage({
|
|
3153
|
-
|
|
3154
|
-
url: ':memory:',
|
|
3155
|
-
},
|
|
3277
|
+
url: ':memory:',
|
|
3156
3278
|
}),
|
|
3157
3279
|
workflows: {
|
|
3158
3280
|
'test-workflow': workflow,
|
|
@@ -3346,9 +3468,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
3346
3468
|
|
|
3347
3469
|
const mastra = new Mastra({
|
|
3348
3470
|
storage: new DefaultStorage({
|
|
3349
|
-
|
|
3350
|
-
url: ':memory:',
|
|
3351
|
-
},
|
|
3471
|
+
url: ':memory:',
|
|
3352
3472
|
}),
|
|
3353
3473
|
workflows: {
|
|
3354
3474
|
'test-workflow': promptEvalWorkflow,
|
|
@@ -3472,9 +3592,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
3472
3592
|
|
|
3473
3593
|
const mastra = new Mastra({
|
|
3474
3594
|
storage: new DefaultStorage({
|
|
3475
|
-
|
|
3476
|
-
url: ':memory:',
|
|
3477
|
-
},
|
|
3595
|
+
url: ':memory:',
|
|
3478
3596
|
}),
|
|
3479
3597
|
workflows: {
|
|
3480
3598
|
'test-workflow': workflow,
|
|
@@ -3577,9 +3695,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
3577
3695
|
|
|
3578
3696
|
const mastra = new Mastra({
|
|
3579
3697
|
storage: new DefaultStorage({
|
|
3580
|
-
|
|
3581
|
-
url: ':memory:',
|
|
3582
|
-
},
|
|
3698
|
+
url: ':memory:',
|
|
3583
3699
|
}),
|
|
3584
3700
|
workflows: {
|
|
3585
3701
|
'test-workflow': workflow,
|
|
@@ -3715,9 +3831,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
3715
3831
|
|
|
3716
3832
|
const mastra = new Mastra({
|
|
3717
3833
|
storage: new DefaultStorage({
|
|
3718
|
-
|
|
3719
|
-
url: ':memory:',
|
|
3720
|
-
},
|
|
3834
|
+
url: ':memory:',
|
|
3721
3835
|
}),
|
|
3722
3836
|
workflows: {
|
|
3723
3837
|
'test-workflow': workflow,
|
|
@@ -3860,9 +3974,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
3860
3974
|
|
|
3861
3975
|
const mastra = new Mastra({
|
|
3862
3976
|
storage: new DefaultStorage({
|
|
3863
|
-
|
|
3864
|
-
url: ':memory:',
|
|
3865
|
-
},
|
|
3977
|
+
url: ':memory:',
|
|
3866
3978
|
}),
|
|
3867
3979
|
workflows: {
|
|
3868
3980
|
'test-workflow': counterWorkflow,
|
|
@@ -4014,9 +4126,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
4014
4126
|
|
|
4015
4127
|
const mastra = new Mastra({
|
|
4016
4128
|
storage: new DefaultStorage({
|
|
4017
|
-
|
|
4018
|
-
url: ':memory:',
|
|
4019
|
-
},
|
|
4129
|
+
url: ':memory:',
|
|
4020
4130
|
}),
|
|
4021
4131
|
workflows: {
|
|
4022
4132
|
'test-workflow': counterWorkflow,
|
|
@@ -4173,9 +4283,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
4173
4283
|
|
|
4174
4284
|
const mastra = new Mastra({
|
|
4175
4285
|
storage: new DefaultStorage({
|
|
4176
|
-
|
|
4177
|
-
url: ':memory:',
|
|
4178
|
-
},
|
|
4286
|
+
url: ':memory:',
|
|
4179
4287
|
}),
|
|
4180
4288
|
workflows: {
|
|
4181
4289
|
'test-workflow': counterWorkflow,
|
|
@@ -4334,9 +4442,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
4334
4442
|
|
|
4335
4443
|
const mastra = new Mastra({
|
|
4336
4444
|
storage: new DefaultStorage({
|
|
4337
|
-
|
|
4338
|
-
url: ':memory:',
|
|
4339
|
-
},
|
|
4445
|
+
url: ':memory:',
|
|
4340
4446
|
}),
|
|
4341
4447
|
workflows: {
|
|
4342
4448
|
'test-workflow': counterWorkflow,
|
|
@@ -4533,9 +4639,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
4533
4639
|
|
|
4534
4640
|
const mastra = new Mastra({
|
|
4535
4641
|
storage: new DefaultStorage({
|
|
4536
|
-
|
|
4537
|
-
url: ':memory:',
|
|
4538
|
-
},
|
|
4642
|
+
url: ':memory:',
|
|
4539
4643
|
}),
|
|
4540
4644
|
workflows: {
|
|
4541
4645
|
'test-workflow': counterWorkflow,
|
|
@@ -4691,9 +4795,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
4691
4795
|
|
|
4692
4796
|
const mastra = new Mastra({
|
|
4693
4797
|
storage: new DefaultStorage({
|
|
4694
|
-
|
|
4695
|
-
url: ':memory:',
|
|
4696
|
-
},
|
|
4798
|
+
url: ':memory:',
|
|
4697
4799
|
}),
|
|
4698
4800
|
workflows: {
|
|
4699
4801
|
'test-workflow': counterWorkflow,
|
|
@@ -4841,9 +4943,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
4841
4943
|
|
|
4842
4944
|
const mastra = new Mastra({
|
|
4843
4945
|
storage: new DefaultStorage({
|
|
4844
|
-
|
|
4845
|
-
url: ':memory:',
|
|
4846
|
-
},
|
|
4946
|
+
url: ':memory:',
|
|
4847
4947
|
}),
|
|
4848
4948
|
workflows: {
|
|
4849
4949
|
'test-workflow': counterWorkflow,
|
|
@@ -4861,7 +4961,6 @@ describe('MastraInngestWorkflow', () => {
|
|
|
4861
4961
|
|
|
4862
4962
|
const app = await createHonoServer(mastra);
|
|
4863
4963
|
app.use('*', async (ctx, next) => {
|
|
4864
|
-
'middleware', ctx.req.method, ctx.req.url;
|
|
4865
4964
|
await next();
|
|
4866
4965
|
});
|
|
4867
4966
|
|
|
@@ -5028,9 +5127,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
5028
5127
|
|
|
5029
5128
|
const mastra = new Mastra({
|
|
5030
5129
|
storage: new DefaultStorage({
|
|
5031
|
-
|
|
5032
|
-
url: ':memory:',
|
|
5033
|
-
},
|
|
5130
|
+
url: ':memory:',
|
|
5034
5131
|
}),
|
|
5035
5132
|
workflows: {
|
|
5036
5133
|
'test-workflow': counterWorkflow,
|
|
@@ -5187,9 +5284,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
5187
5284
|
|
|
5188
5285
|
const mastra = new Mastra({
|
|
5189
5286
|
storage: new DefaultStorage({
|
|
5190
|
-
|
|
5191
|
-
url: ':memory:',
|
|
5192
|
-
},
|
|
5287
|
+
url: ':memory:',
|
|
5193
5288
|
}),
|
|
5194
5289
|
workflows: {
|
|
5195
5290
|
'test-workflow': counterWorkflow,
|
|
@@ -5264,9 +5359,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
5264
5359
|
|
|
5265
5360
|
const mastra = new Mastra({
|
|
5266
5361
|
storage: new DefaultStorage({
|
|
5267
|
-
|
|
5268
|
-
url: ':memory:',
|
|
5269
|
-
},
|
|
5362
|
+
url: ':memory:',
|
|
5270
5363
|
}),
|
|
5271
5364
|
workflows: {
|
|
5272
5365
|
'test-workflow': workflow,
|
|
@@ -5329,9 +5422,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
5329
5422
|
|
|
5330
5423
|
const mastra = new Mastra({
|
|
5331
5424
|
storage: new DefaultStorage({
|
|
5332
|
-
|
|
5333
|
-
url: ':memory:',
|
|
5334
|
-
},
|
|
5425
|
+
url: ':memory:',
|
|
5335
5426
|
}),
|
|
5336
5427
|
workflows: {
|
|
5337
5428
|
'test-workflow': workflow,
|
|
@@ -5372,9 +5463,7 @@ describe('MastraInngestWorkflow', () => {
|
|
|
5372
5463
|
const { createWorkflow, createStep } = init(inngest);
|
|
5373
5464
|
|
|
5374
5465
|
const initialStorage = new DefaultStorage({
|
|
5375
|
-
|
|
5376
|
-
url: 'file::memory:',
|
|
5377
|
-
},
|
|
5466
|
+
url: 'file::memory:',
|
|
5378
5467
|
});
|
|
5379
5468
|
|
|
5380
5469
|
const runtimeContext = new RuntimeContext();
|
|
@@ -5427,4 +5516,6 @@ describe('MastraInngestWorkflow', () => {
|
|
|
5427
5516
|
expect(result?.steps.step1.output.injectedValue).toBe(testValue + '2');
|
|
5428
5517
|
});
|
|
5429
5518
|
});
|
|
5519
|
+
|
|
5520
|
+
describe('Access to inngest step primitives', () => {});
|
|
5430
5521
|
}, 40e3);
|