@mastra/redis-streams 0.0.2-alpha.0 → 0.0.3-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.
Files changed (2) hide show
  1. package/CHANGELOG.md +139 -0
  2. package/package.json +9 -9
package/CHANGELOG.md CHANGED
@@ -1,5 +1,144 @@
1
1
  # @mastra/redis-streams
2
2
 
3
+ ## 0.0.3-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - dependencies updates: ([#17148](https://github.com/mastra-ai/mastra/pull/17148))
8
+ - Updated dependency [`redis@5.12.1` ↗︎](https://www.npmjs.com/package/redis/v/5.12.1) (from `5.10.0`, in `dependencies`)
9
+ - Updated dependencies [[`575f815`](https://github.com/mastra-ai/mastra/commit/575f815c5c3567b71c0b83cbb7fa98c8253a9d9c), [`306909a`](https://github.com/mastra-ai/mastra/commit/306909a693de77d709b38706e2673c9547d24a28), [`5191af8`](https://github.com/mastra-ai/mastra/commit/5191af80c799eea25357c545fc05d91b3883531d), [`43bd3d4`](https://github.com/mastra-ai/mastra/commit/43bd3d421987463fdf35386a45199c49499ed069), [`e6fa79e`](https://github.com/mastra-ai/mastra/commit/e6fa79ec72a2ddffdd25e85270398951e9d552a4), [`904bcdf`](https://github.com/mastra-ai/mastra/commit/904bcdf7b8004aa7be823f9f70ca63580e47e470), [`7f5ee1d`](https://github.com/mastra-ai/mastra/commit/7f5ee1dca46daee8d2817f2ebe49e6335da81956), [`1e9aab5`](https://github.com/mastra-ai/mastra/commit/1e9aab50ff11e6e88fde4d7cbf512c44a9fe8d61), [`bf8eb6d`](https://github.com/mastra-ai/mastra/commit/bf8eb6d0ec213a403eb9265a594ad283c44ab3dc), [`493a328`](https://github.com/mastra-ai/mastra/commit/493a328f4346a1deeb9f1e2e44c8f2a3a4d7591b), [`029a414`](https://github.com/mastra-ai/mastra/commit/029a4141719793bd3e898a39eb5a0466a55f5f3a), [`b147b29`](https://github.com/mastra-ai/mastra/commit/b147b2907f0cd1aa812efe6d6e3f58d22e66fc88), [`d371ac1`](https://github.com/mastra-ai/mastra/commit/d371ac1d9820afaaf7cfdbc380a475946a994d8f), [`cf182b7`](https://github.com/mastra-ai/mastra/commit/cf182b7fb495767946d9840ef29f19cfa906f31f), [`a049c2a`](https://github.com/mastra-ai/mastra/commit/a049c2a9dfb41d0ee2e7a28874a88cd64fd5669f), [`b147b29`](https://github.com/mastra-ai/mastra/commit/b147b2907f0cd1aa812efe6d6e3f58d22e66fc88), [`2a96528`](https://github.com/mastra-ai/mastra/commit/2a9652848dfa3c5a2426f952e9d93554c26fd90f), [`2656d9c`](https://github.com/mastra-ai/mastra/commit/2656d9c2976d4f3354253bfbbbf9b88a1b2bbf34), [`63e3fe1`](https://github.com/mastra-ai/mastra/commit/63e3fe13cc1ea96f91d7c68aea92f400faf9e4da), [`1d4ce8d`](https://github.com/mastra-ai/mastra/commit/1d4ce8daaa54511f325c1b609d31b8e54009d677), [`8c68372`](https://github.com/mastra-ai/mastra/commit/8c68372e85fe0b066ec12c58bd29ffb93e54c552)]:
10
+ - @mastra/core@1.42.0-alpha.4
11
+
12
+ ## 0.0.2
13
+
14
+ ### Patch Changes
15
+
16
+ - Worker review fixes: ([#16309](https://github.com/mastra-ai/mastra/pull/16309))
17
+ - Step-execution endpoint (`POST /workflows/:id/runs/:runId/steps/execute`) is
18
+ now gated by Mastra's standard `requiresAuth: true` + `authenticateToken`
19
+ pipeline rather than a parallel "worker secret" body field. The previously
20
+ introduced `workerSecret` config knob and `MASTRA_WORKER_SECRET` env var
21
+ have been removed (they were never released). To gate the endpoint on a
22
+ standalone-worker deployment, configure an auth provider on the server's
23
+ `Mastra` instance — without one the framework currently treats
24
+ `requiresAuth: true` as a no-op for this route.
25
+ - `HttpRemoteStrategy` now sends credentials as a normal `Authorization:
26
+ Bearer <token>` header. The token comes from the new
27
+ `MASTRA_WORKER_AUTH_TOKEN` env var or an explicit `auth` constructor option.
28
+ - Honor the caller's `abortSignal` in `HttpRemoteStrategy` by combining it
29
+ with the per-request timeout via `AbortSignal.any` (with a manual fallback
30
+ for runtimes that don't expose it).
31
+ - Implement comma-separated name filtering for the `MASTRA_WORKERS` env var.
32
+ `MASTRA_WORKERS=scheduler,backgroundTasks` now boots only those named
33
+ workers; `MASTRA_WORKERS=false` still disables all workers.
34
+ - Restore `Mastra.startEventEngine` / `stopEventEngine` as `@deprecated`
35
+ aliases for the renamed `startWorkers` / `stopWorkers`.
36
+ - `BackgroundTaskWorker` now subscribes to PubSub in `start()` instead of
37
+ `init()`, matching the lifecycle of the other workers and making
38
+ `isRunning` accurately reflect subscription state.
39
+ - `RedisStreamsPubSub` adds a `maxDeliveryAttempts` option (default 5) that
40
+ drops events after the configured number of failed deliveries instead of
41
+ redelivering forever, and replaces empty `catch {}` blocks with
42
+ `logger.warn`/`logger.debug` calls.
43
+ - `RedisStreamsPubSub.unsubscribe(topic, cb)` now honors the topic argument
44
+ so the same callback can be subscribed to multiple topics independently.
45
+ - `PullTransport` guards the async router callback against unhandled promise
46
+ rejections by attaching a `.catch` that nacks the message.
47
+ - Drop the dead `MASTRA_WORKER_NAME` env var injection in the CLI worker
48
+ spawn (the bundle entrypoint already passes the worker name directly).
49
+ - Add a real cross-process e2e auth suite
50
+ (`pubsub/redis-streams/src/auth-e2e.test.ts`) covering happy path, wrong
51
+ token, missing token, anonymous direct hits, and the no-auth-provider
52
+ pin-down behavior.
53
+ - Step-execution route now has a response schema, satisfying
54
+ `schema-consistency.test.ts`.
55
+ - Internal type cleanups (drop several `as any` casts in worker strategies
56
+ and `BackgroundTaskWorker`).
57
+ - `RedisStreamsPubSub.maxDeliveryAttempts` now rejects negative / NaN values
58
+ at construction. `0` still means "no cap" for back-compat but emits a
59
+ one-time warning; pass `Infinity` to disable the cap explicitly.
60
+ - `PullTransport` accepts a logger and uses it for unhandled router-callback
61
+ rejections instead of `console.error`.
62
+ - `BackgroundTaskWorker.start()` now throws if `init()` was not called,
63
+ matching the contract of the other workers.
64
+ - Cross-process integration tests now spawn a single user-owned project
65
+ (`test-fixtures/cli-project/src/mastra/index.ts`) through two generic
66
+ entries that mirror what `BuildBundler` and `WorkerBundler` emit. The
67
+ previous one-off `server.entry.ts` / `worker.entry.ts` /
68
+ `scheduler.entry.ts` / `background.entry.ts` files have been deleted —
69
+ they implied users hand-roll entry files, which they don't. Worker role
70
+ is selected via `MASTRA_WORKERS` exactly as in production.
71
+
72
+ Push-capable PubSub:
73
+ - The `PubSub` abstract class now declares a `supportedModes` getter
74
+ (defaulting to `['pull']` for backward compatibility) so consumers can
75
+ tell whether a broker delivers events through a pull loop, an in-process
76
+ push, or an out-of-process HTTP push. `EventEmitterPubSub` reports
77
+ `['pull', 'push']` (EventEmitter dispatches synchronously and works for
78
+ either path), `@mastra/redis-streams` reports `['pull']`.
79
+ - `Mastra` now exposes a public `handleWorkflowEvent(event)` method backed
80
+ by a shared `WorkflowEventProcessor`. It is the single entry point used
81
+ by the existing pull-mode `OrchestrationWorker`, by in-process push
82
+ pubsubs (auto-wired during `startWorkers()`), and by the new
83
+ `POST /api/workflows/events` route which lets push-mode brokers (GCP
84
+ Pub/Sub push, SNS, EventBridge) deliver events over HTTP.
85
+ - When the configured pubsub does not support `'pull'`, Mastra
86
+ automatically skips creating an `OrchestrationWorker` and
87
+ `OrchestrationWorker.init()` throws a clear error if it is constructed
88
+ against a push-only pubsub.
89
+ - `WorkflowEventProcessor` gains a `handle(event)` method that returns a
90
+ structured `{ ok, retry }` result. The original `process(event, ack?)`
91
+ method is preserved as a thin wrapper for back-compat.
92
+
93
+ Public-API example for a push-capable PubSub:
94
+
95
+ ```ts
96
+ import { Mastra } from '@mastra/core/mastra';
97
+ import { EventEmitterPubSub } from '@mastra/core/pubsub';
98
+
99
+ const mastra = new Mastra({
100
+ // A push-capable broker (GCP Pub/Sub push, SNS, EventEmitter, …).
101
+ // EventEmitterPubSub reports supportedModes = ['pull', 'push'].
102
+ pubsub: new EventEmitterPubSub(),
103
+ workflows: { myWorkflow },
104
+ });
105
+
106
+ // In-process push pubsubs are auto-wired here. For out-of-process
107
+ // push (e.g. HTTP webhook from a cloud broker), POST the event to
108
+ // /api/workflows/events on your Mastra server instead.
109
+ await mastra.startWorkers();
110
+
111
+ // Direct invocation (e.g. inside an HTTP handler that bridges from a
112
+ // cloud broker's push delivery):
113
+ await mastra.handleWorkflowEvent({
114
+ id: 'evt-1',
115
+ type: 'workflow.start',
116
+ runId: 'run-1',
117
+ createdAt: new Date(),
118
+ data: { workflowId: 'myWorkflow', inputData: { name: 'world' } },
119
+ });
120
+ ```
121
+
122
+ CI follow-ups:
123
+ - `Mastra` only auto-registers `SchedulerWorker` when storage is configured.
124
+ Without storage the worker would crash on startup (`deps.storage.getStore`
125
+ on undefined); the scheduler now silently no-ops in that case, matching the
126
+ pre-worker scheduler behavior.
127
+ - `SchedulerWorker.init` defensively logs and returns when called without
128
+ storage instead of throwing a TypeError.
129
+ - `RECEIVE_WORKFLOW_EVENT_ROUTE` (`POST /workflows/events`) `createdAt` is
130
+ now a plain `z.string()` on the wire and the handler converts it to a
131
+ `Date` (validating "Invalid Date" -> 400). The previous
132
+ `union(...).transform().refine()` schema couldn't be exercised by the
133
+ shared adapter test suite because the generator didn't unwrap Zod 4's
134
+ `ZodPipe`.
135
+ - `_test-utils/route-test-utils` recognizes Zod 4's `number_format` check
136
+ (used for `int()` / `safeint()`), and `generateContextualValue` now
137
+ produces a valid ISO timestamp for `createdAt` / `updatedAt` fields.
138
+
139
+ - Updated dependencies [[`9f17410`](https://github.com/mastra-ai/mastra/commit/9f1741080def23d42ee50b39887a385ae316a3c6), [`7ad5585`](https://github.com/mastra-ai/mastra/commit/7ad55856406f1de398dc713f6a9eaa78b2784bb6), [`ac47842`](https://github.com/mastra-ai/mastra/commit/ac478427aa7a5f5fdaed633a911218689b438c60), [`cc189cc`](https://github.com/mastra-ai/mastra/commit/cc189cc0128eb7af233476b5e421ec6888bffde7), [`d1fdbd0`](https://github.com/mastra-ai/mastra/commit/d1fdbd012add5623cb7e6b7f882b605ab358bbb4), [`210ea7a`](https://github.com/mastra-ai/mastra/commit/210ea7af559791b73a44fc9c12179908aaa3183f), [`7c275a8`](https://github.com/mastra-ai/mastra/commit/7c275a810595e1a6c41ccc39720531ab65734700), [`bae019e`](https://github.com/mastra-ai/mastra/commit/bae019ecb6694da96909f7ec7b9eb3a0a33aa887), [`890b24c`](https://github.com/mastra-ai/mastra/commit/890b24cc7d32ed6aa4dfe253e54dc6bf4099f690), [`f984b4d`](https://github.com/mastra-ai/mastra/commit/f984b4d6c60bf2ae2a9b156f0e8c35a66fe96c91), [`6742347`](https://github.com/mastra-ai/mastra/commit/6742347d71955d7639adc9ddf6ff8282de7ee3ba), [`b59316f`](https://github.com/mastra-ai/mastra/commit/b59316ffa0f7688165b0f9c81ccdf85da461e5b2), [`0f48ebf`](https://github.com/mastra-ai/mastra/commit/0f48ebfc7ac7897b2092a189f45751924cf56d1c), [`37c0dc5`](https://github.com/mastra-ai/mastra/commit/37c0dc5697d343db98628bf867bf71ce6deec6d7), [`087e413`](https://github.com/mastra-ai/mastra/commit/087e4133e5d6efa36619e9556c16750e4179c047), [`83218c8`](https://github.com/mastra-ai/mastra/commit/83218c88b37773c9424fbe733b37be556e55e94d), [`ef6b584`](https://github.com/mastra-ai/mastra/commit/ef6b5847ac33c0a7e80af3a86e8801e2933dd3ee), [`c6eb39e`](https://github.com/mastra-ai/mastra/commit/c6eb39ea6dca381c6563cb240237fbe608e02f93), [`7b0ad1f`](https://github.com/mastra-ai/mastra/commit/7b0ad1f5c53dc118c6da12ae82ae2587037dc2b8), [`d91ebe2`](https://github.com/mastra-ai/mastra/commit/d91ebe28ee065d8f2ed6df741c3c07f58d359529), [`62666c3`](https://github.com/mastra-ai/mastra/commit/62666c367eaeac3941ead454b1d38810cc855721), [`33f5061`](https://github.com/mastra-ai/mastra/commit/33f5061cd1c0335020c3faae61ce96de822854fa), [`4af2160`](https://github.com/mastra-ai/mastra/commit/4af2160322f4718cac421930cce85641e9512389), [`087e413`](https://github.com/mastra-ai/mastra/commit/087e4133e5d6efa36619e9556c16750e4179c047), [`265ec9f`](https://github.com/mastra-ai/mastra/commit/265ec9f887b5c81255c873a76ff7796f16e4f99b), [`ce01024`](https://github.com/mastra-ai/mastra/commit/ce010242eee9bdfc09e4c26725b9d37998679a8d), [`6ce80bf`](https://github.com/mastra-ai/mastra/commit/6ce80bf4872a891e0bddf8b80561a80584efb14b), [`f984b4d`](https://github.com/mastra-ai/mastra/commit/f984b4d6c60bf2ae2a9b156f0e8c35a66fe96c91), [`136c959`](https://github.com/mastra-ai/mastra/commit/136c9592fb0eeb0cd212f28629d8a29b7557a2fc), [`9268531`](https://github.com/mastra-ai/mastra/commit/9268531e7ec4be98beeba3b3ae8be0a7ea380662), [`13ead79`](https://github.com/mastra-ai/mastra/commit/13ead79149486b88144db7e11e6ff551caef5be1), [`dccd8f1`](https://github.com/mastra-ai/mastra/commit/dccd8f1f8b8f1ad203b77556207e5529567c616d), [`4df7cc7`](https://github.com/mastra-ai/mastra/commit/4df7cc79342fd065fe7fdeef93c094db14b12bcd), [`f180e49`](https://github.com/mastra-ai/mastra/commit/f180e4990e71b04c9a475b523584071712f0048f), [`9260e01`](https://github.com/mastra-ai/mastra/commit/9260e015276fb1b500f7878ee452b47476bf1583), [`2f6c54e`](https://github.com/mastra-ai/mastra/commit/2f6c54e17c041cac1def54baaa6b771647836414), [`aca3121`](https://github.com/mastra-ai/mastra/commit/aca31211233dac25459f140ea4fcfb3a5af64c18), [`e06a159`](https://github.com/mastra-ai/mastra/commit/e06a1598ca07a6c3778aefc2a2d288363c6294ff), [`4dd900d`](https://github.com/mastra-ai/mastra/commit/4dd900d75dfe9be89f8c15188b368a8622aa1e18), [`b560d6f`](https://github.com/mastra-ai/mastra/commit/b560d6f88b9b904b15c10f75c949eb145bc27684), [`99869ec`](https://github.com/mastra-ai/mastra/commit/99869ecb1f2aa6dfcc44fa4e843e5ee0344efa64), [`900d086`](https://github.com/mastra-ai/mastra/commit/900d086bb737b9cf2fcf68f11b0389b801a2738c), [`4c0e286`](https://github.com/mastra-ai/mastra/commit/4c0e28637c9cfb4f416549b55e97ebfa13319dfc), [`55f1e2d`](https://github.com/mastra-ai/mastra/commit/55f1e2d65425b95a49ae788053b266f256e38c96), [`4ff5bdf`](https://github.com/mastra-ai/mastra/commit/4ff5bdfe170cba6dfb5260c6af0f4ba668430772), [`9cdf38e`](https://github.com/mastra-ai/mastra/commit/9cdf38e58506e1109c8b38f97cd7770978a4218e), [`087e413`](https://github.com/mastra-ai/mastra/commit/087e4133e5d6efa36619e9556c16750e4179c047), [`db34bc6`](https://github.com/mastra-ai/mastra/commit/db34bc6fb36cf125bda0c46be4d3fdc774b70cc4), [`990851e`](https://github.com/mastra-ai/mastra/commit/990851edcb0e30be5c2c18b6532f1a876cc2d335), [`bbcd93c`](https://github.com/mastra-ai/mastra/commit/bbcd93cf7d8aa1007d6d84bfd033b8015c912087), [`8373ff4`](https://github.com/mastra-ai/mastra/commit/8373ff46745d77af79f183c4470f80fa2727a6b2), [`d48a705`](https://github.com/mastra-ai/mastra/commit/d48a705ff3dfbdc7a996e07ecd8293b5effd9a2a), [`308bd07`](https://github.com/mastra-ai/mastra/commit/308bd074f35cef0c75d82fc1eb19382fe04ecf6f), [`6068a6c`](https://github.com/mastra-ai/mastra/commit/6068a6c42950fad3ebfc92346417896ba60803d2), [`36b3bbf`](https://github.com/mastra-ai/mastra/commit/36b3bbf5a8d59f7e23d47e29340e76c681b4929c), [`d86f031`](https://github.com/mastra-ai/mastra/commit/d86f031eb6b0b2570145afafea664e59bf688962), [`b275631`](https://github.com/mastra-ai/mastra/commit/b275631dc10541a482b2e2d4a3e3cfa843bd5fa1), [`00106be`](https://github.com/mastra-ai/mastra/commit/00106bede59b81e5b0e9cd6aad8d3b5dbc336387), [`bd36d8e`](https://github.com/mastra-ai/mastra/commit/bd36d8eb6de8c9a0310352649dbd4b06703c2299), [`11c1528`](https://github.com/mastra-ai/mastra/commit/11c152848c5d0ef227184853b5040f5b41ee7b1e), [`4999667`](https://github.com/mastra-ai/mastra/commit/49996678b68356cad7f088430009690406c50fbd), [`e2a079c`](https://github.com/mastra-ai/mastra/commit/e2a079cc3755b1895f7bd5dc36e9be81b11c7c22), [`8ac9141`](https://github.com/mastra-ai/mastra/commit/8ac9141439caa8fdd674944c4d84f29b3c730296), [`25184ff`](https://github.com/mastra-ai/mastra/commit/25184ffaf1293ec95119426eb1a1f8d38831b96c), [`534a456`](https://github.com/mastra-ai/mastra/commit/534a456a25e4df1e5407e7e632f4cb3b1fa14f9d), [`105e454`](https://github.com/mastra-ai/mastra/commit/105e454c95af06a7c741c15969d8f9b0f02463a7), [`aebde9c`](https://github.com/mastra-ai/mastra/commit/aebde9cfacf56592c6b6350cae721740fe090b8a), [`36bae07`](https://github.com/mastra-ai/mastra/commit/36bae07c0e70b1b3006f2fd20830e8883dcbd066), [`5688881`](https://github.com/mastra-ai/mastra/commit/5688881669c7ed157f31ac77f6fc5f8d95ceea32)]:
140
+ - @mastra/core@1.33.0
141
+
3
142
  ## 0.0.2-alpha.0
4
143
 
5
144
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/redis-streams",
3
- "version": "0.0.2-alpha.0",
3
+ "version": "0.0.3-alpha.0",
4
4
  "description": "Mastra Redis Streams PubSub integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,22 +23,22 @@
23
23
  "./package.json": "./package.json"
24
24
  },
25
25
  "dependencies": {
26
- "redis": "5.10.0"
26
+ "redis": "5.12.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/node": "22.19.15",
30
30
  "@vitest/coverage-v8": "4.1.5",
31
31
  "@vitest/ui": "4.1.5",
32
- "eslint": "^10.2.1",
32
+ "eslint": "^10.4.1",
33
33
  "tsup": "^8.5.1",
34
- "tsx": "^4.21.0",
34
+ "tsx": "^4.22.4",
35
35
  "typescript": "^6.0.3",
36
36
  "vitest": "4.1.5",
37
- "@internal/lint": "0.0.92",
38
- "@mastra/core": "1.33.0-alpha.9",
39
- "@internal/types-builder": "0.0.67",
40
- "@mastra/libsql": "1.10.1-alpha.2",
41
- "@mastra/deployer": "1.33.0-alpha.9"
37
+ "@internal/lint": "0.0.103",
38
+ "@mastra/deployer": "1.42.0-alpha.4",
39
+ "@internal/types-builder": "0.0.78",
40
+ "@mastra/core": "1.42.0-alpha.4",
41
+ "@mastra/libsql": "1.13.0-alpha.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@mastra/core": ">=1.0.0-0 <2.0.0-0"