@automagik/omni 2.260910.10 → 2.260910.12

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.
@@ -0,0 +1,16 @@
1
+ -- Durable consumer exclude globs (#1078).
2
+ --
3
+ -- Adds durable_consumers.exclude_types: a JSON array of event-type globs
4
+ -- (same syntax as event_type — exact, or trailing-* prefix) dropped from the
5
+ -- consumer's stream. Exclusion wins over inclusion, so `custom.*` minus
6
+ -- `custom.chat.*` no longer floods application subscribers with
7
+ -- housekeeping (custom.chat.unread-updated, custom.lid-mapping.batch, ...).
8
+ -- NULL = nothing excluded (existing consumers are unchanged).
9
+ --
10
+ -- Hand-written following the 0043/0044/0052 precedent (additive, idempotent).
11
+ --
12
+ -- NOTE: no explicit BEGIN/COMMIT — the boot migrator executes this file on a
13
+ -- pooled postgres-js connection, which rejects raw transaction control.
14
+
15
+ ALTER TABLE "durable_consumers"
16
+ ADD COLUMN IF NOT EXISTS "exclude_types" jsonb;
@@ -463,6 +463,13 @@
463
463
  "when": 1786500000000,
464
464
  "tag": "0065_asc_channel",
465
465
  "breakpoints": true
466
+ },
467
+ {
468
+ "idx": 66,
469
+ "version": "7",
470
+ "when": 1786600000000,
471
+ "tag": "0066_consumer_exclude_types",
472
+ "breakpoints": true
466
473
  }
467
474
  ]
468
475
  }
@@ -27,7 +27,7 @@
27
27
  * `update` PATCHes in place, so the automation id and its execution logs
28
28
  * survive — no delete+recreate.
29
29
  */
30
- import type { CreateAutomationBody } from '@omni/sdk';
30
+ import type { CreateAutomationBody, TestAutomationBody } from '@omni/sdk';
31
31
  import { Command } from 'commander';
32
32
  type Action = CreateAutomationBody['actions'][number];
33
33
  interface ActionOptions {
@@ -68,11 +68,17 @@ declare function buildActions(options: ActionOptions): Action[] | undefined;
68
68
  declare function buildDefinition(options: DefinitionOptions): Partial<CreateAutomationBody>;
69
69
  /** Full create body: --file + flags, with the required fields enforced client-side. */
70
70
  declare function buildCreateBody(options: CreateOptions): CreateAutomationBody;
71
+ /**
72
+ * `--event` is either inline event JSON (legacy) or the id of a journaled
73
+ * event (#1073). Returns the API body, or undefined when it is neither.
74
+ */
75
+ declare function parseEventOption(raw: string): TestAutomationBody | undefined;
71
76
  export declare const __testables: {
72
77
  buildActions: typeof buildActions;
73
78
  buildDefinition: typeof buildDefinition;
74
79
  buildCreateBody: typeof buildCreateBody;
75
80
  readDefinitionFile: typeof readDefinitionFile;
81
+ parseEventOption: typeof parseEventOption;
76
82
  };
77
83
  export declare function createAutomationsCommand(): Command;
78
84
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"automations.d.ts","sourceRoot":"","sources":["../../src/commands/automations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,KAAK,MAAM,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAGtD,UAAU,aAAa;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,iBAAkB,SAAQ,aAAa;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,UAAU,aAAc,SAAQ,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CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,UAAU,aAAc,SAAQ,iBAAiB;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAgBD;;;;GAIG;AACH,iBAAS,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAkBvE;AASD;;;GAGG;AACH,iBAAS,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,EAAE,GAAG,SAAS,CA4BlE;AAQD;;;GAGG;AACH,iBAAS,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAgBlF;AAED,uFAAuF;AACvF,iBAAS,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,oBAAoB,CASrE;AAID;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAUrE;AAqBD,eAAO,MAAM,WAAW;;;;;;CAA2F,CAAC;AAMpH,wBAAgB,wBAAwB,IAAI,OAAO,CAgTlD"}
@@ -8,8 +8,10 @@
8
8
  * omni events timeline <person-id>
9
9
  */
10
10
  import { type AutomationCondition } from '@omni/core';
11
- import type { Event, OmniClient } from '@omni/sdk';
11
+ import type { Event, EventTypeInventoryRow, OmniClient } from '@omni/sdk';
12
12
  import { Command } from 'commander';
13
+ /** One table row for `omni events types` (JSON output keeps the raw API row). */
14
+ export declare function summarizeEventTypeRow(row: EventTypeInventoryRow): Record<string, unknown>;
13
15
  /** One journal row as returned inside a trace response. */
14
16
  interface TraceEvent {
15
17
  id: string;
@@ -82,11 +84,18 @@ export declare function isNoisyEvent(eventType: string): boolean;
82
84
  * (EventService.list) — keep the two in sync.
83
85
  */
84
86
  export declare function matchesEventTypeFilter(eventType: string, filter: string): boolean;
87
+ /**
88
+ * Include/exclude type sieve (#1078): the event must match `type` (when set)
89
+ * and must NOT match any `exclude` glob. Exclusion wins over inclusion.
90
+ */
91
+ export declare function passesEventTypeFilters(eventType: string, type?: string, exclude?: readonly string[]): boolean;
85
92
  /** Filter predicate matrix for `omni events stream`. Exported for unit tests. */
86
93
  export interface StreamFilterOptions {
87
94
  instanceId?: string;
88
95
  channel?: string;
89
96
  type?: string;
97
+ /** Type globs to drop; exclusion wins over `type` (#1078). */
98
+ exclude?: string[];
90
99
  chatId?: string;
91
100
  personId?: string;
92
101
  errorsOnly?: boolean;
@@ -172,6 +181,7 @@ interface ConsumerData {
172
181
  id: string;
173
182
  name: string;
174
183
  eventType: string;
184
+ excludeTypes?: string[] | null;
175
185
  filters: AutomationCondition[] | null;
176
186
  cursor: number;
177
187
  head: number;
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/commands/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,KAAK,mBAAmB,EAAsB,MAAM,YAAY,CAAC;AAC1E,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0MpC,2DAA2D;AAC3D,UAAU,UAAU;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC7C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AA+BD,wEAAwE;AACxE,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAKzE;AAyCD,wDAAwD;AACxD,UAAU,e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,wBAAsB,mBAAmB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAepH;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAY/E;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,GAAG,EAAE,OAAO,CAAC;IACb,8EAA8E;IAC9E,SAAS,EAAE,OAAO,CAAC;IACnB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC;IAC1B,sEAAsE;IACtE,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA8BD;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA4CxE;AA8FD,wBAAgB,mBAAmB,IAAI,OAAO,CA0Y7C"}
package/dist/index.js CHANGED
@@ -83212,6 +83212,7 @@ var init_schema2 = __esm(() => {
83212
83212
  id: uuid("id").primaryKey().defaultRandom(),
83213
83213
  name: varchar("name", { length: 100 }).notNull(),
83214
83214
  eventType: varchar("event_type", { length: 255 }).notNull(),
83215
+ excludeTypes: jsonb("exclude_types").$type(),
83215
83216
  filters: jsonb("filters").$type(),
83216
83217
  cursor: bigint2("cursor", { mode: "number" }).notNull().default(0),
83217
83218
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
@@ -115764,7 +115765,7 @@ var require_client2 = __commonJS((exports) => {
115764
115765
 
115765
115766
  // ../../node_modules/.bun/@sentry+node-core@10.52.0+2c50d7e904f6cfd7/node_modules/@sentry/node-core/build/cjs/sdk/esmLoader.js
115766
115767
  var require_esmLoader = __commonJS((exports) => {
115767
- var __filename = "/home/runner/work/omni/omni/.stable-source/node_modules/.bun/@sentry+node-core@10.52.0+2c50d7e904f6cfd7/node_modules/@sentry/node-core/build/cjs/sdk/esmLoader.js";
115768
+ var __filename = "/home/runner/work/omni/omni/node_modules/.bun/@sentry+node-core@10.52.0+2c50d7e904f6cfd7/node_modules/@sentry/node-core/build/cjs/sdk/esmLoader.js";
115768
115769
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
115769
115770
  var core = require_cjs();
115770
115771
  var importInTheMiddle = require_import_in_the_middle();
@@ -135693,6 +135694,15 @@ function createOmniClient(config) {
135693
135694
  if (!data)
135694
135695
  throw new OmniApiError("Analytics data not found", "NOT_FOUND", undefined, 404);
135695
135696
  return data;
135697
+ },
135698
+ async types(params) {
135699
+ const { data, error, response } = await client.GET("/events/types", {
135700
+ params: { query: params }
135701
+ });
135702
+ throwIfError(response, error);
135703
+ if (!data)
135704
+ throw new OmniApiError("Event types not found", "NOT_FOUND", undefined, 404);
135705
+ return data.items;
135696
135706
  }
135697
135707
  },
135698
135708
  persons: {
@@ -136073,7 +136083,7 @@ function createOmniClient(config) {
136073
136083
  body
136074
136084
  });
136075
136085
  throwIfError(response, error);
136076
- return data ?? { matched: false };
136086
+ return data;
136077
136087
  },
136078
136088
  async execute(id, body) {
136079
136089
  const { data, error, response } = await client.POST("/automations/{id}/execute", {
@@ -137188,7 +137198,7 @@ import { fileURLToPath } from "url";
137188
137198
  // package.json
137189
137199
  var package_default = {
137190
137200
  name: "@automagik/omni",
137191
- version: "2.260910.10",
137201
+ version: "2.260910.12",
137192
137202
  repository: {
137193
137203
  type: "git",
137194
137204
  url: "git+https://github.com/automagik-dev/omni.git",
@@ -139289,6 +139299,7 @@ one, or the entry named by the global flag:
139289
139299
  // src/commands/automations.ts
139290
139300
  import { readFileSync as readFileSync7 } from "fs";
139291
139301
  init_output();
139302
+ init_output();
139292
139303
  function collectRepeated(value, previous) {
139293
139304
  return [...previous ?? [], value];
139294
139305
  }
@@ -139390,6 +139401,38 @@ function buildCreateBody(options) {
139390
139401
  body.enabled = false;
139391
139402
  return body;
139392
139403
  }
139404
+ var UUID_RE2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
139405
+ function parseEventOption(raw2) {
139406
+ const value = raw2.trim();
139407
+ if (UUID_RE2.test(value))
139408
+ return { eventId: value };
139409
+ try {
139410
+ const event = JSON.parse(value);
139411
+ if (typeof event.type !== "string" || typeof event.payload !== "object" || event.payload === null)
139412
+ return;
139413
+ return { event };
139414
+ } catch {
139415
+ return;
139416
+ }
139417
+ }
139418
+ function reportExecution(result) {
139419
+ if (!result.triggered) {
139420
+ info("Automation not triggered (event type did not match)");
139421
+ data({ triggered: false });
139422
+ return;
139423
+ }
139424
+ const allSuccess = result.results.every((r6) => r6.status === "success");
139425
+ if (allSuccess) {
139426
+ success("Automation executed successfully", {
139427
+ automationId: result.automationId,
139428
+ actionsExecuted: result.results.length,
139429
+ results: result.results
139430
+ });
139431
+ } else {
139432
+ info("Automation executed with some failures");
139433
+ data({ automationId: result.automationId, results: result.results });
139434
+ }
139435
+ }
139393
139436
  function createAutomationsCommand() {
139394
139437
  const automations2 = new Command("automations").description("Manage automations");
139395
139438
  automations2.command("list").description("List all automations").option("--enabled", "Show only enabled automations").option("--disabled", "Show only disabled automations").action(async (options) => {
@@ -139496,70 +139539,57 @@ function createAutomationsCommand() {
139496
139539
  error(`Failed to disable automation: ${message2}`);
139497
139540
  }
139498
139541
  });
139499
- automations2.command("test <id>").description("Test an automation with a mock event").requiredOption("--event <json>", `Event JSON (e.g., '{"type":"message.received","payload":{}}')`).action(async (id, options) => {
139542
+ automations2.command("test <id>").description("Dry-run an automation against a mock event or a REAL journaled event: verdicts, no side effects").requiredOption("--event <json|event-id>", `Event JSON ('{"type":"message.received","payload":{}}') or the id of a journaled event (omni events list)`).option("--execute", "Actually run the actions against the event (same as `execute`)", false).action(async (id, options) => {
139500
139543
  const client = getClient();
139501
139544
  try {
139502
139545
  const automationId = await resolveAutomationId(id);
139503
- let event;
139504
- try {
139505
- event = JSON.parse(options.event);
139506
- } catch {
139507
- error("Invalid JSON for --event");
139546
+ const body = parseEventOption(options.event);
139547
+ if (!body) {
139548
+ error('--event must be valid JSON with "type" and "payload" fields, or a journaled event UUID');
139508
139549
  return;
139509
139550
  }
139510
- if (!event.type || !event.payload) {
139511
- error('Event must have "type" and "payload" fields');
139551
+ if (options.execute) {
139552
+ reportExecution(await client.automations.execute(automationId, body));
139553
+ return;
139512
139554
  }
139513
- const result = await client.automations.test(automationId, { event });
139514
- if (result.matched) {
139515
- success("Automation matched the event", {
139516
- matched: true,
139517
- wouldExecute: result.wouldExecute
139518
- });
139519
- } else {
139520
- info("Automation did not match the event");
139521
- data({ matched: false });
139555
+ const result = await client.automations.test(automationId, body);
139556
+ const verdicts = result.conditions.map((c10) => ({
139557
+ field: c10.field,
139558
+ operator: c10.operator,
139559
+ expected: c10.expected === undefined ? "" : JSON.stringify(c10.expected),
139560
+ actual: c10.resolved ? JSON.stringify(c10.actual) : "(unresolved)",
139561
+ matched: c10.matched ? "yes" : "no"
139562
+ }));
139563
+ const summary = result.matched ? "Automation matched the event (dry run \u2014 nothing executed)" : result.triggerMatched ? `Conditions did not match (${result.conditionLogic})` : "Trigger did not match: event type differs from the automation trigger";
139564
+ if (result.matched)
139565
+ success(summary);
139566
+ else
139567
+ info(summary);
139568
+ if (getCurrentFormat() === "json") {
139569
+ data(result);
139570
+ return;
139571
+ }
139572
+ if (verdicts.length > 0) {
139573
+ header("Conditions");
139574
+ list(verdicts, { rawData: result.conditions });
139522
139575
  }
139576
+ header("Actions (templates rendered, not executed)");
139577
+ data(result.actions);
139523
139578
  } catch (err2) {
139524
139579
  const message2 = err2 instanceof Error ? err2.message : "Unknown error";
139525
139580
  error(`Failed to test automation: ${message2}`);
139526
139581
  }
139527
139582
  });
139528
- automations2.command("execute <id>").description("Execute an automation with a provided event (actually runs actions)").requiredOption("--event <json>", `Event JSON (e.g., '{"type":"message.received","payload":{...}}')`).action(async (id, options) => {
139583
+ automations2.command("execute <id>").description("Execute an automation with a provided or journaled event (actually runs actions)").requiredOption("--event <json|event-id>", "Event JSON or the id of a journaled event").action(async (id, options) => {
139529
139584
  const client = getClient();
139530
139585
  try {
139531
139586
  const automationId = await resolveAutomationId(id);
139532
- let event;
139533
- try {
139534
- event = JSON.parse(options.event);
139535
- } catch {
139536
- error("Invalid JSON for --event");
139537
- return;
139538
- }
139539
- if (!event.type || !event.payload) {
139540
- error('Event must have "type" and "payload" fields');
139587
+ const body = parseEventOption(options.event);
139588
+ if (!body) {
139589
+ error('--event must be valid JSON with "type" and "payload" fields, or a journaled event UUID');
139541
139590
  return;
139542
139591
  }
139543
- const result = await client.automations.execute(automationId, { event });
139544
- if (result.triggered) {
139545
- const allSuccess = result.results.every((r6) => r6.status === "success");
139546
- if (allSuccess) {
139547
- success("Automation executed successfully", {
139548
- automationId: result.automationId,
139549
- actionsExecuted: result.results.length,
139550
- results: result.results
139551
- });
139552
- } else {
139553
- info("Automation executed with some failures");
139554
- data({
139555
- automationId: result.automationId,
139556
- results: result.results
139557
- });
139558
- }
139559
- } else {
139560
- info("Automation not triggered (event type did not match)");
139561
- data({ triggered: false });
139562
- }
139592
+ reportExecution(await client.automations.execute(automationId, body));
139563
139593
  } catch (err2) {
139564
139594
  const message2 = err2 instanceof Error ? err2.message : "Unknown error";
139565
139595
  error(`Failed to execute automation: ${message2}`);
@@ -143980,6 +144010,16 @@ async function fetchAnalytics(options) {
143980
144010
  }
143981
144011
  return await resp.json();
143982
144012
  }
144013
+ function summarizeEventTypeRow(row) {
144014
+ return {
144015
+ type: row.eventType,
144016
+ count: row.count,
144017
+ lastSeen: row.lastSeen,
144018
+ schema: row.schemaVersion === null ? "none" : `v${row.schemaVersion}${row.schemaEnabled ? "" : " (disabled)"}`,
144019
+ consumers: row.consumers.join(",") || "-",
144020
+ automations: row.automations.join(",") || "-"
144021
+ };
144022
+ }
143983
144023
  function displayAnalytics(data2) {
143984
144024
  const format = getOutputFormat();
143985
144025
  if (format === "json") {
@@ -144186,10 +144226,15 @@ function isNoisyEvent(eventType) {
144186
144226
  function matchesEventTypeFilter(eventType, filter) {
144187
144227
  return filter.endsWith("*") ? eventType.startsWith(filter.slice(0, -1)) : eventType === filter;
144188
144228
  }
144229
+ function passesEventTypeFilters(eventType, type, exclude) {
144230
+ if (type && !matchesEventTypeFilter(eventType, type))
144231
+ return false;
144232
+ return !exclude?.some((glob) => matchesEventTypeFilter(eventType, glob));
144233
+ }
144189
144234
  function passesStreamFilters(event, options) {
144190
144235
  if (options.instanceId && event.instanceId !== options.instanceId)
144191
144236
  return false;
144192
- if (options.type && !matchesEventTypeFilter(event.eventType, options.type))
144237
+ if (!passesEventTypeFilters(event.eventType, options.type, options.exclude))
144193
144238
  return false;
144194
144239
  if (options.chatId && event.chatUuid !== options.chatId)
144195
144240
  return false;
@@ -144259,6 +144304,7 @@ async function fetchStreamBatch(client, filters, channel2, type, sinceIso) {
144259
144304
  channel: channel2,
144260
144305
  eventType: type,
144261
144306
  chatId: filters.chatId,
144307
+ excludeEventType: filters.exclude?.length ? filters.exclude.join(",") : undefined,
144262
144308
  since: sinceIso,
144263
144309
  limit: 100
144264
144310
  });
@@ -144301,6 +144347,7 @@ async function streamEvents(client, options) {
144301
144347
  instanceId,
144302
144348
  channel: options.channel,
144303
144349
  type: options.type,
144350
+ exclude: options.exclude,
144304
144351
  chatId,
144305
144352
  personId: options.personId,
144306
144353
  errorsOnly: options.errorsOnly,
@@ -144399,6 +144446,7 @@ function summarizeConsumerRow(row) {
144399
144446
  return {
144400
144447
  name: row.name,
144401
144448
  eventType: row.eventType,
144449
+ excludeTypes: row.excludeTypes?.length ? row.excludeTypes.join(", ") : "-",
144402
144450
  filters: row.filters?.length ? row.filters.map((f10) => `${f10.field} ${f10.operator} ${JSON.stringify(f10.value)}`).join(" AND ") : "-",
144403
144451
  cursor: row.cursor,
144404
144452
  lag: row.lag,
@@ -144457,7 +144505,7 @@ async function followConsumer(params) {
144457
144505
  }
144458
144506
  function createConsumersCommand() {
144459
144507
  const consumers = new Command("consumers").description("Manage durable event consumers (named cursors over the event journal)");
144460
- consumers.command("create <name>").description("Register a durable consumer").requiredOption("--type <type>", "Event type filter (trailing * = prefix glob, e.g. custom.github.*)").option("--filter <k=v>", "Payload condition, repeatable (dot paths + JSON values \u2014 same matcher as events wait)", (value, previous) => [...previous, value], []).option("--from-beginning", "Start the cursor at 0 (replay the full journal) instead of the current head").action(async (name, options) => {
144508
+ consumers.command("create <name>").description("Register a durable consumer").requiredOption("--type <type>", "Event type filter (trailing * = prefix glob, e.g. custom.github.*)").option("--exclude <glob>", "Drop event types matching this glob, repeatable; wins over --type (e.g. --exclude custom.chat.*)", (value, previous) => [...previous, value], []).option("--filter <k=v>", "Payload condition, repeatable (dot paths + JSON values \u2014 same matcher as events wait)", (value, previous) => [...previous, value], []).option("--from-beginning", "Start the cursor at 0 (replay the full journal) instead of the current head").action(async (name, options) => {
144461
144509
  try {
144462
144510
  const filters = parseWaitFilters(WaitOptionsSchema.shape.filter.parse(options.filter));
144463
144511
  const result = await consumersApiRequest("", {
@@ -144465,6 +144513,7 @@ function createConsumersCommand() {
144465
144513
  body: JSON.stringify({
144466
144514
  name,
144467
144515
  eventType: options.type,
144516
+ excludeTypes: options.exclude.length ? options.exclude : undefined,
144468
144517
  filters: filters.length ? filters : undefined,
144469
144518
  startFrom: options.fromBeginning ? "beginning" : undefined
144470
144519
  })
@@ -144534,7 +144583,7 @@ function createEventsCommand() {
144534
144583
  error(`Failed to list events: ${message2}`);
144535
144584
  }
144536
144585
  });
144537
- events2.command("stream").description("Stream events in real-time (tail -f style). Ctrl+C to stop.").option("--instance <id>", "Filter by instance ID").option("--channel <type>", "Filter by channel type").option("--type <type>", "Filter by event type (trailing * = prefix glob, e.g. custom.*)").option("--chat-id <id>", "Filter by chat ID").option("--person-id <id>", "Filter by person ID").option("--since <time>", "Start cursor (e.g., 5min, 24h, 7d, or ISO timestamp)").option("--errors-only", "Show only error/failure events").option("--all", "Include noisy event types (presence, delivered, read, progress)").option("--ndjson", "Emit JSON Lines (one event per line) \u2014 same as global --json in stream mode").option("-v, --verbose", "Add sender, fromMe marker and contentType columns").option("--ids", "Print raw ids instead of resolved instance/chat names").option("--poll-ms <n>", "Polling interval in milliseconds", (v4) => Number.parseInt(v4, 10), 2000).action(async (options) => {
144586
+ events2.command("stream").description("Stream events in real-time (tail -f style). Ctrl+C to stop.").option("--instance <id>", "Filter by instance ID").option("--channel <type>", "Filter by channel type").option("--type <type>", "Filter by event type (trailing * = prefix glob, e.g. custom.*)").option("--exclude <glob>", "Drop event types matching this glob, repeatable; wins over --type (e.g. --exclude custom.chat.*)", (value, previous) => [...previous, value], []).option("--chat-id <id>", "Filter by chat ID").option("--person-id <id>", "Filter by person ID").option("--since <time>", "Start cursor (e.g., 5min, 24h, 7d, or ISO timestamp)").option("--errors-only", "Show only error/failure events").option("--all", "Include noisy event types (presence, delivered, read, progress)").option("--ndjson", "Emit JSON Lines (one event per line) \u2014 same as global --json in stream mode").option("-v, --verbose", "Add sender, fromMe marker and contentType columns").option("--ids", "Print raw ids instead of resolved instance/chat names").option("--poll-ms <n>", "Polling interval in milliseconds", (v4) => Number.parseInt(v4, 10), 2000).action(async (options) => {
144538
144587
  const client = getClient();
144539
144588
  try {
144540
144589
  await streamEvents(client, options);
@@ -144543,7 +144592,7 @@ function createEventsCommand() {
144543
144592
  error(`Failed to stream events: ${message2}`);
144544
144593
  }
144545
144594
  });
144546
- events2.command("wait").description("Block until the first matching event, print it as JSON, exit 0. Exits non-zero on --timeout.").option("--instance <id>", "Filter by instance ID").option("--channel <type>", "Filter by channel type").option("--type <type>", "Filter by event type (trailing * = prefix glob, e.g. custom.*)").option("--chat-id <id>", "Filter by chat ID").option("--person-id <id>", "Filter by person ID").option("--filter <k=v>", "Payload condition, repeatable (dot paths + JSON values, e.g. --filter user.id=42 --filter status=open)", (value, previous) => [...previous, value], []).option("--timeout <seconds>", "Give up after N seconds: exit non-zero, nothing on stdout").option("--since <time>", "Start cursor (e.g., 5min, ISO timestamp; default: now)").option("--poll-ms <n>", "Polling interval in milliseconds", (v4) => Number.parseInt(v4, 10), 2000).action(async (options) => {
144595
+ events2.command("wait").description("Block until the first matching event, print it as JSON, exit 0. Exits non-zero on --timeout.").option("--instance <id>", "Filter by instance ID").option("--channel <type>", "Filter by channel type").option("--type <type>", "Filter by event type (trailing * = prefix glob, e.g. custom.*)").option("--exclude <glob>", "Drop event types matching this glob, repeatable; wins over --type (e.g. --exclude custom.chat.*)", (value, previous) => [...previous, value], []).option("--chat-id <id>", "Filter by chat ID").option("--person-id <id>", "Filter by person ID").option("--filter <k=v>", "Payload condition, repeatable (dot paths + JSON values, e.g. --filter user.id=42 --filter status=open)", (value, previous) => [...previous, value], []).option("--timeout <seconds>", "Give up after N seconds: exit non-zero, nothing on stdout").option("--since <time>", "Start cursor (e.g., 5min, ISO timestamp; default: now)").option("--poll-ms <n>", "Polling interval in milliseconds", (v4) => Number.parseInt(v4, 10), 2000).action(async (options) => {
144547
144596
  const client = getClient();
144548
144597
  try {
144549
144598
  const parsed = WaitOptionsSchema.parse({
@@ -144558,6 +144607,7 @@ function createEventsCommand() {
144558
144607
  instanceId,
144559
144608
  channel: options.channel,
144560
144609
  type: options.type,
144610
+ exclude: options.exclude,
144561
144611
  chatId,
144562
144612
  personId: options.personId,
144563
144613
  all: true
@@ -144666,6 +144716,16 @@ function createEventsCommand() {
144666
144716
  error(`Failed to get metrics: ${message2}`);
144667
144717
  }
144668
144718
  });
144719
+ events2.command("types").description("Inventory of observed event types: volume, schema status, subscribers").option("--since <time>", "Only count events since (e.g., 24h, 7d, or ISO timestamp)").action(async (options) => {
144720
+ const client = getClient();
144721
+ try {
144722
+ const rows = await client.events.types({ since: options.since ? parseSinceTime(options.since) : undefined });
144723
+ list(rows.map(summarizeEventTypeRow), { emptyMessage: "No events observed.", rawData: rows });
144724
+ } catch (err2) {
144725
+ const message2 = err2 instanceof Error ? err2.message : "Unknown error";
144726
+ error(`Failed to list event types: ${message2}`);
144727
+ }
144728
+ });
144669
144729
  events2.command("analytics").description("Show event analytics summary").option("--instance <id>", "Filter by instance ID").option("--since <time>", "Events since (e.g., 24h, 7d, or ISO timestamp)").option("--all-time", "Show all-time stats (default: last 24h)").action(async (options) => {
144670
144730
  try {
144671
144731
  const data2 = await fetchAnalytics(options);
@@ -20,6 +20,7 @@ export type ReplaySession = components['schemas']['ReplaySession'];
20
20
  export type LogEntry = components['schemas']['LogEntry'];
21
21
  export type EventMetrics = components['schemas']['EventMetrics'];
22
22
  export type EventAnalytics = components['schemas']['EventAnalytics'];
23
+ export type EventTypeInventoryRow = components['schemas']['EventTypeInventoryRow'];
23
24
  export interface ChatSettings {
24
25
  muted?: boolean;
25
26
  muteUntil?: string;
@@ -294,6 +295,8 @@ export interface ListEventsParams {
294
295
  /** Chat UUID */
295
296
  chatId?: string;
296
297
  eventType?: string;
298
+ /** Comma-separated type globs to drop; exclusion wins over eventType. */
299
+ excludeEventType?: string;
297
300
  since?: string;
298
301
  until?: string;
299
302
  search?: string;
@@ -605,11 +608,16 @@ export interface CreateAutomationBody {
605
608
  * Body for testing an automation
606
609
  */
607
610
  export interface TestAutomationBody {
608
- event: {
611
+ /** Hand-written event. Exactly one of event / eventId. */
612
+ event?: {
609
613
  type: string;
610
614
  payload: Record<string, unknown>;
611
615
  };
616
+ /** Id of a REAL journaled event to run against (#1073). */
617
+ eventId?: string;
612
618
  }
619
+ /** Dry-run result of `automations.test` (#1073). */
620
+ export type AutomationTestResult = components['schemas']['AutomationTestResult'];
613
621
  /**
614
622
  * Query parameters for listing automation logs
615
623
  */
@@ -1616,6 +1624,12 @@ export declare function createOmniClient(config: OmniClientConfig): {
1616
1624
  analytics(params?: {
1617
1625
  granularity?: "hourly" | "daily";
1618
1626
  }): Promise<EventAnalytics>;
1627
+ /**
1628
+ * Inventory of observed event types: volume, schema status, subscribers (#1075)
1629
+ */
1630
+ types(params?: {
1631
+ since?: string;
1632
+ }): Promise<EventTypeInventoryRow[]>;
1619
1633
  };
1620
1634
  /**
1621
1635
  * Person/identity search
@@ -1841,10 +1855,7 @@ export declare function createOmniClient(config: OmniClientConfig): {
1841
1855
  /**
1842
1856
  * Test an automation (dry run)
1843
1857
  */
1844
- test(id: string, body: TestAutomationBody): Promise<{
1845
- matched: boolean;
1846
- wouldExecute?: unknown[];
1847
- }>;
1858
+ test(id: string, body: TestAutomationBody): Promise<AutomationTestResult>;
1848
1859
  /**
1849
1860
  * Execute an automation (actually runs actions)
1850
1861
  */