mcp-event-intelligence 0.4.0 → 0.6.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 +100 -0
- package/README.md +107 -26
- package/SECURITY.md +4 -4
- package/bin/mcp-event-intelligence.mjs +3 -3
- package/dist/src/composite/engine.d.ts +14 -4
- package/dist/src/composite/engine.js +533 -208
- package/dist/src/composite/matching.d.ts +1 -5
- package/dist/src/composite/matching.js +45 -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 +38 -3
- package/dist/src/intelligenceProtocol/activationSchemas.js +5 -3
- package/dist/src/intelligenceProtocol/index.d.ts +12 -9
- package/dist/src/intelligenceProtocol/index.js +6 -5
- package/dist/src/intelligenceProtocol/lifecycle.js +2 -10
- package/dist/src/intelligenceProtocol/operatorRegistry.d.ts +300 -0
- package/dist/src/intelligenceProtocol/operatorRegistry.js +338 -0
- package/dist/src/intelligenceProtocol/patternV2Schemas.d.ts +188 -0
- package/dist/src/intelligenceProtocol/patternV2Schemas.js +801 -0
- package/dist/src/intelligenceProtocol/schemas.d.ts +4 -189
- package/dist/src/intelligenceProtocol/schemas.js +3 -97
- package/dist/src/intelligenceProtocol/triggerPlanSchemas.d.ts +114 -38
- package/dist/src/intelligenceProtocol/triggerPlanSchemas.js +27 -18
- package/dist/src/intelligenceProtocol/triggerSchemas.d.ts +268 -213
- package/dist/src/intelligenceProtocol/triggerSchemas.js +155 -169
- package/dist/src/intelligenceProtocol/version.d.ts +2 -2
- package/dist/src/intelligenceProtocol/version.js +2 -2
- package/dist/src/mcpEvents/consumer.d.ts +1 -0
- package/dist/src/mcpEvents/consumer.js +1 -0
- package/dist/src/patternV2/evaluator.d.ts +51 -0
- package/dist/src/patternV2/evaluator.js +986 -0
- 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 +9 -3
- package/scripts/host-integration.d.mts +54 -4
- package/scripts/host-integration.mjs +25 -4
- package/scripts/lib/activation-hydrator.mjs +13 -12
- package/scripts/lib/composite-event-consumer.mjs +10 -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 +69 -6
- package/scripts/lib/local-event-intelligence-runtime.mjs +35 -3
- package/scripts/lib/mcp-events-client.mjs +97 -55
- package/scripts/lib/mcp-events-compatibility.mjs +54 -0
- package/scripts/lib/persistent-event-store.mjs +228 -61
- package/scripts/lib/store-capabilities.mjs +88 -0
- package/scripts/lib/store-conformance.mjs +127 -0
- package/scripts/lib/temporal-deadline-scheduler.mjs +3 -3
- package/scripts/lib/trigger-control-plane.mjs +202 -53
- package/scripts/lib/trigger-inspector.mjs +50 -147
- package/scripts/lib/trigger-planner.mjs +141 -52
- package/scripts/lib/wake-retry-scheduler.mjs +2 -19
- package/scripts/mcp-stdio-server.mjs +46 -61
- package/scripts/service.mjs +19 -138
- package/server.json +4 -4
- 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/scripts/lib/event-processor.mjs +0 -624
- package/scripts/lib/http-wake-deliverer.mjs +0 -31
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { RuntimeTargetSchema } from './schemas.js';
|
|
3
|
-
import {
|
|
3
|
+
import { PatternAstV2DefinitionSchema, } from './patternV2Schemas.js';
|
|
4
|
+
import { ContinuationContractSchema, StructuredPredicateSchema, } from './triggerSchemas.js';
|
|
4
5
|
const Id = z.string().min(1).max(200);
|
|
5
6
|
export const TriggerPlanEventSchema = z.object({
|
|
6
7
|
id: Id.optional(),
|
|
@@ -9,22 +10,18 @@ export const TriggerPlanEventSchema = z.object({
|
|
|
9
10
|
arguments: z.record(z.string(), z.unknown()).default({}),
|
|
10
11
|
where: z.array(StructuredPredicateSchema).default([]),
|
|
11
12
|
}).strict();
|
|
12
|
-
export const TriggerPlanMatchSchema = z.union([
|
|
13
|
-
z.enum(['all', 'any', 'sequence']),
|
|
14
|
-
z.object({
|
|
15
|
-
kind: z.literal('count'),
|
|
16
|
-
eventId: Id,
|
|
17
|
-
atLeast: z.number().int().min(1),
|
|
18
|
-
}).strict(),
|
|
19
|
-
]);
|
|
20
13
|
export const TriggerPlanInputSchema = z.object({
|
|
21
14
|
triggerId: Id.optional(),
|
|
22
15
|
version: z.string().min(1).default('1'),
|
|
23
16
|
description: z.string().max(500).optional(),
|
|
24
17
|
events: z.array(TriggerPlanEventSchema).min(1),
|
|
25
|
-
|
|
18
|
+
pattern: PatternAstV2DefinitionSchema.optional(),
|
|
26
19
|
withinMs: z.number().int().positive().max(1000 * 60 * 60 * 24 * 30)
|
|
27
20
|
.default(60 * 60 * 1000),
|
|
21
|
+
eventTime: z.object({
|
|
22
|
+
allowedLatenessMs: z.number().int().nonnegative()
|
|
23
|
+
.max(1000 * 60 * 60 * 24 * 30),
|
|
24
|
+
}).strict().optional(),
|
|
28
25
|
lifecycle: z.object({
|
|
29
26
|
oneShot: z.boolean().optional(),
|
|
30
27
|
maxFirings: z.number().int().min(1).optional(),
|
|
@@ -33,14 +30,26 @@ export const TriggerPlanInputSchema = z.object({
|
|
|
33
30
|
leaseUntil: z.string().datetime({ offset: true }).optional(),
|
|
34
31
|
completeOnGoal: z.boolean().optional(),
|
|
35
32
|
}).strict().optional(),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
conditionOnly: z.boolean().default(false),
|
|
34
|
+
target: RuntimeTargetSchema.optional(),
|
|
35
|
+
continuation: ContinuationContractSchema.optional(),
|
|
36
|
+
}).strict().superRefine((value, ctx) => {
|
|
37
|
+
if (value.conditionOnly) {
|
|
38
|
+
if (value.target || value.continuation) {
|
|
39
|
+
ctx.addIssue({
|
|
40
|
+
code: 'custom',
|
|
41
|
+
message: 'conditionOnly plans cannot declare target or continuation',
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (!value.target || !value.continuation) {
|
|
47
|
+
ctx.addIssue({
|
|
48
|
+
code: 'custom',
|
|
49
|
+
message: 'Agent activation plans require target and continuation',
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
});
|
|
44
53
|
export function parseTriggerPlanInput(value) {
|
|
45
54
|
return TriggerPlanInputSchema.parse(value);
|
|
46
55
|
}
|