mcp-event-intelligence 0.5.0 → 0.6.1
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/CHANGELOG.md +53 -0
- package/README.md +31 -38
- package/SECURITY.md +4 -4
- package/bin/mcp-event-intelligence.mjs +2 -2
- package/dist/src/composite/engine.d.ts +11 -7
- package/dist/src/composite/engine.js +152 -414
- package/dist/src/composite/matching.d.ts +1 -5
- package/dist/src/composite/matching.js +0 -54
- package/dist/src/composite/runtimeSupport.js +10 -6
- package/dist/src/composite/store.d.ts +38 -4
- package/dist/src/composite/temporal.d.ts +0 -17
- package/dist/src/composite/temporal.js +0 -266
- package/dist/src/intelligenceProtocol/activationSchemas.d.ts +36 -3
- package/dist/src/intelligenceProtocol/activationSchemas.js +4 -3
- package/dist/src/intelligenceProtocol/index.d.ts +8 -12
- package/dist/src/intelligenceProtocol/index.js +4 -7
- package/dist/src/intelligenceProtocol/lifecycle.js +2 -10
- package/dist/src/intelligenceProtocol/operatorRegistry.d.ts +3 -270
- package/dist/src/intelligenceProtocol/operatorRegistry.js +5 -144
- package/dist/src/intelligenceProtocol/schemas.d.ts +0 -189
- package/dist/src/intelligenceProtocol/schemas.js +1 -97
- package/dist/src/intelligenceProtocol/triggerPlanSchemas.d.ts +5 -102
- package/dist/src/intelligenceProtocol/triggerPlanSchemas.js +2 -26
- package/dist/src/intelligenceProtocol/triggerSchemas.d.ts +14 -215
- package/dist/src/intelligenceProtocol/triggerSchemas.js +18 -191
- package/dist/src/intelligenceProtocol/version.d.ts +2 -2
- package/dist/src/intelligenceProtocol/version.js +2 -2
- package/dist/src/patternV2/evaluator.d.ts +9 -1
- package/dist/src/patternV2/evaluator.js +63 -4
- package/dist/src/semantic/types.d.ts +6 -0
- package/dist/src/semantic/typesafeJevEvaluator.d.ts +1 -0
- package/dist/src/semantic/typesafeJevEvaluator.js +6 -0
- package/package.json +5 -2
- package/scripts/host-integration.d.mts +48 -5
- package/scripts/host-integration.mjs +16 -4
- package/scripts/lib/activation-hydrator.mjs +12 -12
- package/scripts/lib/composite-event-consumer.mjs +8 -28
- package/scripts/lib/composite-wake-coordinator.mjs +19 -19
- package/scripts/lib/derived-contract-registry.mjs +4 -4
- package/scripts/lib/derived-event-coordinator.mjs +11 -22
- package/scripts/lib/local-event-intelligence-runtime.mjs +35 -3
- package/scripts/lib/mcp-events-client.mjs +36 -32
- package/scripts/lib/persistent-event-store.mjs +228 -61
- package/scripts/lib/store-capabilities.mjs +88 -0
- package/scripts/lib/store-conformance.mjs +152 -0
- package/scripts/lib/temporal-deadline-scheduler.mjs +3 -3
- package/scripts/lib/trigger-control-plane.mjs +52 -57
- package/scripts/lib/trigger-inspector.mjs +48 -160
- package/scripts/lib/trigger-planner.mjs +37 -126
- package/scripts/lib/wake-retry-scheduler.mjs +2 -19
- package/scripts/mcp-stdio-server.mjs +8 -8
- package/scripts/service.mjs +19 -138
- package/server.json +3 -3
- package/dist/src/intelligenceProtocol/invariants.d.ts +0 -3
- package/dist/src/intelligenceProtocol/invariants.js +0 -36
- package/dist/src/intelligenceProtocol/mapper.d.ts +0 -14
- package/dist/src/intelligenceProtocol/mapper.js +0 -28
- package/dist/src/patternV2/legacyCompiler.d.ts +0 -3
- package/dist/src/patternV2/legacyCompiler.js +0 -184
- package/scripts/lib/event-processor.mjs +0 -624
- package/scripts/lib/http-wake-deliverer.mjs +0 -31
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.1] - 2026-09-30
|
|
4
|
+
|
|
5
|
+
Patch release for post-merge v0.6 review findings.
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- migrate the advertised store conformance fixture to the v0.2 Pattern trigger schema;
|
|
10
|
+
- create a valid Pattern match before exercising wake-claim exclusion in store conformance;
|
|
11
|
+
- bind temporal match `completedAt` to the reached deadline for that candidate's signature instead of the latest deadline reached by the whole Pattern buffer;
|
|
12
|
+
- add regression coverage for multiple temporal candidates becoming due in one scheduler tick;
|
|
13
|
+
- harden release automation against npm registry propagation delay.
|
|
14
|
+
|
|
15
|
+
## [0.6.0] - 2026-09-30
|
|
16
|
+
|
|
17
|
+
Breaking architecture cleanup: Pattern AST is now the single trigger model.
|
|
18
|
+
|
|
19
|
+
### Single canonical execution model
|
|
20
|
+
|
|
21
|
+
- remove the pre-Pattern `expression + temporal + correlation` trigger representation;
|
|
22
|
+
- remove `semanticCorrelation` and route semantic reasoning exclusively through explicit Pattern `semantic` nodes;
|
|
23
|
+
- remove the legacy compiler and the parallel legacy execution path;
|
|
24
|
+
- remove the direct single-event `EventProcessor`/semantic-condition wake path;
|
|
25
|
+
- make persisted triggers `clauses + pattern + lifecycle/effect`;
|
|
26
|
+
- make `TriggerPlanInput.pattern` the only advanced authoring surface, with simple plans deterministically compiling to Pattern automatically;
|
|
27
|
+
- expose Pattern directly through activation and inspection surfaces.
|
|
28
|
+
|
|
29
|
+
### Protocol and runtime
|
|
30
|
+
|
|
31
|
+
- bump internal Event Intelligence protocol/schema to `0.2.0` / `ei.v0.2`;
|
|
32
|
+
- bump composite trigger schema to `trigger.v0.2`;
|
|
33
|
+
- Activation Envelope v2 carries canonical Pattern and partition state;
|
|
34
|
+
- rename match correlation state to partition state where it represents Pattern partition identity;
|
|
35
|
+
- keep Pattern wire grammar `version: "2"` as a schema version, not a second runtime architecture.
|
|
36
|
+
|
|
37
|
+
### Production hardening
|
|
38
|
+
|
|
39
|
+
- add reproducible Pattern conformance and benchmark evidence;
|
|
40
|
+
- define explicit shared-store capabilities and fail closed when a backend cannot guarantee required distributed semantics;
|
|
41
|
+
- add durable semantic-decision caching tied to evaluator identity, trigger revision and immutable candidate-event identity;
|
|
42
|
+
- make authoritative runtime/store reads Promise-compatible for real database adapters;
|
|
43
|
+
- align embedded host, MCP control-plane and inspector surfaces with async authoritative reads;
|
|
44
|
+
- keep the bundled JSONL store explicitly single-process and reference-grade.
|
|
45
|
+
|
|
46
|
+
### Documentation and release surface
|
|
47
|
+
|
|
48
|
+
- rewrite README, Quickstart, Architecture and Protocol around the single Pattern runtime;
|
|
49
|
+
- remove current documentation claims of legacy trigger compatibility;
|
|
50
|
+
- align CLI, npm package metadata and MCP Registry metadata on v0.6.0.
|
|
51
|
+
|
|
52
|
+
### Breaking change
|
|
53
|
+
|
|
54
|
+
Persisted pre-v0.6 trigger definitions are intentionally not accepted by the v0.6 runtime. Historical release notes remain unchanged as history; runtime compatibility code does not.
|
|
55
|
+
|
|
3
56
|
## [0.5.0] - 2026-09-30
|
|
4
57
|
|
|
5
58
|
### Pattern AST v2 / advanced CEP
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://github.com/sarooo17/event-intelligence/actions/workflows/ci.yml)
|
|
6
6
|
[](https://www.npmjs.com/package/mcp-event-intelligence)
|
|
7
|
-
[](https://registry.modelcontextprotocol.io/?q=io.github.sarooo17%2Fevent-intelligence)
|
|
8
8
|
[](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.
|
|
@@ -59,17 +59,23 @@ Event Intelligence enumerates the host registry automatically. GitHub, Gmail, pr
|
|
|
59
59
|
|
|
60
60
|
### Agent-first trigger flow
|
|
61
61
|
|
|
62
|
-
Agents do not need
|
|
62
|
+
Agents do not need a second DSL or a model-specific planner. The public authoring path is:
|
|
63
63
|
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
```text
|
|
65
|
+
event_sources_list
|
|
66
|
+
↓
|
|
67
|
+
trigger_language_describe (only when grammar discovery is useful)
|
|
68
|
+
↓
|
|
69
|
+
trigger_plan
|
|
70
|
+
↓
|
|
71
|
+
Pattern AST definition
|
|
72
|
+
↓
|
|
73
|
+
trigger_create
|
|
70
74
|
```
|
|
71
75
|
|
|
72
|
-
|
|
76
|
+
`planTrigger()` is deterministic: it resolves live event sources, fills `serverId`, validates subscription arguments and predicate/pattern field paths against advertised schemas, and returns the canonical trigger definition plus the required connection IDs.
|
|
77
|
+
|
|
78
|
+
For a simple condition, omitting `pattern` produces an `allOf` Pattern over the declared events:
|
|
73
79
|
|
|
74
80
|
```js
|
|
75
81
|
const plan = await ei.planTrigger({
|
|
@@ -80,7 +86,6 @@ const plan = await ei.planTrigger({
|
|
|
80
86
|
{ path: 'grand_total', op: 'gt', value: 10000 },
|
|
81
87
|
],
|
|
82
88
|
}],
|
|
83
|
-
match: 'all',
|
|
84
89
|
withinMs: 60 * 60 * 1000,
|
|
85
90
|
target: {
|
|
86
91
|
runtime: 'agent',
|
|
@@ -92,24 +97,13 @@ const plan = await ei.planTrigger({
|
|
|
92
97
|
'Check the submitted invoice for anomalies and report back in this conversation.',
|
|
93
98
|
},
|
|
94
99
|
});
|
|
95
|
-
|
|
96
|
-
await ei.triggerControl.createTrigger({
|
|
97
|
-
definition: plan.definition,
|
|
98
|
-
connectionIds: plan.connectionIds,
|
|
99
|
-
actor,
|
|
100
|
-
owner,
|
|
101
|
-
});
|
|
102
100
|
```
|
|
103
101
|
|
|
104
|
-
|
|
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.
|
|
102
|
+
For advanced CEP, author the same canonical `pattern` directly:
|
|
111
103
|
|
|
112
104
|
```js
|
|
105
|
+
const language = ei.describeTriggerLanguage({ category: 'pattern' });
|
|
106
|
+
|
|
113
107
|
const plan = await ei.planTrigger({
|
|
114
108
|
events: [
|
|
115
109
|
{ id: 'order', event: 'erpnext.sales_order.created' },
|
|
@@ -117,7 +111,7 @@ const plan = await ei.planTrigger({
|
|
|
117
111
|
{ id: 'ticket', event: 'support.ticket.created' },
|
|
118
112
|
],
|
|
119
113
|
withinMs: 30 * 60 * 1000,
|
|
120
|
-
|
|
114
|
+
pattern: {
|
|
121
115
|
version: '2',
|
|
122
116
|
partitionBy: [{
|
|
123
117
|
key: 'customer',
|
|
@@ -166,22 +160,21 @@ const plan = await ei.planTrigger({
|
|
|
166
160
|
});
|
|
167
161
|
```
|
|
168
162
|
|
|
169
|
-
Pattern AST
|
|
163
|
+
Pattern AST is the **single canonical trigger execution model**. It covers nested boolean and sequence patterns, contiguity, repeat/optional quantifiers, bounded negative patterns, calendar/absence/debounce/rate/distinct semantics, event-time windows, cross-event comparisons and arithmetic, aggregates, state transitions, partitioning, match-selection policy and deterministic derived measures.
|
|
170
164
|
|
|
171
|
-
The
|
|
165
|
+
The wire schema currently identifies this grammar as `version: "2"`; that is a schema version, not a second execution architecture.
|
|
172
166
|
|
|
173
|
-
|
|
167
|
+
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, cacheable and audit-recorded; ordinary CEP execution requires no model API.
|
|
174
168
|
|
|
175
169
|
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.
|
|
176
170
|
|
|
177
171
|
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:
|
|
178
172
|
|
|
179
173
|
```js
|
|
180
|
-
const activation = ei.hydrateWake(wakeId);
|
|
174
|
+
const activation = await ei.hydrateWake(wakeId);
|
|
181
175
|
```
|
|
182
176
|
|
|
183
|
-
The envelope contains the configured continuation,
|
|
184
|
-
|
|
177
|
+
The envelope contains the configured continuation, canonical Pattern, match state, and matched evidence. Event payloads are labeled as untrusted external signals and are included only according to the trigger's `continuation.contextPolicy`.
|
|
185
178
|
|
|
186
179
|
### Shared hosts, tenant isolation and storage
|
|
187
180
|
|
|
@@ -197,7 +190,7 @@ await tenant.triggerControl.createTrigger({
|
|
|
197
190
|
owner,
|
|
198
191
|
});
|
|
199
192
|
|
|
200
|
-
const acmeConnections = tenant.mcpStatus();
|
|
193
|
+
const acmeConnections = await tenant.mcpStatus();
|
|
201
194
|
```
|
|
202
195
|
|
|
203
196
|
The default reference store physically namespaces non-default scopes under separate persistent store partitions. Trigger IDs, match IDs, cursors, event sources, deadlines, derived events and wake delivery state are therefore resolved inside a scope rather than filtered out of a global result after the fact. The root host object is the trusted operator/control-plane capability; tenant code should receive a scoped view.
|
|
@@ -282,7 +275,7 @@ timezone normalization and deterministic occurrence IDs. The local factory in
|
|
|
282
275
|
this package should therefore be read as a typed convenience API, not as the
|
|
283
276
|
production ERP connector itself.
|
|
284
277
|
|
|
285
|
-
## What v0.
|
|
278
|
+
## What v0.6 implements
|
|
286
279
|
|
|
287
280
|
### Host-owned event sources
|
|
288
281
|
|
|
@@ -388,7 +381,7 @@ This project does **not** propose a replacement for MCP Events and does not clai
|
|
|
388
381
|
|
|
389
382
|
Event Intelligence has one optional AI boundary: **explicit semantic evaluation**.
|
|
390
383
|
|
|
391
|
-
- Pattern AST
|
|
384
|
+
- Pattern AST exposes a vendor-neutral `semantic` node as the only semantic condition form.
|
|
392
385
|
- `TYPESAFE_API_KEY` enables the bundled TypeSafe Jev evaluator when a trigger explicitly requests semantic evaluation.
|
|
393
386
|
- embedded hosts may inject a compatible `semanticEvaluator` instead.
|
|
394
387
|
- deterministic predicates, patterns, windows, aggregations, state changes, deadlines and derived measures never require an AI evaluator.
|
|
@@ -398,7 +391,7 @@ The agent/harness is already responsible for natural-language reasoning. It can
|
|
|
398
391
|
|
|
399
392
|
## Full-system acceptance
|
|
400
393
|
|
|
401
|
-
The v0.
|
|
394
|
+
The v0.6 acceptance suite verifies:
|
|
402
395
|
|
|
403
396
|
- host-owned MCP client → extension discovery → durable subscription → poll/push/webhook occurrence → composite match → in-process wake;
|
|
404
397
|
- provider-neutral events → composite match → derived event → derived composition → signed runtime wake;
|
|
@@ -446,13 +439,13 @@ The standalone service supports manual/provider-native event ingress. It does no
|
|
|
446
439
|
### Docker
|
|
447
440
|
|
|
448
441
|
```bash
|
|
449
|
-
docker build -t mcp-event-intelligence:0.
|
|
442
|
+
docker build -t mcp-event-intelligence:0.6.1 .
|
|
450
443
|
|
|
451
444
|
docker run --rm \
|
|
452
445
|
-p 3000:3000 \
|
|
453
446
|
-v mcp-event-intelligence-data:/data \
|
|
454
447
|
-e SERVICE_AUTH_TOKEN="$(openssl rand -hex 32)" \
|
|
455
|
-
mcp-event-intelligence:0.
|
|
448
|
+
mcp-event-intelligence:0.6.1
|
|
456
449
|
```
|
|
457
450
|
|
|
458
451
|
## Optional MCP control plane
|
|
@@ -545,7 +538,7 @@ io.github.sarooo17/event-intelligence
|
|
|
545
538
|
|
|
546
539
|
## Project status
|
|
547
540
|
|
|
548
|
-
**v0.
|
|
541
|
+
**v0.6.x reference implementation / experimental.**
|
|
549
542
|
|
|
550
543
|
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.
|
|
551
544
|
|
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.
|
|
5
|
+
The public package is pre-1.0. Security fixes are supported on the current 0.6.x line.
|
|
6
6
|
|
|
7
7
|
| Version | Supported |
|
|
8
8
|
| --- | --- |
|
|
9
|
-
| 0.
|
|
10
|
-
| < 0.
|
|
9
|
+
| 0.6.x | Yes |
|
|
10
|
+
| < 0.6 | 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.
|
|
29
|
+
Event Intelligence 0.6.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,12 +4,12 @@ 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.
|
|
7
|
+
console.log('0.6.1');
|
|
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.
|
|
12
|
+
console.log(`MCP Event Intelligence v0.6.1
|
|
13
13
|
|
|
14
14
|
MCP-native complex event processing for durable agents.
|
|
15
15
|
|
|
@@ -8,12 +8,18 @@ export interface CompositeIngestResult {
|
|
|
8
8
|
matched: boolean;
|
|
9
9
|
fired: boolean;
|
|
10
10
|
}
|
|
11
|
+
export interface CompositeTriggerEngineOptions {
|
|
12
|
+
workerId?: string;
|
|
13
|
+
partitionLeaseMs?: number;
|
|
14
|
+
}
|
|
11
15
|
export declare class CompositeTriggerEngine {
|
|
12
16
|
private readonly store;
|
|
13
17
|
private readonly evaluator;
|
|
14
18
|
private readonly now;
|
|
15
19
|
private readonly support;
|
|
16
|
-
|
|
20
|
+
private readonly workerId;
|
|
21
|
+
private readonly partitionLeaseMs;
|
|
22
|
+
constructor(store: CompositeTriggerStore & CompositeTriggerAudit, evaluator?: SemanticEvaluator | null, now?: () => Date, options?: CompositeTriggerEngineOptions);
|
|
17
23
|
register(definitionInput: unknown): Promise<CompositeTriggerDefinition>;
|
|
18
24
|
ingest(eventInput: unknown): Promise<CompositeIngestResult[]>;
|
|
19
25
|
markFired(matchId: string, wakeId: string): Promise<TriggerMatchRecord>;
|
|
@@ -22,11 +28,9 @@ export declare class CompositeTriggerEngine {
|
|
|
22
28
|
private patternPartitionKey;
|
|
23
29
|
private patternBufferId;
|
|
24
30
|
private patternDecisionRecord;
|
|
25
|
-
private
|
|
26
|
-
private
|
|
27
|
-
private
|
|
28
|
-
private
|
|
29
|
-
private branchMatch;
|
|
30
|
-
private newMatch;
|
|
31
|
+
private applyPattern;
|
|
32
|
+
private applyPatternWithPartition;
|
|
33
|
+
private candidateFitsTriggerWindow;
|
|
34
|
+
private evaluatePatternBuffer;
|
|
31
35
|
private latestMatch;
|
|
32
36
|
}
|