mcp-event-intelligence 0.8.1 → 0.9.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.
- package/CHANGELOG.md +36 -0
- package/README.md +1 -1
- package/conformance/README.md +59 -0
- package/conformance/fixtures/composite-trigger.valid.json +70 -0
- package/conformance/fixtures/event-lineage.valid.json +26 -0
- package/conformance/reference-host.mjs +145 -0
- package/package.json +15 -3
- package/scripts/embedded-host-kit.d.mts +67 -1
- package/scripts/embedded-host-kit.mjs +218 -11
- package/scripts/host-conformance.d.mts +75 -0
- package/scripts/host-conformance.mjs +238 -0
- package/scripts/host-integration.d.mts +5 -0
- package/scripts/host-integration.mjs +23 -4
- package/scripts/lib/composite-event-consumer.mjs +28 -0
- package/scripts/lib/composite-wake-coordinator.mjs +64 -0
- package/scripts/lib/local-event-intelligence-runtime.mjs +39 -0
- package/scripts/lib/mcp-events-client.mjs +36 -0
- package/scripts/lib/observability.d.mts +77 -0
- package/scripts/lib/observability.mjs +134 -0
- package/scripts/lib/temporal-deadline-scheduler.mjs +10 -0
- package/scripts/lib/trigger-control-plane.mjs +26 -0
- package/scripts/lib/wake-retry-scheduler.mjs +10 -0
- package/server.json +2 -2
|
@@ -152,10 +152,12 @@ export class TriggerControlPlane {
|
|
|
152
152
|
store,
|
|
153
153
|
triggerEngine,
|
|
154
154
|
now = () => new Date(),
|
|
155
|
+
observability = null,
|
|
155
156
|
}) {
|
|
156
157
|
this.store = store;
|
|
157
158
|
this.triggerEngine = triggerEngine;
|
|
158
159
|
this.now = now;
|
|
160
|
+
this.observability = observability;
|
|
159
161
|
this.contractRegistry = new DerivedContractRegistry({
|
|
160
162
|
store,
|
|
161
163
|
now,
|
|
@@ -1110,5 +1112,29 @@ export class TriggerControlPlane {
|
|
|
1110
1112
|
entityId,
|
|
1111
1113
|
details,
|
|
1112
1114
|
});
|
|
1115
|
+
|
|
1116
|
+
const event =
|
|
1117
|
+
kind === 'event_source.registered'
|
|
1118
|
+
? 'ei.source.registered'
|
|
1119
|
+
: kind.startsWith('trigger.')
|
|
1120
|
+
? `ei.${kind}`
|
|
1121
|
+
: null;
|
|
1122
|
+
if (event) {
|
|
1123
|
+
await this.observability?.emit({
|
|
1124
|
+
event,
|
|
1125
|
+
level: 'info',
|
|
1126
|
+
traceId,
|
|
1127
|
+
...(entityType === 'trigger' ? { triggerId: entityId } : {}),
|
|
1128
|
+
...(details?.connectionId ? { connectionId: details.connectionId } : {}),
|
|
1129
|
+
...(details?.serverId ? { serverId: details.serverId } : {}),
|
|
1130
|
+
...(details?.eventName ? { eventName: details.eventName } : {}),
|
|
1131
|
+
metadata: {
|
|
1132
|
+
entityType,
|
|
1133
|
+
...(details?.version ? { version: details.version } : {}),
|
|
1134
|
+
...(details?.fromVersion ? { fromVersion: details.fromVersion } : {}),
|
|
1135
|
+
...(details?.toVersion ? { toVersion: details.toVersion } : {}),
|
|
1136
|
+
},
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1113
1139
|
}
|
|
1114
1140
|
}
|
|
@@ -4,11 +4,13 @@ export class WakeRetryScheduler {
|
|
|
4
4
|
resolveCoordinator,
|
|
5
5
|
intervalMs = 1000,
|
|
6
6
|
now = () => new Date(),
|
|
7
|
+
observability = null,
|
|
7
8
|
}) {
|
|
8
9
|
this.store = store;
|
|
9
10
|
this.resolveCoordinator = resolveCoordinator;
|
|
10
11
|
this.intervalMs = Math.max(100, Number(intervalMs) || 1000);
|
|
11
12
|
this.now = now;
|
|
13
|
+
this.observability = observability;
|
|
12
14
|
this.timer = null;
|
|
13
15
|
this.running = false;
|
|
14
16
|
}
|
|
@@ -60,6 +62,14 @@ export class WakeRetryScheduler {
|
|
|
60
62
|
if (this.timer) return;
|
|
61
63
|
this.timer = setInterval(() => {
|
|
62
64
|
this.runDue().catch((error) => {
|
|
65
|
+
if (this.observability?.enabled) {
|
|
66
|
+
void this.observability.emit({
|
|
67
|
+
event: 'ei.scheduler.wake_retry_failed',
|
|
68
|
+
level: 'error',
|
|
69
|
+
error,
|
|
70
|
+
});
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
63
73
|
console.error(JSON.stringify({
|
|
64
74
|
message: 'wake_retry_scheduler_error',
|
|
65
75
|
error: error instanceof Error ? error.message : String(error),
|
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.sarooo17/event-intelligence",
|
|
4
4
|
"title": "MCP Event Intelligence",
|
|
5
5
|
"description": "MCP-native CEP for durable agents: event-time patterns, semantic predicates, derived events.",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.9.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"url": "https://github.com/sarooo17/event-intelligence",
|
|
9
9
|
"source": "github"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
15
15
|
"identifier": "mcp-event-intelligence",
|
|
16
|
-
"version": "0.
|
|
16
|
+
"version": "0.9.0",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
},
|