@hasna/events 0.1.14 → 0.1.15

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/LICENSE CHANGED
@@ -1,17 +1,202 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
1
 
5
- Copyright 2026 Hasna
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
6
5
 
7
- Licensed under the Apache License, Version 2.0 (the "License");
8
- you may not use this file except in compliance with the License.
9
- You may obtain a copy of the License at
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
10
7
 
11
- http://www.apache.org/licenses/LICENSE-2.0
8
+ 1. Definitions.
12
9
 
13
- Unless required by applicable law or agreed to in writing, software
14
- distributed under the License is distributed on an "AS IS" BASIS,
15
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- See the License for the specific language governing permissions and
17
- limitations under the License.
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Hasna
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -8,12 +8,15 @@ This package is local-first. By default it stores JSON files under `~/.hasna/eve
8
8
  - `events.json`
9
9
  - `deliveries.json`
10
10
 
11
- Override the data directory with `HASNA_EVENTS_DIR`, `HASNA_EVENTS_HOME`, or the CLI `--dir` flag.
11
+ The CLI `--dir` flag has highest precedence, followed by `HASNA_EVENTS_DIR`,
12
+ then the legacy `HASNA_EVENTS_HOME` fallback.
12
13
 
13
14
  ## Storage Runtime Contract
14
15
 
15
- The default runtime is local JSON files. It does not use local SQLite, remote
16
- Postgres, S3, AWS infrastructure, or live cloud mutation:
16
+ The default compatibility runtime is local JSON files. It does not use local
17
+ SQLite, remote Postgres, S3, AWS infrastructure, or live cloud mutation. Apps
18
+ that require cross-process idempotency and restart-safe webhook delivery should
19
+ use the opt-in durable spool and SQLite broker described below.
17
20
 
18
21
  ```ts
19
22
  import { getEventsStatus } from "@hasna/events";
@@ -55,7 +58,8 @@ changes is an explicit deployment/approval step, not part of this local runtime.
55
58
  bun add @hasna/events
56
59
  ```
57
60
 
58
- This package is not published by this repository setup step. Apps can also depend on the local workspace path while the rollout is in progress.
61
+ The core CLI and durable SQLite broker require Bun 1.0 or newer. The isolated
62
+ `@hasna/events/durable-spool` producer export supports Node 20 or newer.
59
63
 
60
64
  ## Event Envelope
61
65
 
@@ -81,21 +85,29 @@ await events.emit({
81
85
  });
82
86
  ```
83
87
 
84
- Envelope fields are:
88
+ Only `source` and `type` are required inputs. `id` defaults to a UUID, `time`
89
+ to the current ISO timestamp, `severity` to `info`, `data` and `metadata` to
90
+ empty objects, and `schemaVersion` to `1.0`. `subject`, `message`, and
91
+ `dedupeKey` are optional.
85
92
 
86
- - `id`
87
- - `source`
88
- - `type`
89
- - `time`
90
- - `subject`
91
- - `severity`
92
- - `data`
93
- - `message`
94
- - `dedupeKey`
95
- - `schemaVersion`
96
- - `metadata`
93
+ `source` should be the emitting app or bounded context. `type` should use dot
94
+ notation such as `ticket.created`, `repo.synced`, or `check.failed`. Emission
95
+ deduplicates by either an explicit `id` or `dedupeKey` by default; a duplicate
96
+ is neither stored nor delivered again. Library callers can pass
97
+ `{ dedupe: false }` to store a duplicate intentionally.
97
98
 
98
- `source` should be the emitting app or bounded context. `type` should use dot notation such as `ticket.created`, `repo.synced`, or `check.failed`.
99
+ ## Package Entry Points
100
+
101
+ The root export includes the client, types, storage, filtering, signing,
102
+ transports, and catalog APIs. Focused entry points are also available:
103
+
104
+ - `@hasna/events/storage`
105
+ - `@hasna/events/signing`
106
+ - `@hasna/events/filter`
107
+ - `@hasna/events/transports`
108
+ - `@hasna/events/catalog`
109
+ - `@hasna/events/commander`
110
+ - `@hasna/events/cli`
99
111
 
100
112
  ## Typed Event Catalog (Distribution Events)
101
113
 
@@ -207,7 +219,11 @@ await events.addChannel({
207
219
  });
208
220
  ```
209
221
 
210
- Filters support `*` wildcards and nested `data` or `metadata` paths.
222
+ All matchers inside one filter are ANDed. Multiple filters on a channel are
223
+ ORed. A channel with no filters accepts every event, while a disabled channel
224
+ accepts none. String matchers support `*` and `**`; `data` and `metadata`
225
+ matchers also support nested or literal dotted keys, primitive array-member
226
+ matching, typed values, and negative matchers.
211
227
 
212
228
  ## Webhook Transport
213
229
 
@@ -215,10 +231,19 @@ Webhook delivery sends a `POST` with the event envelope as JSON.
215
231
 
216
232
  Headers:
217
233
 
234
+ - `Content-Type: application/json`
235
+ - `User-Agent: @hasna/events`
218
236
  - `X-Hasna-Event-Id`
219
237
  - `X-Hasna-Event-Type`
220
238
  - `X-Hasna-Timestamp`
221
- - `X-Hasna-Signature` when `webhook.secret` is configured
239
+ - `X-Hasna-Signature` when `webhook.secret` or `webhook.secretRef` resolves
240
+
241
+ `X-Hasna-Timestamp` is the current delivery-attempt time and is what the HMAC
242
+ signs. The envelope `time` in the JSON body remains the original event time, so
243
+ delayed imports and retries receive fresh replay-window signatures without
244
+ rewriting domain history.
245
+ Custom webhook headers whose names begin with `X-Hasna-` are rejected so channel
246
+ configuration cannot replace signed delivery metadata.
222
247
 
223
248
  Signatures use HMAC-SHA256 over:
224
249
 
@@ -244,6 +269,113 @@ const ok = verifyWebhookSignature(secret, timestamp, body, signature);
244
269
  Pass an explicit `toleranceMs` when a consumer needs a tighter or wider replay
245
270
  window.
246
271
 
272
+ ## Durable Node Producer And Bun Delivery Worker
273
+
274
+ `@hasna/events/durable-spool` is the producer boundary for Node 20+ apps. It
275
+ has no Bun runtime import and performs no network access. Each enqueue writes a
276
+ mode-0600 temporary file, fsyncs it, hard-links it without replacement to an
277
+ identity-keyed final name, removes the temporary file, and fsyncs the inbox
278
+ directory. Concurrent producers with the same `dedupeKey` converge on one
279
+ immutable record.
280
+
281
+ ```ts
282
+ import { DurableEventSpool } from "@hasna/events/durable-spool";
283
+
284
+ const spool = new DurableEventSpool({ dataDir: process.env.HASNA_EVENTS_DIR! });
285
+ await spool.enqueue({
286
+ id: "notes:note:123:created",
287
+ source: "notes",
288
+ type: "note.created",
289
+ time: "2026-08-06T12:00:00.000Z",
290
+ subject: "note:123",
291
+ dedupeKey: "notes:note:123:created",
292
+ schemaVersion: "notes.v1",
293
+ data: {
294
+ noteId: "123",
295
+ createdAt: "2026-08-06T12:00:00.000Z",
296
+ originMachine: "station03",
297
+ },
298
+ metadata: {},
299
+ });
300
+ ```
301
+
302
+ `@hasna/events/durable` is Bun-only because it uses `bun:sqlite`. The broker
303
+ imports committed spool records into an event and matching-channel outbox in a
304
+ SQLite `BEGIN IMMEDIATE` transaction, then removes the spool record. SQLite WAL,
305
+ unique event/dedupe identities, unique event/channel jobs, bounded leases, and
306
+ persisted retry timestamps make separate workers and process restarts safe.
307
+ Producer spool records and broker event rows apply the default sensitive-key
308
+ redaction. Each outbox row additionally applies its channel's `redact.paths`
309
+ before the payload is persisted or delivered.
310
+ The broker initializes schema v1 only from an empty version-0 application
311
+ schema. Existing v1 databases must match the complete columns, constraints,
312
+ foreign keys, and indexes; malformed or newer schemas are rejected unchanged.
313
+
314
+ ```ts
315
+ import { DurableEventsBroker } from "@hasna/events/durable";
316
+
317
+ const broker = new DurableEventsBroker({ dataDir: process.env.HASNA_EVENTS_DIR! });
318
+ broker.addChannel({
319
+ id: "notes-created",
320
+ enabled: false,
321
+ transport: "webhook",
322
+ filters: [{ source: "notes", type: "note.created" }],
323
+ webhook: {
324
+ url: "https://example.com/events/notes",
325
+ secretRef: "env:HASNA_NOTES_WEBHOOK_SECRET",
326
+ },
327
+ retry: { maxAttempts: 5, backoffMs: 1_000, multiplier: 2 },
328
+ });
329
+
330
+ broker.importSpool();
331
+ await broker.drain();
332
+ broker.close();
333
+ ```
334
+
335
+ Durable SQLite channels reject inline `webhook.secret` values. The default
336
+ resolver supports `env:VARIABLE_NAME`; callers can inject a vault-backed
337
+ resolver. Resolved credential values are used only to sign the in-memory HTTP
338
+ request and are never stored in channel configuration, the outbox, delivery
339
+ history, or status output.
340
+
341
+ Any HTTP 2xx response acknowledges delivery. The receiver therefore must return
342
+ 2xx only after durably enqueueing the event and must deduplicate by `dedupeKey`
343
+ or `id`. Non-2xx responses, timeouts, and unresolved runtime secrets follow the
344
+ persisted retry schedule. Exhausted jobs remain `dead`; an operator can call
345
+ `retryDead({ eventId, channelId, limit })` or use `events durable retry-dead`
346
+ without creating a second event/channel outbox identity.
347
+
348
+ The Bun CLI exposes the same operator boundary:
349
+
350
+ ```bash
351
+ events --dir "$HASNA_EVENTS_DIR" durable channel https://example.com/events/notes \
352
+ --id notes-created --source notes --type note.created \
353
+ --secret-ref env:HASNA_NOTES_WEBHOOK_SECRET --disabled
354
+
355
+ events --dir "$HASNA_EVENTS_DIR" durable drain --limit 100
356
+ events --dir "$HASNA_EVENTS_DIR" durable work --limit 100
357
+ events --dir "$HASNA_EVENTS_DIR" durable retry-dead --limit 100
358
+ events --dir "$HASNA_EVENTS_DIR" durable status
359
+ ```
360
+
361
+ `durable drain` imports and processes one bounded batch, then exits. Enqueueing
362
+ alone never performs network delivery. `durable work` is the long-running Bun
363
+ worker: it watches only the durable spool inbox, debounces file events, imports
364
+ and drains immediately, wakes at the next persisted retry timestamp, and runs a
365
+ low-frequency bounded reconciliation in case a filesystem notification was
366
+ missed. It never watches Apple Notes or note files. SIGTERM and SIGINT stop it
367
+ cleanly. Each worker claims only the job it is about to dispatch, and only the
368
+ current lease owner can settle it. Delivery is still at-least-once: if a request
369
+ outlives its lease, another worker may retry it, so receivers must deduplicate by
370
+ `dedupeKey` or `id`. This package change does not install, start, or enable a
371
+ runner; a canary deployment must supervise one `durable work` process explicitly.
372
+
373
+ Webhook requests time out after 15 seconds unless `webhook.timeoutMs` is set.
374
+ Non-2xx responses and network failures are recorded as failed attempts. The
375
+ compatibility JSON delivery path stores response bodies truncated after 4,096
376
+ characters; durable delivery intentionally omits response bodies, stdout, and
377
+ stderr from its outbox and delivery history.
378
+
247
379
  ## Command Transport
248
380
 
249
381
  Command channels run a local process and pass the event on stdin and environment variables.
@@ -278,19 +410,28 @@ Environment variables:
278
410
  - `HASNA_EVENT_SCHEMA_VERSION`
279
411
  - `HASNA_EVENT_JSON`
280
412
 
281
- The transport type union already reserves `email`, `sse`, and `mcp-relay` for later implementations.
413
+ Command processes time out after 15 seconds unless `command.timeoutMs` is set.
414
+ Their stdout and stderr are stored on the delivery attempt and truncated after
415
+ 4,096 characters. A zero exit code succeeds; other exits or signals fail.
416
+
417
+ Both implemented transports use one attempt by default. Channel retry policy
418
+ can increase `maxAttempts`; failed attempts back off from 250 ms by a default
419
+ multiplier of 2 unless overridden. The transport type union reserves `email`,
420
+ `sse`, and `mcp-relay`, but the CLI refuses to configure them and direct
421
+ dispatch currently records them as skipped.
282
422
 
283
423
  ## Redaction
284
424
 
285
425
  Events scrub obvious sensitive keys such as `secret`, `token`, `password`,
286
- `apiKey`, and `authorization` before local storage and delivery by default.
426
+ `apiKey`, `api_key`, `api-key`, and `authorization` recursively before local
427
+ storage and delivery by default.
287
428
  Callers that intentionally need raw local payloads can pass:
288
429
 
289
430
  ```ts
290
431
  await events.emit(input, { redactSensitiveData: false });
291
432
  ```
292
433
 
293
- Use channel-level paths for config-only redaction:
434
+ Use channel-level paths for per-channel delivery redaction:
294
435
 
295
436
  ```ts
296
437
  await events.addChannel({
@@ -319,6 +460,12 @@ const events = new EventsClient({
319
460
 
320
461
  The package exposes `events` and `hasna-events`.
321
462
 
463
+ Global options must come before the command group:
464
+
465
+ ```bash
466
+ events --dir /tmp/events --json status
467
+ ```
468
+
322
469
  ```bash
323
470
  events channels add https://example.com/channels/hasna \
324
471
  --id ops \
@@ -329,13 +476,16 @@ events channels add https://example.com/channels/hasna \
329
476
 
330
477
  events channels list
331
478
  events channels test ops
479
+ events channels match ops
332
480
  events channels remove ops
333
481
  ```
334
482
 
335
483
  Field filters can match nested `data` or `metadata` values. Plain
336
484
  `--data`/`--metadata` values are strings, which keeps ids and slugs such as
337
485
  `001` intact. Use `--data-json` or `--metadata-json` for typed JSON predicates.
338
- Dot paths access nested object keys; dots inside key names are not escaped yet.
486
+ Dot paths check both nested object keys and literal dotted keys; there is no
487
+ syntax to distinguish between those two forms yet. A negative predicate also
488
+ matches when its field is absent.
339
489
  When the actual event value is an array, string filters match any primitive
340
490
  array member, which is useful for tag routing such as `data.tags=auto:route`.
341
491
  Use `path!=value` or `path!=json` for negative predicates such as
@@ -389,6 +539,7 @@ events events emit ticket.created \
389
539
  --data '{"ticketId":123}'
390
540
 
391
541
  events events list --limit 20
542
+ events events list --source tickets --type ticket.created
392
543
  events events replay --type ticket.created
393
544
  events events replay --type ticket.created --dry-run --limit 100
394
545
  events events replay --type ticket.created --cursor "$NEXT_CURSOR" --limit 100
@@ -401,10 +552,10 @@ previous JSON replay response rather than constructing cursor strings in
401
552
  callers. A replay without `--limit` or `--cursor` processes all matching events;
402
553
  use those flags when callers need bounded page-by-page replay.
403
554
 
404
- Machine-readable status:
555
+ Machine-readable status (global flags precede `status`):
405
556
 
406
557
  ```bash
407
- events status --json
558
+ events --json status
408
559
  ```
409
560
 
410
561
  The status contract reports storage runtime, event, channel, delivery, file, and
@@ -412,6 +563,11 @@ transport metadata only. It does not include event payloads, webhook signing
412
563
  secrets, command environment values, or channel targets.
413
564
 
414
565
  Use `--json` for script-friendly output and `--dir <path>` for isolated data.
566
+ The standalone `events events list` command has no implicit row cap. Commands
567
+ registered into another Commander program with `registerEventsCommands` default
568
+ to the 100 most recent rows, accept a host override, and use `--limit 0` to list
569
+ all rows. The embedded emitter also supports `--no-dedupe`; the standalone CLI
570
+ does not currently expose that library option.
415
571
 
416
572
  ## App Integration Pattern
417
573