@griffin-app/griffin-plan-executor 0.1.13 → 0.1.14

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 (47) hide show
  1. package/README.md +14 -14
  2. package/dist/events/adapters/in-memory.test.js +22 -22
  3. package/dist/events/adapters/in-memory.test.js.map +1 -1
  4. package/dist/events/adapters/kinesis.test.js +13 -13
  5. package/dist/events/adapters/kinesis.test.js.map +1 -1
  6. package/dist/events/emitter.test.js +14 -14
  7. package/dist/events/emitter.test.js.map +1 -1
  8. package/dist/events/types.d.ts +9 -9
  9. package/dist/events/types.d.ts.map +1 -1
  10. package/dist/events/types.js +1 -1
  11. package/dist/executor.d.ts +2 -2
  12. package/dist/executor.d.ts.map +1 -1
  13. package/dist/executor.js +40 -40
  14. package/dist/executor.js.map +1 -1
  15. package/dist/executor.test.js +99 -99
  16. package/dist/executor.test.js.map +1 -1
  17. package/dist/index.d.ts +4 -4
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +2 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/secrets/index.d.ts +3 -3
  22. package/dist/secrets/index.d.ts.map +1 -1
  23. package/dist/secrets/index.js +3 -3
  24. package/dist/secrets/index.js.map +1 -1
  25. package/dist/secrets/resolver.d.ts +12 -12
  26. package/dist/secrets/resolver.d.ts.map +1 -1
  27. package/dist/secrets/resolver.js +19 -19
  28. package/dist/secrets/resolver.js.map +1 -1
  29. package/dist/secrets/secrets.test.js +54 -54
  30. package/dist/secrets/secrets.test.js.map +1 -1
  31. package/dist/secrets/types.d.ts +2 -2
  32. package/dist/types.d.ts +2 -2
  33. package/package.json +4 -4
  34. package/src/events/adapters/README.md +7 -7
  35. package/src/events/adapters/in-memory.test.ts +22 -22
  36. package/src/events/adapters/kinesis.test.ts +13 -13
  37. package/src/events/emitter.test.ts +14 -14
  38. package/src/events/types.ts +10 -10
  39. package/src/executor.test.ts +100 -100
  40. package/src/executor.ts +41 -41
  41. package/src/index.ts +7 -7
  42. package/src/secrets/index.ts +4 -4
  43. package/src/secrets/resolver.ts +24 -24
  44. package/src/secrets/secrets.test.ts +57 -57
  45. package/src/secrets/types.ts +2 -2
  46. package/src/{test-plan-types.ts → test-monitor-types.ts} +1 -1
  47. package/src/types.ts +2 -2
@@ -15,10 +15,10 @@ describe("KinesisAdapter", () => {
15
15
  eventId: `event-${seq}`,
16
16
  seq,
17
17
  timestamp: Date.now(),
18
- planId: "plan-1",
18
+ planId: "monitor-1",
19
19
  executionId,
20
20
  organizationId,
21
- planName: "Test Plan",
21
+ planName: "Test Monitor",
22
22
  planVersion: "1.0.0",
23
23
  nodeCount: 1,
24
24
  edgeCount: 1,
@@ -40,7 +40,7 @@ describe("KinesisAdapter", () => {
40
40
  streamName: "test-stream",
41
41
  });
42
42
 
43
- const events = [createMockEvent("PLAN_START", "exec-1", "org-1", 0)];
43
+ const events = [createMockEvent("MONITOR_START", "exec-1", "org-1", 0)];
44
44
 
45
45
  await adapter.publish(events);
46
46
 
@@ -83,7 +83,7 @@ describe("KinesisAdapter", () => {
83
83
 
84
84
  // Create 1250 events (should result in 3 batches: 500, 500, 250)
85
85
  const events = Array.from({ length: 1250 }, (_, i) =>
86
- createMockEvent("PLAN_START", "exec-1", "org-1", i),
86
+ createMockEvent("MONITOR_START", "exec-1", "org-1", i),
87
87
  );
88
88
 
89
89
  await adapter.publish(events);
@@ -111,7 +111,7 @@ describe("KinesisAdapter", () => {
111
111
  streamName: "test-stream",
112
112
  });
113
113
 
114
- const events = [createMockEvent("PLAN_START", "exec-123", "org-456", 0)];
114
+ const events = [createMockEvent("MONITOR_START", "exec-123", "org-456", 0)];
115
115
 
116
116
  await adapter.publish(events);
117
117
 
@@ -135,7 +135,7 @@ describe("KinesisAdapter", () => {
135
135
  partitionKeyStrategy: "organizationId",
136
136
  });
137
137
 
138
- const events = [createMockEvent("PLAN_START", "exec-123", "org-456", 0)];
138
+ const events = [createMockEvent("MONITOR_START", "exec-123", "org-456", 0)];
139
139
 
140
140
  await adapter.publish(events);
141
141
 
@@ -159,7 +159,7 @@ describe("KinesisAdapter", () => {
159
159
  partitionKeyStrategy: "composite",
160
160
  });
161
161
 
162
- const events = [createMockEvent("PLAN_START", "exec-123", "org-456", 0)];
162
+ const events = [createMockEvent("MONITOR_START", "exec-123", "org-456", 0)];
163
163
 
164
164
  await adapter.publish(events);
165
165
 
@@ -200,7 +200,7 @@ describe("KinesisAdapter", () => {
200
200
  retryDelayMs: 10, // Short delay for testing
201
201
  });
202
202
 
203
- const events = [createMockEvent("PLAN_START", "exec-1", "org-1", 0)];
203
+ const events = [createMockEvent("MONITOR_START", "exec-1", "org-1", 0)];
204
204
 
205
205
  await adapter.publish(events);
206
206
 
@@ -226,7 +226,7 @@ describe("KinesisAdapter", () => {
226
226
  retryDelayMs: 10,
227
227
  });
228
228
 
229
- const events = [createMockEvent("PLAN_START", "exec-1", "org-1", 0)];
229
+ const events = [createMockEvent("MONITOR_START", "exec-1", "org-1", 0)];
230
230
 
231
231
  // Should not throw, but log errors
232
232
  await adapter.publish(events);
@@ -258,7 +258,7 @@ describe("KinesisAdapter", () => {
258
258
  retryDelayMs: 10,
259
259
  });
260
260
 
261
- const events = [createMockEvent("PLAN_START", "exec-1", "org-1", 0)];
261
+ const events = [createMockEvent("MONITOR_START", "exec-1", "org-1", 0)];
262
262
 
263
263
  await adapter.publish(events);
264
264
 
@@ -279,7 +279,7 @@ describe("KinesisAdapter", () => {
279
279
  retryDelayMs: 10,
280
280
  });
281
281
 
282
- const events = [createMockEvent("PLAN_START", "exec-1", "org-1", 0)];
282
+ const events = [createMockEvent("MONITOR_START", "exec-1", "org-1", 0)];
283
283
 
284
284
  await expect(adapter.publish(events)).rejects.toThrow("Network error");
285
285
  expect(mockSend).toHaveBeenCalledTimes(3); // Initial + 2 retries
@@ -302,7 +302,7 @@ describe("KinesisAdapter", () => {
302
302
  streamName: "test-stream",
303
303
  });
304
304
 
305
- const event = createMockEvent("PLAN_START", "exec-1", "org-1", 0);
305
+ const event = createMockEvent("MONITOR_START", "exec-1", "org-1", 0);
306
306
  await adapter.publish([event]);
307
307
 
308
308
  const records = mockSend.mock.calls[0][0].input.Records;
@@ -313,7 +313,7 @@ describe("KinesisAdapter", () => {
313
313
  const json = decoder.decode(data);
314
314
  const parsed = JSON.parse(json);
315
315
 
316
- expect(parsed.type).toBe("PLAN_START");
316
+ expect(parsed.type).toBe("MONITOR_START");
317
317
  expect(parsed.executionId).toBe("exec-1");
318
318
  expect(parsed.organizationId).toBe("org-1");
319
319
  });
@@ -18,14 +18,14 @@ describe("LocalEventEmitter", () => {
18
18
  emitter.subscribe((event) => events.push(event));
19
19
 
20
20
  const testEvent: ExecutionEvent = {
21
- type: "PLAN_START",
21
+ type: "MONITOR_START",
22
22
  eventId: "123",
23
23
  seq: 0,
24
24
  timestamp: Date.now(),
25
25
  organizationId: "test-org",
26
- planId: "plan-1",
26
+ planId: "monitor-1",
27
27
  executionId: "exec-1",
28
- planName: "Test Plan",
28
+ planName: "Test Monitor",
29
29
  planVersion: "1.0",
30
30
  nodeCount: 2,
31
31
  edgeCount: 1,
@@ -49,7 +49,7 @@ describe("LocalEventEmitter", () => {
49
49
  eventId: "456",
50
50
  seq: 1,
51
51
  timestamp: Date.now(),
52
- planId: "plan-1",
52
+ planId: "monitor-1",
53
53
  executionId: "exec-1",
54
54
  organizationId: "test-org",
55
55
  nodeId: "node-1",
@@ -73,7 +73,7 @@ describe("LocalEventEmitter", () => {
73
73
  eventId: "789",
74
74
  seq: 2,
75
75
  timestamp: Date.now(),
76
- planId: "plan-1",
76
+ planId: "monitor-1",
77
77
  executionId: "exec-1",
78
78
  organizationId: "test-org",
79
79
  nodeId: "node-1",
@@ -103,11 +103,11 @@ describe("LocalEventEmitter", () => {
103
103
  emitter.subscribe((event) => events.push(event));
104
104
 
105
105
  const testEvent: ExecutionEvent = {
106
- type: "PLAN_END",
106
+ type: "MONITOR_END",
107
107
  eventId: "abc",
108
108
  seq: 3,
109
109
  timestamp: Date.now(),
110
- planId: "plan-1",
110
+ planId: "monitor-1",
111
111
  executionId: "exec-1",
112
112
  organizationId: "test-org",
113
113
  success: true,
@@ -155,7 +155,7 @@ describe("DurableEventEmitter", () => {
155
155
  eventId: "1",
156
156
  seq: 0,
157
157
  timestamp: Date.now(),
158
- planId: "plan-1",
158
+ planId: "monitor-1",
159
159
  executionId: "exec-1",
160
160
  organizationId: "test-org",
161
161
  nodeId: "node-1",
@@ -167,7 +167,7 @@ describe("DurableEventEmitter", () => {
167
167
  eventId: "2",
168
168
  seq: 1,
169
169
  timestamp: Date.now(),
170
- planId: "plan-1",
170
+ planId: "monitor-1",
171
171
  executionId: "exec-1",
172
172
  organizationId: "test-org",
173
173
  nodeId: "node-2",
@@ -179,7 +179,7 @@ describe("DurableEventEmitter", () => {
179
179
  eventId: "3",
180
180
  seq: 2,
181
181
  timestamp: Date.now(),
182
- planId: "plan-1",
182
+ planId: "monitor-1",
183
183
  executionId: "exec-1",
184
184
  organizationId: "test-org",
185
185
  nodeId: "node-3",
@@ -210,7 +210,7 @@ describe("DurableEventEmitter", () => {
210
210
  eventId: "1",
211
211
  seq: 0,
212
212
  timestamp: Date.now(),
213
- planId: "plan-1",
213
+ planId: "monitor-1",
214
214
  executionId: "exec-1",
215
215
  organizationId: "test-org",
216
216
  nodeId: "node-1",
@@ -239,7 +239,7 @@ describe("DurableEventEmitter", () => {
239
239
  eventId: "1",
240
240
  seq: 0,
241
241
  timestamp: Date.now(),
242
- planId: "plan-1",
242
+ planId: "monitor-1",
243
243
  executionId: "exec-1",
244
244
  organizationId: "test-org",
245
245
  nodeId: "node-1",
@@ -273,7 +273,7 @@ describe("DurableEventEmitter", () => {
273
273
  eventId: "1",
274
274
  seq: 0,
275
275
  timestamp: Date.now(),
276
- planId: "plan-1",
276
+ planId: "monitor-1",
277
277
  executionId: "exec-1",
278
278
  organizationId: "test-org",
279
279
  errorName: "TestError",
@@ -308,7 +308,7 @@ describe("DurableEventEmitter", () => {
308
308
  eventId: "1",
309
309
  seq: 0,
310
310
  timestamp: Date.now(),
311
- planId: "plan-1",
311
+ planId: "monitor-1",
312
312
  executionId: "exec-1",
313
313
  organizationId: "test-org",
314
314
  nodeId: "wait-1",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Event types for test plan execution.
2
+ * Event types for test monitor execution.
3
3
  *
4
4
  * All events are JSON-serializable for compatibility with various event buses.
5
5
  * Events include stable identifiers (executionId, eventId) and monotonic sequence
@@ -15,26 +15,26 @@ export interface BaseEvent {
15
15
  seq: number;
16
16
  /** Unix timestamp in milliseconds */
17
17
  timestamp: number;
18
- /** ID of the test plan being executed */
18
+ /** ID of the test monitor being executed */
19
19
  planId: string;
20
20
  /** Unique identifier for this execution run */
21
21
  executionId: string;
22
22
 
23
- /** ID of the organization that the plan belongs to */
23
+ /** ID of the organization that the monitor belongs to */
24
24
  organizationId: string;
25
25
  }
26
26
 
27
- /** Plan-level events */
28
- export interface PlanStartEvent extends BaseEvent {
29
- type: "PLAN_START";
27
+ /** Monitor-level events */
28
+ export interface MonitorStartEvent extends BaseEvent {
29
+ type: "MONITOR_START";
30
30
  planName: string;
31
31
  planVersion: string;
32
32
  nodeCount: number;
33
33
  edgeCount: number;
34
34
  }
35
35
 
36
- export interface PlanEndEvent extends BaseEvent {
37
- type: "PLAN_END";
36
+ export interface MonitorEndEvent extends BaseEvent {
37
+ type: "MONITOR_END";
38
38
  success: boolean;
39
39
  totalDuration_ms: number;
40
40
  nodeResultCount: number;
@@ -123,8 +123,8 @@ export interface ErrorEvent extends BaseEvent {
123
123
 
124
124
  /** Union type of all execution events */
125
125
  export type ExecutionEvent =
126
- | PlanStartEvent
127
- | PlanEndEvent
126
+ | MonitorStartEvent
127
+ | MonitorEndEvent
128
128
  | NodeStartEvent
129
129
  | NodeEndEvent
130
130
  | HttpRequestEvent