@mastra/redis-streams 0.0.2-alpha.0 → 0.0.2

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 +130 -0
  2. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,135 @@
1
1
  # @mastra/redis-streams
2
2
 
3
+ ## 0.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Worker review fixes: ([#16309](https://github.com/mastra-ai/mastra/pull/16309))
8
+ - Step-execution endpoint (`POST /workflows/:id/runs/:runId/steps/execute`) is
9
+ now gated by Mastra's standard `requiresAuth: true` + `authenticateToken`
10
+ pipeline rather than a parallel "worker secret" body field. The previously
11
+ introduced `workerSecret` config knob and `MASTRA_WORKER_SECRET` env var
12
+ have been removed (they were never released). To gate the endpoint on a
13
+ standalone-worker deployment, configure an auth provider on the server's
14
+ `Mastra` instance — without one the framework currently treats
15
+ `requiresAuth: true` as a no-op for this route.
16
+ - `HttpRemoteStrategy` now sends credentials as a normal `Authorization:
17
+ Bearer <token>` header. The token comes from the new
18
+ `MASTRA_WORKER_AUTH_TOKEN` env var or an explicit `auth` constructor option.
19
+ - Honor the caller's `abortSignal` in `HttpRemoteStrategy` by combining it
20
+ with the per-request timeout via `AbortSignal.any` (with a manual fallback
21
+ for runtimes that don't expose it).
22
+ - Implement comma-separated name filtering for the `MASTRA_WORKERS` env var.
23
+ `MASTRA_WORKERS=scheduler,backgroundTasks` now boots only those named
24
+ workers; `MASTRA_WORKERS=false` still disables all workers.
25
+ - Restore `Mastra.startEventEngine` / `stopEventEngine` as `@deprecated`
26
+ aliases for the renamed `startWorkers` / `stopWorkers`.
27
+ - `BackgroundTaskWorker` now subscribes to PubSub in `start()` instead of
28
+ `init()`, matching the lifecycle of the other workers and making
29
+ `isRunning` accurately reflect subscription state.
30
+ - `RedisStreamsPubSub` adds a `maxDeliveryAttempts` option (default 5) that
31
+ drops events after the configured number of failed deliveries instead of
32
+ redelivering forever, and replaces empty `catch {}` blocks with
33
+ `logger.warn`/`logger.debug` calls.
34
+ - `RedisStreamsPubSub.unsubscribe(topic, cb)` now honors the topic argument
35
+ so the same callback can be subscribed to multiple topics independently.
36
+ - `PullTransport` guards the async router callback against unhandled promise
37
+ rejections by attaching a `.catch` that nacks the message.
38
+ - Drop the dead `MASTRA_WORKER_NAME` env var injection in the CLI worker
39
+ spawn (the bundle entrypoint already passes the worker name directly).
40
+ - Add a real cross-process e2e auth suite
41
+ (`pubsub/redis-streams/src/auth-e2e.test.ts`) covering happy path, wrong
42
+ token, missing token, anonymous direct hits, and the no-auth-provider
43
+ pin-down behavior.
44
+ - Step-execution route now has a response schema, satisfying
45
+ `schema-consistency.test.ts`.
46
+ - Internal type cleanups (drop several `as any` casts in worker strategies
47
+ and `BackgroundTaskWorker`).
48
+ - `RedisStreamsPubSub.maxDeliveryAttempts` now rejects negative / NaN values
49
+ at construction. `0` still means "no cap" for back-compat but emits a
50
+ one-time warning; pass `Infinity` to disable the cap explicitly.
51
+ - `PullTransport` accepts a logger and uses it for unhandled router-callback
52
+ rejections instead of `console.error`.
53
+ - `BackgroundTaskWorker.start()` now throws if `init()` was not called,
54
+ matching the contract of the other workers.
55
+ - Cross-process integration tests now spawn a single user-owned project
56
+ (`test-fixtures/cli-project/src/mastra/index.ts`) through two generic
57
+ entries that mirror what `BuildBundler` and `WorkerBundler` emit. The
58
+ previous one-off `server.entry.ts` / `worker.entry.ts` /
59
+ `scheduler.entry.ts` / `background.entry.ts` files have been deleted —
60
+ they implied users hand-roll entry files, which they don't. Worker role
61
+ is selected via `MASTRA_WORKERS` exactly as in production.
62
+
63
+ Push-capable PubSub:
64
+ - The `PubSub` abstract class now declares a `supportedModes` getter
65
+ (defaulting to `['pull']` for backward compatibility) so consumers can
66
+ tell whether a broker delivers events through a pull loop, an in-process
67
+ push, or an out-of-process HTTP push. `EventEmitterPubSub` reports
68
+ `['pull', 'push']` (EventEmitter dispatches synchronously and works for
69
+ either path), `@mastra/redis-streams` reports `['pull']`.
70
+ - `Mastra` now exposes a public `handleWorkflowEvent(event)` method backed
71
+ by a shared `WorkflowEventProcessor`. It is the single entry point used
72
+ by the existing pull-mode `OrchestrationWorker`, by in-process push
73
+ pubsubs (auto-wired during `startWorkers()`), and by the new
74
+ `POST /api/workflows/events` route which lets push-mode brokers (GCP
75
+ Pub/Sub push, SNS, EventBridge) deliver events over HTTP.
76
+ - When the configured pubsub does not support `'pull'`, Mastra
77
+ automatically skips creating an `OrchestrationWorker` and
78
+ `OrchestrationWorker.init()` throws a clear error if it is constructed
79
+ against a push-only pubsub.
80
+ - `WorkflowEventProcessor` gains a `handle(event)` method that returns a
81
+ structured `{ ok, retry }` result. The original `process(event, ack?)`
82
+ method is preserved as a thin wrapper for back-compat.
83
+
84
+ Public-API example for a push-capable PubSub:
85
+
86
+ ```ts
87
+ import { Mastra } from '@mastra/core/mastra';
88
+ import { EventEmitterPubSub } from '@mastra/core/pubsub';
89
+
90
+ const mastra = new Mastra({
91
+ // A push-capable broker (GCP Pub/Sub push, SNS, EventEmitter, …).
92
+ // EventEmitterPubSub reports supportedModes = ['pull', 'push'].
93
+ pubsub: new EventEmitterPubSub(),
94
+ workflows: { myWorkflow },
95
+ });
96
+
97
+ // In-process push pubsubs are auto-wired here. For out-of-process
98
+ // push (e.g. HTTP webhook from a cloud broker), POST the event to
99
+ // /api/workflows/events on your Mastra server instead.
100
+ await mastra.startWorkers();
101
+
102
+ // Direct invocation (e.g. inside an HTTP handler that bridges from a
103
+ // cloud broker's push delivery):
104
+ await mastra.handleWorkflowEvent({
105
+ id: 'evt-1',
106
+ type: 'workflow.start',
107
+ runId: 'run-1',
108
+ createdAt: new Date(),
109
+ data: { workflowId: 'myWorkflow', inputData: { name: 'world' } },
110
+ });
111
+ ```
112
+
113
+ CI follow-ups:
114
+ - `Mastra` only auto-registers `SchedulerWorker` when storage is configured.
115
+ Without storage the worker would crash on startup (`deps.storage.getStore`
116
+ on undefined); the scheduler now silently no-ops in that case, matching the
117
+ pre-worker scheduler behavior.
118
+ - `SchedulerWorker.init` defensively logs and returns when called without
119
+ storage instead of throwing a TypeError.
120
+ - `RECEIVE_WORKFLOW_EVENT_ROUTE` (`POST /workflows/events`) `createdAt` is
121
+ now a plain `z.string()` on the wire and the handler converts it to a
122
+ `Date` (validating "Invalid Date" -> 400). The previous
123
+ `union(...).transform().refine()` schema couldn't be exercised by the
124
+ shared adapter test suite because the generator didn't unwrap Zod 4's
125
+ `ZodPipe`.
126
+ - `_test-utils/route-test-utils` recognizes Zod 4's `number_format` check
127
+ (used for `int()` / `safeint()`), and `generateContextualValue` now
128
+ produces a valid ISO timestamp for `createdAt` / `updatedAt` fields.
129
+
130
+ - 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)]:
131
+ - @mastra/core@1.33.0
132
+
3
133
  ## 0.0.2-alpha.0
4
134
 
5
135
  ### 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.2",
4
4
  "description": "Mastra Redis Streams PubSub integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -34,11 +34,11 @@
34
34
  "tsx": "^4.21.0",
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.93",
38
+ "@internal/types-builder": "0.0.68",
39
+ "@mastra/deployer": "1.33.0",
40
+ "@mastra/core": "1.33.0",
41
+ "@mastra/libsql": "1.10.1"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@mastra/core": ">=1.0.0-0 <2.0.0-0"