mcp-event-intelligence 0.3.1 → 0.5.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 (51) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/README.md +123 -23
  3. package/SECURITY.md +4 -4
  4. package/bin/mcp-event-intelligence.mjs +3 -3
  5. package/dist/src/composite/engine.d.ts +6 -0
  6. package/dist/src/composite/engine.js +599 -10
  7. package/dist/src/composite/matching.d.ts +1 -1
  8. package/dist/src/composite/matching.js +66 -1
  9. package/dist/src/intelligenceProtocol/activationSchemas.d.ts +2 -0
  10. package/dist/src/intelligenceProtocol/activationSchemas.js +1 -0
  11. package/dist/src/intelligenceProtocol/index.d.ts +9 -2
  12. package/dist/src/intelligenceProtocol/index.js +5 -1
  13. package/dist/src/intelligenceProtocol/operatorRegistry.d.ts +567 -0
  14. package/dist/src/intelligenceProtocol/operatorRegistry.js +477 -0
  15. package/dist/src/intelligenceProtocol/patternV2Schemas.d.ts +188 -0
  16. package/dist/src/intelligenceProtocol/patternV2Schemas.js +801 -0
  17. package/dist/src/intelligenceProtocol/schemas.d.ts +6 -0
  18. package/dist/src/intelligenceProtocol/schemas.js +3 -0
  19. package/dist/src/intelligenceProtocol/triggerPlanSchemas.d.ts +179 -4
  20. package/dist/src/intelligenceProtocol/triggerPlanSchemas.js +38 -4
  21. package/dist/src/intelligenceProtocol/triggerSchemas.d.ts +262 -0
  22. package/dist/src/intelligenceProtocol/triggerSchemas.js +164 -2
  23. package/dist/src/mcpEvents/consumer.d.ts +2 -0
  24. package/dist/src/mcpEvents/consumer.js +2 -0
  25. package/dist/src/mcpEvents/erpnextProvider.d.ts +0 -2
  26. package/dist/src/mcpEvents/erpnextProvider.js +0 -3
  27. package/dist/src/mcpEvents/provider.d.ts +24 -10
  28. package/dist/src/mcpEvents/provider.js +124 -55
  29. package/dist/src/mcpEvents/server.d.ts +3 -1
  30. package/dist/src/mcpEvents/server.js +20 -19
  31. package/dist/src/patternV2/evaluator.d.ts +43 -0
  32. package/dist/src/patternV2/evaluator.js +927 -0
  33. package/dist/src/patternV2/legacyCompiler.d.ts +3 -0
  34. package/dist/src/patternV2/legacyCompiler.js +184 -0
  35. package/dist/src/protocol/types.d.ts +1 -0
  36. package/package.json +5 -2
  37. package/scripts/host-integration.d.mts +47 -0
  38. package/scripts/host-integration.mjs +9 -0
  39. package/scripts/lib/activation-hydrator.mjs +1 -0
  40. package/scripts/lib/composite-event-consumer.mjs +4 -0
  41. package/scripts/lib/derived-event-coordinator.mjs +75 -1
  42. package/scripts/lib/json-schema.mjs +134 -0
  43. package/scripts/lib/local-event-intelligence-runtime.mjs +1 -0
  44. package/scripts/lib/mcp-events-client.mjs +798 -253
  45. package/scripts/lib/mcp-events-compatibility.mjs +54 -0
  46. package/scripts/lib/persistent-event-store.mjs +68 -9
  47. package/scripts/lib/trigger-control-plane.mjs +180 -0
  48. package/scripts/lib/trigger-inspector.mjs +15 -0
  49. package/scripts/lib/trigger-planner.mjs +213 -12
  50. package/scripts/mcp-stdio-server.mjs +38 -52
  51. package/server.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,86 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.0] - 2026-09-30
4
+
5
+ ### Pattern AST v2 / advanced CEP
6
+
7
+ - add additive recursive Pattern AST v2 while keeping legacy composite triggers executable;
8
+ - add nested `allOf` / `anyOf` / `sequence`, explicit `next` / `followedBy` / `followedByAny` contiguity, repeat/optional quantifiers and greedy/lazy matching;
9
+ - add bounded negative patterns (`notNext`, `notFollowedBy`) and first-class calendar/absence/debounce/rate/distinct temporal nodes;
10
+ - add within/sliding/tumbling/hopping/session/count windows;
11
+ - add cross-event arithmetic comparisons plus startsWith/endsWith/regex/notIn/between/isNull/type predicates;
12
+ - add sum/avg/min/max/count/countDistinct/first/last/nth/stddev/percentile aggregates and derived-event measures;
13
+ - add changed/changedFrom/increasedBy/decreasedBy/delta/percentChange/stableFor/crossesAbove/crossesBelow state operators;
14
+ - add partitioned durable CEP buffers, overlap/after-match selection policies, bounded candidate budgets and bounded event-time retention;
15
+ - add vendor-neutral first-class `semantic` nodes behind `SemanticEvaluator`; TypeSafe Jev remains optional and explicit;
16
+ - enforce per-node semantic timeout, trigger-level semantic-evaluation budgets and audit every semantic decision, including rejects;
17
+ - validate Pattern v2 refs, partition dimensions, durations, payload paths and derived measures against live source contracts;
18
+ - add `compileLegacyTriggerToPatternV2()` for compatibility/migration and differential verification;
19
+ - expose the complete v2 language through `describeTriggerLanguage()` / `trigger_language_describe`;
20
+ - add end-to-end coverage for advanced predicates, quantifiers, contiguity, windows, arithmetic, state, semantic evaluation, partition isolation, negative deadlines and derived measures.
21
+
22
+ ### Event-time correctness
23
+
24
+ - preserve host `receivedAt` separately from provider `occurredAt` through correlation evidence, derived lineage and activation hydration;
25
+ - sequence and window evaluation no longer depend on delivery order;
26
+ - partial matches are selected by compatible event-time span and can be re-anchored when an earlier event arrives late;
27
+ - add explicit `eventTime.allowedLatenessMs` watermarks for bounded late-event tolerance;
28
+ - events older than the watermark may finish retained compatible partials but cannot seed stale windows;
29
+ - late events outside `withinMs` are isolated instead of creating false composite matches.
30
+
31
+ ### Agent authoring language
32
+
33
+ - add a versioned, self-describing trigger operator registry;
34
+ - add embedded `host.describeTriggerLanguage()` / scoped discovery;
35
+ - add non-mutating MCP `trigger_language_describe` with category/operator filtering;
36
+ - make the MCP `trigger_plan` tool reuse the package's canonical `TriggerPlanInputSchema` instead of maintaining a duplicate input schema;
37
+ - expose all canonical temporal operators through `TriggerPlanInput.temporal`;
38
+ - validate temporal event references and `distinct.path` against live source schemas before compilation;
39
+ - add registry/schema parity tests so supported operators cannot silently drift out of the agent-visible catalog.
40
+
41
+ ### Trigger composition
42
+
43
+ - add explicit `conditionOnly: true` programs with no runtime target, continuation or derived output;
44
+ - agent-friendly planning can compile condition-only programs;
45
+ - identical active `(connection, event, arguments)` clauses share one upstream MCP EventSubscription with observable local fan-out count.
46
+
47
+ ### MCP Events compatibility
48
+
49
+ - external draft assumptions are centralized behind a versioned compatibility profile instead of being spread through the runtime;
50
+ - the current default profile remains the 2026-09-25 experimental extension snapshot;
51
+ - host-owned/embedded integration remains the primary architecture; standalone/provider-native paths are compatibility surfaces, not a new deployment requirement.
52
+
53
+
54
+ ### Compatibility
55
+
56
+ - Pattern AST v2 is additive; legacy composite/temporal triggers remain executable unchanged;
57
+ - the internal persisted Event Intelligence protocol/schema identifiers remain on the v0.1 compatibility line;
58
+ - `compileLegacyTriggerToPatternV2()` is available for migration/differential verification without forcing existing persisted triggers to rewrite;
59
+ - MCP Events remains experimental and isolated behind the versioned compatibility profile.
60
+
61
+
62
+ ## [0.4.0] - 2026-09-25
63
+
64
+ Current MCP Events draft alignment.
65
+
66
+ ### MCP Events boundary
67
+
68
+ - switched event capability negotiation to `capabilities.extensions["io.modelcontextprotocol/events"]`;
69
+ - removed the legacy `server/discover` / `io.modelcontextprotocol.experimental/events` compatibility surface;
70
+ - added paginated `events/list`, draft error semantics, nullable cursors and `_meta` preservation;
71
+ - validates subscription `arguments` against advertised `inputSchema`;
72
+ - separates EventSource descriptors from durable EventSubscriptions keyed by connection + event name + canonical arguments;
73
+ - stores independent cursor/delivery state per subscription;
74
+ - poll scheduling now follows server `nextPollMs` and keeps `hasMore` distinct from `truncated`;
75
+ - host-owned push and webhook adapters feed the same EventOccurrence pipeline as poll;
76
+ - added current-draft discovery/poll conformance-shaped regression coverage.
77
+
78
+ ### Compatibility
79
+
80
+ - trigger clauses gain additive `arguments: {}`; existing persisted trigger definitions remain readable because omitted arguments default to an empty object;
81
+ - composite, temporal, derived-event and wake semantics are unchanged;
82
+ - event ingress targets the 2026-09-25 experimental draft direction represented by experimental-ext-triggers-events PR #7 and conformance PR #521, not a finalized MCP specification.
83
+
3
84
  All notable public changes are documented here.
4
85
 
5
86
  ## [0.3.1] - 2026-09-20
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![CI](https://github.com/sarooo17/event-intelligence/actions/workflows/ci.yml/badge.svg)](https://github.com/sarooo17/event-intelligence/actions/workflows/ci.yml)
6
6
  [![npm](https://img.shields.io/npm/v/mcp-event-intelligence.svg)](https://www.npmjs.com/package/mcp-event-intelligence)
7
- [![MCP Registry](https://img.shields.io/badge/MCP%20Registry-v0.3.1-5b5bd6)](https://registry.modelcontextprotocol.io/?q=io.github.sarooo17%2Fevent-intelligence)
7
+ [![MCP Registry](https://img.shields.io/badge/MCP%20Registry-v0.5.0-5b5bd6)](https://registry.modelcontextprotocol.io/?q=io.github.sarooo17%2Fevent-intelligence)
8
8
  [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
9
9
 
10
10
  MCP Event Intelligence is an experimental event runtime for agents that need to react to **future conditions over multiple event sources** without keeping an LLM or agent loop alive.
@@ -19,7 +19,7 @@ An agent can express an intent such as:
19
19
 
20
20
  > When this PR is merged, the production deploy succeeds, and no error is observed for 10 minutes, wake this task and review the release.
21
21
 
22
- Event Intelligence persists that continuation independently of the model, waits for the world to satisfy it, and wakes the host only when necessary.
22
+ Event Intelligence persists the future condition independently of the model, waits for the world to satisfy it, and wakes the host only when the condition has an activation target. Conditions may also exist without an agent continuation; higher-level facts are composed separately through derived-event triggers.
23
23
 
24
24
  ## Embed it in an existing agent host
25
25
 
@@ -59,7 +59,17 @@ Event Intelligence enumerates the host registry automatically. GitHub, Gmail, pr
59
59
 
60
60
  ### Agent-first trigger flow
61
61
 
62
- Agents no longer need to construct the low-level trigger DSL directly for common cases. Ask EI to compile an agent-friendly plan against the event sources that are actually available:
62
+ Agents do not need to construct the low-level trigger DSL directly. The public authoring flow is self-describing: discover the live event sources, inspect the trigger language only when needed, then ask EI to compile an agent-friendly plan against the sources that are actually available:
63
+
64
+ ```js
65
+ const temporalLanguage = ei.describeTriggerLanguage({
66
+ category: 'temporal',
67
+ });
68
+
69
+ // returns the supported temporal operators, required fields and examples
70
+ ```
71
+
72
+ The same catalog is available through the optional MCP control plane as `trigger_language_describe`. This keeps operator discovery out of the agent's permanent prompt/context and makes new operators discoverable on demand.
63
73
 
64
74
  ```js
65
75
  const plan = await ei.planTrigger({
@@ -91,9 +101,78 @@ await ei.triggerControl.createTrigger({
91
101
  });
92
102
  ```
93
103
 
94
- `planTrigger()` is deterministic. It does not call a model. It resolves event names to live source/server IDs, validates predicate paths against advertised payload schemas, compiles `all` / `any` / `sequence` / `count`, and returns the canonical trigger definition plus the required connection IDs.
104
+ `planTrigger()` is deterministic. It does not call a model. It resolves event names to live source/server IDs, validates predicate paths against advertised payload schemas, compiles `all` / `any` / `sequence` / `count`, accepts the canonical temporal operator set (`calendar`, `absence`, `not`, `unless`, `after`, `until`, `debounce`, `threshold`, `rate`, `distinct`), and returns the canonical trigger definition plus the required connection IDs.
105
+
106
+ The canonical trigger definition remains the engine IR/advanced API. Agents should normally author through `planTrigger()` / `trigger_plan`, using `describeTriggerLanguage()` / `trigger_language_describe` for operator discovery.
107
+
108
+ ### Pattern AST v2: advanced CEP
109
+
110
+ For advanced event programs, `TriggerPlanInput.patternV2` is the preferred authoring surface. Event declarations still describe discovered MCP event sources once; the recursive AST refers to those aliases and composes them without duplicating transport/provider configuration.
111
+
112
+ ```js
113
+ const plan = await ei.planTrigger({
114
+ events: [
115
+ { id: 'order', event: 'erpnext.sales_order.created' },
116
+ { id: 'failure', event: 'payments.failed' },
117
+ { id: 'ticket', event: 'support.ticket.created' },
118
+ ],
119
+ withinMs: 30 * 60 * 1000,
120
+ patternV2: {
121
+ version: '2',
122
+ partitionBy: [{
123
+ key: 'customer',
124
+ fields: [
125
+ { ref: 'order', path: 'customer' },
126
+ { ref: 'failure', path: 'customer' },
127
+ { ref: 'ticket', path: 'customer' },
128
+ ],
129
+ }],
130
+ root: {
131
+ kind: 'aggregate',
132
+ function: 'sum',
133
+ ref: 'order',
134
+ path: 'grand_total',
135
+ op: 'gte',
136
+ value: 10000,
137
+ child: {
138
+ kind: 'sequence',
139
+ contiguity: 'followedBy',
140
+ children: [
141
+ { kind: 'event', ref: 'order' },
142
+ {
143
+ kind: 'repeat',
144
+ child: { kind: 'event', ref: 'failure' },
145
+ min: 2,
146
+ max: 5,
147
+ mode: 'greedy',
148
+ },
149
+ {
150
+ kind: 'optional',
151
+ child: { kind: 'event', ref: 'ticket' },
152
+ mode: 'greedy',
153
+ },
154
+ ],
155
+ },
156
+ },
157
+ },
158
+ target: {
159
+ runtime: 'agent',
160
+ kind: 'conversation',
161
+ id: 'chat-42',
162
+ },
163
+ continuation: {
164
+ instruction: 'Review this customer payment-risk pattern.',
165
+ },
166
+ });
167
+ ```
168
+
169
+ Pattern AST v2 adds nested boolean/sequence patterns, strict and relaxed contiguity, repeat/optional quantifiers, negative look-ahead, streaming windows, cross-event comparisons, aggregates, state-transition operators, partitioning, overlap/after-match policies and deterministic derived measures.
95
170
 
96
- The persisted `continuation` answers a separate question from the trigger condition: **what should the agent do after the future condition becomes true?**
171
+ The runtime is **deterministic first**. A first-class `semantic` node is available only when structural data cannot express the condition reliably. It is vendor-neutral and calls the configured `SemanticEvaluator`; the bundled TypeSafe Jev adapter is optional when `TYPESAFE_API_KEY` is present. Semantic calls are explicit, bounded, timed out and audit-recorded; ordinary CEP execution requires no model API.
172
+
173
+ Legacy `expression + temporal + correlation` triggers remain supported. `compileLegacyTriggerToPatternV2()` provides an additive compatibility path rather than forcing stored v1 triggers to migrate synchronously.
174
+
175
+ The persisted `continuation` answers a separate question from the trigger condition: **what should the agent do after the future condition becomes true?** A trigger can instead set `conditionOnly: true` and persist only the condition state, with no runtime target or continuation.
97
176
 
98
177
  The wire wake remains deliberately small and reference-only. Embedded hosts also receive an Activation Envelope as the second wake argument. The same envelope can be reconstructed later:
99
178
 
@@ -169,9 +248,9 @@ const events = createMcpEventsProvider({
169
248
  });
170
249
  ```
171
250
 
172
- The package owns capability advertisement, `server/discover`, `events/list`, `events/poll`, common validation and response shapes. The provider owns domain event definitions, authentication, data queries, occurrence IDs and opaque cursor semantics.
251
+ The package owns the current draft Events extension identifier/settings, `events/list`, `events/poll`, common validation and response shapes. The embedding MCP server advertises `capabilities.extensions["io.modelcontextprotocol/events"]`; the provider owns domain event definitions, authentication, data queries, occurrence IDs and opaque cursor semantics.
173
252
 
174
- This adapter remains experimental compatibility work around MCP Events; it is not a claim of finalized MCP Events conformance.
253
+ This adapter tracks the current experimental MCP Events draft. It is not a claim of finalized MCP Events conformance. The v0.4 compatibility snapshot follows the `io.modelcontextprotocol/events` extension-negotiation direction in experimental-ext-triggers-events PR #7 and the discovery/poll contract exercised by conformance PR #521 as of 2026-09-25.
175
254
 
176
255
 
177
256
  An ERPNext-shaped **provider factory** is also exported:
@@ -203,15 +282,19 @@ timezone normalization and deterministic occurrence IDs. The local factory in
203
282
  this package should therefore be read as a typed convenience API, not as the
204
283
  production ERP connector itself.
205
284
 
206
- ## What v0.3 implements
285
+ ## What v0.4 implements
207
286
 
208
287
  ### Host-owned event sources
209
288
 
210
289
  - automatic discovery from the host's existing MCP registry;
211
290
  - reuse of already-connected MCP clients without duplicate credentials;
212
- - experimental MCP Events capability discovery;
213
- - `events/list` and `events/poll`;
214
- - persistent opaque cursors;
291
+ - direct MCP extension negotiation through `capabilities.extensions["io.modelcontextprotocol/events"]`;
292
+ - paginated `events/list` discovery;
293
+ - durable EventSubscription identity over `(connection, event name, arguments)`;
294
+ - `events/poll` with server-directed `nextPollMs`, nullable cursors and bounded page draining;
295
+ - host-owned push and webhook delivery adapters feeding the same EventOccurrence pipeline;
296
+ - persistent opaque cursors and per-subscription delivery state;
297
+ - shared upstream subscriptions fan out to every active trigger using the same `(connection, event, arguments)` tuple;
215
298
  - per-scope source/cursor isolation for shared hosts;
216
299
  - single-flight polling per connection plus bounded `hasMore` batch draining;
217
300
  - automatic event-source registration;
@@ -228,11 +311,20 @@ production ERP connector itself.
228
311
  - calendar-aware conditions with IANA timezones;
229
312
  - durable deadlines that continue even when no new provider event arrives.
230
313
 
314
+ ### Event sources vs subscriptions
315
+
316
+ `events/list` discovers an **EventSource** descriptor. A durable **EventSubscription** is a separate runtime object identified by the host connection, event name and canonical subscription `arguments`. Each subscription owns its cursor/delivery state independently.
317
+
318
+ This keeps MCP-side filtering separate from Event Intelligence conditions: `arguments` are validated against the provider's `inputSchema`; trigger `where` predicates are evaluated by EI against delivered payloads. Two triggers may therefore subscribe to the same event name with different arguments without sharing cursors.
319
+
320
+ Poll, push and webhook are treated only as delivery mechanisms. All three normalize into the same `EventOccurrence` ingestion path before correlation, temporal reasoning, derived events or wake logic.
321
+
231
322
  ### Agent-authored continuations
232
323
 
233
324
  - event-source discovery;
234
325
  - agent-friendly deterministic trigger planning/compilation;
235
- - `eq`, `neq`, `contains`, `in`, `exists`, `gt`, `gte`, `lt`, `lte` predicates;
326
+ - MCP subscription `arguments` validated against each source `inputSchema`, kept distinct from EI payload predicates;
327
+ - structured predicates including `eq`, `neq`, `contains`, `startsWith`, `endsWith`, `regex`, `in`, `notIn`, `between`, `exists`, `isNull`, `type`, `gt`, `gte`, `lt`, `lte`;
236
328
  - persisted continuation contracts separated from trigger conditions;
237
329
  - Activation Envelope hydration with matched event evidence;
238
330
  - embedded wake callbacks receive `(packet, activation)`;
@@ -294,19 +386,21 @@ This project does **not** propose a replacement for MCP Events and does not clai
294
386
 
295
387
  ## AI and API keys
296
388
 
297
- Event Intelligence has one optional AI boundary: **semantic correlation**.
389
+ Event Intelligence has one optional AI boundary: **explicit semantic evaluation**.
298
390
 
299
- - `TYPESAFE_API_KEY` enables the bundled TypeSafe Jev evaluator when a trigger explicitly requests semantic correlation.
391
+ - Pattern AST v2 exposes a vendor-neutral `semantic` node; legacy `semanticCorrelation` is the compatibility form.
392
+ - `TYPESAFE_API_KEY` enables the bundled TypeSafe Jev evaluator when a trigger explicitly requests semantic evaluation.
300
393
  - embedded hosts may inject a compatible `semanticEvaluator` instead.
394
+ - deterministic predicates, patterns, windows, aggregations, state changes, deadlines and derived measures never require an AI evaluator.
301
395
  - there is no bundled OpenAI planner and no OpenAI API dependency.
302
396
 
303
397
  The agent/harness is already responsible for natural-language reasoning. It can use `trigger_plan` / `planTrigger()` to compile common requests deterministically against discovered source schemas, or submit a canonical trigger definition directly for advanced cases. Deterministic correlation, temporal logic, persistence, derived events and wake delivery require no model API.
304
398
 
305
399
  ## Full-system acceptance
306
400
 
307
- The v0.3 acceptance suite verifies:
401
+ The v0.4 acceptance suite verifies:
308
402
 
309
- - host-owned MCP client → event discovery/poll → composite match → in-process wake;
403
+ - host-owned MCP client → extension discovery → durable subscription → poll/push/webhook occurrence → composite match → in-process wake;
310
404
  - provider-neutral events → composite match → derived event → derived composition → signed runtime wake;
311
405
  - contract schema evolution and ambiguity rejection;
312
406
  - refs-only root provenance;
@@ -322,7 +416,9 @@ The v0.3 acceptance suite verifies:
322
416
 
323
417
  A separate live regression also verified real GitHub webhook ingress into the MCP EventOccurrence / composite fan-in path.
324
418
 
325
- ## Standalone reference service
419
+ ## Reference/debug service
420
+
421
+ The HTTP service remains useful for local development, conformance work and provider-native regression tests. It is **not** the primary integration model and does not replace the embedded host-owned package path above.
326
422
 
327
423
  ### Requirements
328
424
 
@@ -350,13 +446,13 @@ The standalone service supports manual/provider-native event ingress. It does no
350
446
  ### Docker
351
447
 
352
448
  ```bash
353
- docker build -t mcp-event-intelligence:0.3.1 .
449
+ docker build -t mcp-event-intelligence:0.5.0 .
354
450
 
355
451
  docker run --rm \
356
452
  -p 3000:3000 \
357
453
  -v mcp-event-intelligence-data:/data \
358
454
  -e SERVICE_AUTH_TOKEN="$(openssl rand -hex 32)" \
359
- mcp-event-intelligence:0.3.1
455
+ mcp-event-intelligence:0.5.0
360
456
  ```
361
457
 
362
458
  ## Optional MCP control plane
@@ -402,7 +498,11 @@ The detailed execution model, clocks, lifecycle, persistence and trust boundarie
402
498
 
403
499
  ### Event-time vs processing-time
404
500
 
405
- Normal event windows use event `occurredAt`.
501
+ Normal event windows use event `occurredAt`; MCP ingress also preserves host `receivedAt` when available. Delivery order does not define event order.
502
+
503
+ Out-of-order events are matched against compatible event-time windows. A late event may re-anchor a partial match to an earlier `occurredAt` only when the complete event-time span still fits `withinMs`; otherwise it starts a separate partial window and cannot create a false sequence.
504
+
505
+ Triggers may set `eventTime.allowedLatenessMs` (default `0`). EI maintains an event-time watermark per trigger/correlation stream: old partial windows are retained until their expiry falls behind `maxObservedEventTime - allowedLatenessMs`. An event older than the watermark can still complete a retained compatible partial, but cannot seed a new stale window.
406
506
 
407
507
  Absence/deadline progression uses Event Intelligence processing time. This separation is explicit and tested.
408
508
 
@@ -420,7 +520,7 @@ It uses stable wake IDs, persisted delivery state, atomic claim leases, bounded
420
520
 
421
521
  A derived event says **what became true at a point in history**.
422
522
 
423
- v0.3 intentionally does not implement a mutable current-state/facts database.
523
+ Event Intelligence intentionally does not implement a mutable current-state/facts database.
424
524
 
425
525
  ## Security
426
526
 
@@ -432,7 +532,7 @@ In embedded mode, the host retains MCP authorization and credentials; Event Inte
432
532
 
433
533
  There are two separate MCP boundaries:
434
534
 
435
- - **event ingress**: host-owned, already-connected MCP clients exposing experimental Events, plus provider-native adapters;
535
+ - **event ingress**: host-owned, already-connected MCP clients exposing the experimental `io.modelcontextprotocol/events` extension, plus provider-native adapters; poll is native in the reference provider adapter, while push/webhook receivers remain host-owned delivery adapters;
436
536
  - **control plane**: optional standard MCP **stdio** server built on the official TypeScript SDK v2 and targeting protocol revision 2026-07-28.
437
537
 
438
538
  Registry identity:
@@ -445,7 +545,7 @@ io.github.sarooo17/event-intelligence
445
545
 
446
546
  ## Project status
447
547
 
448
- **v0.3.x reference implementation / experimental.**
548
+ **v0.5.x reference implementation / experimental.**
449
549
 
450
550
  The architecture is implemented and exercised end-to-end. Storage is now injectable and scoped, while the bundled JSONL backend remains a single-process reference implementation. Remaining work is primarily production database adapters/HA validation, scale benchmarks and upstream feedback.
451
551
 
package/SECURITY.md CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  ## Supported versions
4
4
 
5
- The public package is pre-1.0. Security fixes are supported on the current 0.3.x line.
5
+ The public package is pre-1.0. Security fixes are supported on the current 0.5.x line.
6
6
 
7
7
  | Version | Supported |
8
8
  | --- | --- |
9
- | 0.3.x | Yes |
10
- | < 0.3 | No |
9
+ | 0.5.x | Yes |
10
+ | < 0.5 | No |
11
11
 
12
12
  ## Reporting a vulnerability
13
13
 
@@ -26,7 +26,7 @@ Useful reports include:
26
26
 
27
27
  ## Security boundaries
28
28
 
29
- Event Intelligence 0.3.x is an experimental reference implementation with scoped multi-tenant host support. It is not a turnkey hardened hosted service.
29
+ Event Intelligence 0.5.x is an experimental reference implementation with scoped multi-tenant host support. It is not a turnkey hardened hosted service.
30
30
 
31
31
  Important defaults and constraints:
32
32
 
@@ -4,14 +4,14 @@ const args = process.argv.slice(2);
4
4
  const flags = new Set(args);
5
5
 
6
6
  if (flags.has('--version') || flags.has('-v')) {
7
- console.log('0.3.1');
7
+ console.log('0.5.0');
8
8
  process.exit(0);
9
9
  }
10
10
 
11
11
  if (flags.has('--help') || flags.has('-h')) {
12
- console.log(`MCP Event Intelligence v0.3
12
+ console.log(`MCP Event Intelligence v0.5
13
13
 
14
- Durable temporal event intelligence for sleeping agents.
14
+ MCP-native complex event processing for durable agents.
15
15
 
16
16
  Usage:
17
17
  mcp-event-intelligence Start the HTTP reference service
@@ -19,8 +19,14 @@ export declare class CompositeTriggerEngine {
19
19
  markFired(matchId: string, wakeId: string): Promise<TriggerMatchRecord>;
20
20
  markDerivedEmitted(matchId: string, derivedEventId: string): Promise<TriggerMatchRecord>;
21
21
  private ingestTimerEvent;
22
+ private patternPartitionKey;
23
+ private patternBufferId;
24
+ private patternDecisionRecord;
25
+ private applyPatternV2;
26
+ private evaluatePatternV2Buffer;
22
27
  private applyEvent;
23
28
  private finalizeEligible;
29
+ private branchMatch;
24
30
  private newMatch;
25
31
  private latestMatch;
26
32
  }