@mastra/inngest 0.0.0-mcp-changeset-20250707162621 → 0.0.0-message-list-update-20250715150321

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/CHANGELOG.md CHANGED
@@ -1,20 +1,70 @@
1
1
  # @mastra/inngest
2
2
 
3
- ## 0.0.0-mcp-changeset-20250707162621
3
+ ## 0.0.0-message-list-update-20250715150321
4
+
5
+ ### Patch Changes
6
+
7
+ - 0b56518: Ensure removed runtimeContext values are not saved in snapshot
8
+ - Updated dependencies [0b56518]
9
+ - Updated dependencies [db5cc15]
10
+ - Updated dependencies [2ba5b76]
11
+ - Updated dependencies [5237998]
12
+ - Updated dependencies [37c1acd]
13
+ - Updated dependencies [1aa60b1]
14
+ - Updated dependencies [89ec9d4]
15
+ - Updated dependencies [cf3a184]
16
+ - Updated dependencies [3759392]
17
+ - Updated dependencies [626b0f4]
18
+ - Updated dependencies [c22a91f]
19
+ - Updated dependencies [f7403ab]
20
+ - Updated dependencies [6c89d7f]
21
+ - @mastra/core@0.0.0-message-list-update-20250715150321
22
+
23
+ ## 0.11.3
4
24
 
5
25
  ### Patch Changes
6
26
 
7
27
  - 515488a: dependencies updates:
8
28
  - Updated dependency [`inngest@^3.39.2` ↗︎](https://www.npmjs.com/package/inngest/v/3.39.2) (from `^3.39.1`, in `dependencies`)
29
+ - defb5ae: dependencies updates:
30
+ - Updated dependency [`inngest@^3.40.0` ↗︎](https://www.npmjs.com/package/inngest/v/3.40.0) (from `^3.39.2`, in `dependencies`)
9
31
  - b790fd1: Ability to pass a function to .sleep()/.sleepUntil()
32
+ - c1cceea: Bump peerdeps of @matra/core
33
+ - Updated dependencies [2873c7f]
34
+ - Updated dependencies [1c1c6a1]
10
35
  - Updated dependencies [f8ce2cc]
11
36
  - Updated dependencies [8c846b6]
37
+ - Updated dependencies [c7bbf1e]
38
+ - Updated dependencies [8722d53]
12
39
  - Updated dependencies [565cc0c]
13
40
  - Updated dependencies [b790fd1]
41
+ - Updated dependencies [132027f]
42
+ - Updated dependencies [0c85311]
14
43
  - Updated dependencies [d7ed04d]
44
+ - Updated dependencies [cb16baf]
15
45
  - Updated dependencies [f36e4f1]
16
46
  - Updated dependencies [7f6e403]
17
- - @mastra/core@0.0.0-mcp-changeset-20250707162621
47
+ - @mastra/core@0.10.11
48
+
49
+ ## 0.11.3-alpha.3
50
+
51
+ ### Patch Changes
52
+
53
+ - c1cceea: Bump peerdeps of @matra/core
54
+ - @mastra/core@0.10.11-alpha.4
55
+
56
+ ## 0.11.3-alpha.2
57
+
58
+ ### Patch Changes
59
+
60
+ - defb5ae: dependencies updates:
61
+ - Updated dependency [`inngest@^3.40.0` ↗︎](https://www.npmjs.com/package/inngest/v/3.40.0) (from `^3.39.2`, in `dependencies`)
62
+ - Updated dependencies [c7bbf1e]
63
+ - Updated dependencies [8722d53]
64
+ - Updated dependencies [132027f]
65
+ - Updated dependencies [0c85311]
66
+ - Updated dependencies [cb16baf]
67
+ - @mastra/core@0.10.11-alpha.3
18
68
 
19
69
  ## 0.11.3-alpha.1
20
70
 
package/LICENSE.md CHANGED
@@ -1,46 +1,15 @@
1
- # Elastic License 2.0 (ELv2)
1
+ # Apache License 2.0
2
2
 
3
- Copyright (c) 2025 Mastra AI, Inc.
3
+ Copyright (c) 2025 Kepler Software, Inc.
4
4
 
5
- **Acceptance**
6
- By using the software, you agree to all of the terms and conditions below.
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at
7
8
 
8
- **Copyright License**
9
- The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below
9
+ http://www.apache.org/licenses/LICENSE-2.0
10
10
 
11
- **Limitations**
12
- You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
13
-
14
- You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
15
-
16
- You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
17
-
18
- **Patents**
19
- The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
20
-
21
- **Notices**
22
- You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
23
-
24
- If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
25
-
26
- **No Other Rights**
27
- These terms do not imply any licenses other than those expressly granted in these terms.
28
-
29
- **Termination**
30
- If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
31
-
32
- **No Liability**
33
- As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
34
-
35
- **Definitions**
36
- The _licensor_ is the entity offering these terms, and the _software_ is the software the licensor makes available under these terms, including any portion of it.
37
-
38
- _you_ refers to the individual or entity agreeing to these terms.
39
-
40
- _your company_ is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. _control_ means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
41
-
42
- _your licenses_ are all the licenses granted to you for the software under these terms.
43
-
44
- _use_ means anything you do with the software requiring one of your licenses.
45
-
46
- _trademark_ means trademarks, service marks, and similar rights.
11
+ Unless required by applicable law or agreed to in writing, software
12
+ distributed under the License is distributed on an "AS IS" BASIS,
13
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ See the License for the specific language governing permissions and
15
+ limitations under the License.
@@ -184,6 +184,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
184
184
  workflowStatus: 'success' | 'failed' | 'suspended' | 'running';
185
185
  result?: Record<string, any>;
186
186
  error?: string | Error;
187
+ runtimeContext: RuntimeContext;
187
188
  }): Promise<void>;
188
189
  executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, serializedStepGraph, resume, executionContext, emitter, abortController, runtimeContext, }: {
189
190
  workflowId: string;
@@ -184,6 +184,7 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
184
184
  workflowStatus: 'success' | 'failed' | 'suspended' | 'running';
185
185
  result?: Record<string, any>;
186
186
  error?: string | Error;
187
+ runtimeContext: RuntimeContext;
187
188
  }): Promise<void>;
188
189
  executeConditional({ workflowId, runId, entry, prevOutput, prevStep, stepResults, serializedStepGraph, resume, executionContext, emitter, abortController, runtimeContext, }: {
189
190
  workflowId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/inngest",
3
- "version": "0.0.0-mcp-changeset-20250707162621",
3
+ "version": "0.0.0-message-list-update-20250715150321",
4
4
  "description": "Mastra Inngest integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@inngest/realtime": "^0.3.1",
23
23
  "@opentelemetry/api": "^1.9.0",
24
- "inngest": "^3.39.2",
24
+ "inngest": "^3.40.0",
25
25
  "zod": "^3.25.67"
26
26
  },
27
27
  "devDependencies": {
@@ -31,20 +31,20 @@
31
31
  "@microsoft/api-extractor": "^7.52.8",
32
32
  "@types/node": "^20.19.0",
33
33
  "ai": "^4.3.16",
34
- "eslint": "^9.29.0",
34
+ "eslint": "^9.30.1",
35
35
  "execa": "^9.6.0",
36
36
  "get-port": "7.1.0",
37
- "hono": "^4.8.3",
37
+ "hono": "^4.8.4",
38
38
  "tsup": "^8.5.0",
39
39
  "typescript": "^5.8.3",
40
40
  "vitest": "^3.2.4",
41
- "@internal/lint": "0.0.0-mcp-changeset-20250707162621",
42
- "@mastra/core": "0.0.0-mcp-changeset-20250707162621",
43
- "@mastra/libsql": "0.0.0-mcp-changeset-20250707162621",
44
- "@mastra/deployer": "0.0.0-mcp-changeset-20250707162621"
41
+ "@internal/lint": "0.0.0-message-list-update-20250715150321",
42
+ "@mastra/core": "0.0.0-message-list-update-20250715150321",
43
+ "@mastra/libsql": "0.0.0-message-list-update-20250715150321",
44
+ "@mastra/deployer": "0.0.0-message-list-update-20250715150321"
45
45
  },
46
46
  "peerDependencies": {
47
- "@mastra/core": "0.0.0-mcp-changeset-20250707162621"
47
+ "@mastra/core": "0.0.0-message-list-update-20250715150321"
48
48
  },
49
49
  "scripts": {
50
50
  "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
package/src/index.test.ts CHANGED
@@ -6219,6 +6219,176 @@ describe('MastraInngestWorkflow', () => {
6219
6219
  // @ts-ignore
6220
6220
  expect(result?.steps.step1.output.injectedValue).toBe(testValue + '2');
6221
6221
  });
6222
+
6223
+ it('should have access to runtimeContext from before suspension during workflow resume', async ctx => {
6224
+ const inngest = new Inngest({
6225
+ id: 'mastra',
6226
+ baseUrl: `http://localhost:${(ctx as any).inngestPort}`,
6227
+ });
6228
+
6229
+ const { createWorkflow, createStep } = init(inngest);
6230
+
6231
+ const testValue = 'test-dependency';
6232
+ const resumeStep = createStep({
6233
+ id: 'resume',
6234
+ inputSchema: z.object({ value: z.number() }),
6235
+ outputSchema: z.object({ value: z.number() }),
6236
+ resumeSchema: z.object({ value: z.number() }),
6237
+ suspendSchema: z.object({ message: z.string() }),
6238
+ execute: async ({ inputData, resumeData, suspend }) => {
6239
+ const finalValue = (resumeData?.value ?? 0) + inputData.value;
6240
+
6241
+ if (!resumeData?.value || finalValue < 10) {
6242
+ return await suspend({
6243
+ message: `Please provide additional information. now value is ${inputData.value}`,
6244
+ });
6245
+ }
6246
+
6247
+ return { value: finalValue };
6248
+ },
6249
+ });
6250
+
6251
+ const incrementStep = createStep({
6252
+ id: 'increment',
6253
+ inputSchema: z.object({
6254
+ value: z.number(),
6255
+ }),
6256
+ outputSchema: z.object({
6257
+ value: z.number(),
6258
+ }),
6259
+ execute: async ({ inputData, runtimeContext }) => {
6260
+ runtimeContext.set('testKey', testValue);
6261
+ return {
6262
+ value: inputData.value + 1,
6263
+ };
6264
+ },
6265
+ });
6266
+
6267
+ const incrementWorkflow = createWorkflow({
6268
+ id: 'increment-workflow',
6269
+ inputSchema: z.object({ value: z.number() }),
6270
+ outputSchema: z.object({ value: z.number() }),
6271
+ })
6272
+ .then(incrementStep)
6273
+ .then(resumeStep)
6274
+ .then(
6275
+ createStep({
6276
+ id: 'final',
6277
+ inputSchema: z.object({ value: z.number() }),
6278
+ outputSchema: z.object({ value: z.number() }),
6279
+ execute: async ({ inputData, runtimeContext }) => {
6280
+ const testKey = runtimeContext.get('testKey');
6281
+ expect(testKey).toBe(testValue);
6282
+ return { value: inputData.value };
6283
+ },
6284
+ }),
6285
+ )
6286
+ .commit();
6287
+
6288
+ new Mastra({
6289
+ logger: false,
6290
+ storage: testStorage,
6291
+ workflows: { incrementWorkflow },
6292
+ });
6293
+
6294
+ const run = await incrementWorkflow.createRunAsync();
6295
+ const result = await run.start({ inputData: { value: 0 } });
6296
+ expect(result.status).toBe('suspended');
6297
+
6298
+ const resumeResult = await run.resume({
6299
+ resumeData: { value: 21 },
6300
+ step: ['resume'],
6301
+ });
6302
+
6303
+ expect(resumeResult.status).toBe('success');
6304
+ });
6305
+
6306
+ it('should not show removed runtimeContext values in subsequent steps', async ctx => {
6307
+ const inngest = new Inngest({
6308
+ id: 'mastra',
6309
+ baseUrl: `http://localhost:${(ctx as any).inngestPort}`,
6310
+ });
6311
+
6312
+ const { createWorkflow, createStep } = init(inngest);
6313
+ const testValue = 'test-dependency';
6314
+ const resumeStep = createStep({
6315
+ id: 'resume',
6316
+ inputSchema: z.object({ value: z.number() }),
6317
+ outputSchema: z.object({ value: z.number() }),
6318
+ resumeSchema: z.object({ value: z.number() }),
6319
+ suspendSchema: z.object({ message: z.string() }),
6320
+ execute: async ({ inputData, resumeData, suspend, runtimeContext }) => {
6321
+ const finalValue = (resumeData?.value ?? 0) + inputData.value;
6322
+
6323
+ if (!resumeData?.value || finalValue < 10) {
6324
+ return await suspend({
6325
+ message: `Please provide additional information. now value is ${inputData.value}`,
6326
+ });
6327
+ }
6328
+
6329
+ const testKey = runtimeContext.get('testKey');
6330
+ expect(testKey).toBe(testValue);
6331
+
6332
+ runtimeContext.delete('testKey');
6333
+
6334
+ return { value: finalValue };
6335
+ },
6336
+ });
6337
+
6338
+ const incrementStep = createStep({
6339
+ id: 'increment',
6340
+ inputSchema: z.object({
6341
+ value: z.number(),
6342
+ }),
6343
+ outputSchema: z.object({
6344
+ value: z.number(),
6345
+ }),
6346
+ execute: async ({ inputData, runtimeContext }) => {
6347
+ runtimeContext.set('testKey', testValue);
6348
+ return {
6349
+ value: inputData.value + 1,
6350
+ };
6351
+ },
6352
+ });
6353
+
6354
+ const incrementWorkflow = createWorkflow({
6355
+ id: 'increment-workflow',
6356
+ inputSchema: z.object({ value: z.number() }),
6357
+ outputSchema: z.object({ value: z.number() }),
6358
+ })
6359
+ .then(incrementStep)
6360
+ .then(resumeStep)
6361
+ .then(
6362
+ createStep({
6363
+ id: 'final',
6364
+ inputSchema: z.object({ value: z.number() }),
6365
+ outputSchema: z.object({ value: z.number() }),
6366
+ execute: async ({ inputData, runtimeContext }) => {
6367
+ const testKey = runtimeContext.get('testKey');
6368
+ expect(testKey).toBeUndefined();
6369
+ return { value: inputData.value };
6370
+ },
6371
+ }),
6372
+ )
6373
+ .commit();
6374
+
6375
+ new Mastra({
6376
+ logger: false,
6377
+ storage: testStorage,
6378
+ workflows: { incrementWorkflow },
6379
+ });
6380
+
6381
+ const run = await incrementWorkflow.createRunAsync();
6382
+ const result = await run.start({ inputData: { value: 0 } });
6383
+ expect(result.status).toBe('suspended');
6384
+
6385
+ const resumeResult = await run.resume({
6386
+ resumeData: { value: 21 },
6387
+ step: ['resume'],
6388
+ });
6389
+
6390
+ expect(resumeResult.status).toBe('success');
6391
+ });
6222
6392
  });
6223
6393
 
6224
6394
  describe('Access to inngest step primitives', () => {
package/src/index.ts CHANGED
@@ -1575,6 +1575,7 @@ export class InngestExecutionEngine extends DefaultExecutionEngine {
1575
1575
  workflowStatus: 'success' | 'failed' | 'suspended' | 'running';
1576
1576
  result?: Record<string, any>;
1577
1577
  error?: string | Error;
1578
+ runtimeContext: RuntimeContext;
1578
1579
  }) {
1579
1580
  await this.inngestStep.run(
1580
1581
  `workflow.${workflowId}.run.${runId}.path.${JSON.stringify(executionContext.executionPath)}.stepUpdate`,