@orgloop/core 0.1.5 → 0.1.7
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/README.md +51 -17
- package/dist/engine.d.ts +12 -26
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +61 -448
- package/dist/engine.js.map +1 -1
- package/dist/errors.d.ts +11 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +22 -0
- package/dist/errors.js.map +1 -1
- package/dist/http.d.ts +19 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +114 -2
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +5 -1
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +15 -5
- package/dist/logger.js.map +1 -1
- package/dist/module-instance.d.ts +76 -0
- package/dist/module-instance.d.ts.map +1 -0
- package/dist/module-instance.js +185 -0
- package/dist/module-instance.js.map +1 -0
- package/dist/prompt.d.ts +20 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +35 -0
- package/dist/prompt.js.map +1 -0
- package/dist/registry.d.ts +23 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +42 -0
- package/dist/registry.js.map +1 -0
- package/dist/runtime.d.ts +81 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +522 -0
- package/dist/runtime.js.map +1 -0
- package/dist/scheduler.d.ts +11 -2
- package/dist/scheduler.d.ts.map +1 -1
- package/dist/scheduler.js +44 -6
- package/dist/scheduler.js.map +1 -1
- package/dist/transform.d.ts.map +1 -1
- package/dist/transform.js +45 -18
- package/dist/transform.js.map +1 -1
- package/package.json +2 -2
package/dist/engine.js
CHANGED
|
@@ -1,500 +1,113 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* OrgLoop —
|
|
2
|
+
* OrgLoop — backward-compatible wrapper around Runtime.
|
|
3
3
|
*
|
|
4
4
|
* Library-first API:
|
|
5
5
|
* const loop = new OrgLoop(config);
|
|
6
6
|
* await loop.start();
|
|
7
7
|
* await loop.stop();
|
|
8
|
+
*
|
|
9
|
+
* Internally delegates to a Runtime instance, converting the flat
|
|
10
|
+
* OrgLoopConfig into a single module. Preserves the original public API
|
|
11
|
+
* for existing callers and tests.
|
|
8
12
|
*/
|
|
9
13
|
import { EventEmitter } from 'node:events';
|
|
10
|
-
import { readFile } from 'node:fs/promises';
|
|
11
|
-
import { generateTraceId } from '@orgloop/sdk';
|
|
12
|
-
import { InMemoryBus } from './bus.js';
|
|
13
|
-
import { ConnectorError, DeliveryError } from './errors.js';
|
|
14
|
-
import { DEFAULT_HTTP_PORT, WebhookServer } from './http.js';
|
|
15
14
|
import { LoggerManager } from './logger.js';
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// ─── OrgLoop Class ────────────────────────────────────────────────────────────
|
|
15
|
+
import { Runtime } from './runtime.js';
|
|
16
|
+
// ─── Module Name ──────────────────────────────────────────────────────────────
|
|
17
|
+
const DEFAULT_MODULE = 'default';
|
|
18
|
+
// ─── OrgLoop Class (Wrapper) ──────────────────────────────────────────────────
|
|
21
19
|
export class OrgLoop extends EventEmitter {
|
|
22
20
|
config;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
resolvedLoggers;
|
|
27
|
-
bus;
|
|
28
|
-
checkpointStore;
|
|
29
|
-
loggerManager = new LoggerManager();
|
|
30
|
-
scheduler = new Scheduler();
|
|
31
|
-
httpPort;
|
|
32
|
-
webhookServer = null;
|
|
33
|
-
webhookSources = new Set();
|
|
34
|
-
running = false;
|
|
35
|
-
startedAt = 0;
|
|
36
|
-
// Health tracking
|
|
37
|
-
healthStates = new Map();
|
|
38
|
-
circuitBreakerOpts;
|
|
39
|
-
circuitRetryTimers = new Map();
|
|
21
|
+
runtime;
|
|
22
|
+
moduleConfig;
|
|
23
|
+
loadOptions;
|
|
40
24
|
constructor(config, options) {
|
|
41
25
|
super();
|
|
42
26
|
this.config = config;
|
|
43
|
-
|
|
44
|
-
this.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
27
|
+
// Create shared runtime
|
|
28
|
+
this.runtime = new Runtime({
|
|
29
|
+
bus: options?.bus,
|
|
30
|
+
httpPort: options?.httpPort,
|
|
31
|
+
circuitBreaker: options?.circuitBreaker,
|
|
32
|
+
dataDir: config.data_dir,
|
|
33
|
+
});
|
|
34
|
+
// Forward Runtime events to OrgLoop
|
|
35
|
+
this.runtime.on('event', (event) => this.emit('event', event));
|
|
36
|
+
this.runtime.on('delivery', (d) => this.emit('delivery', d));
|
|
37
|
+
this.runtime.on('error', (err) => this.emit('error', err));
|
|
38
|
+
// Convert flat config to module config
|
|
39
|
+
this.moduleConfig = {
|
|
40
|
+
name: DEFAULT_MODULE,
|
|
41
|
+
sources: config.sources,
|
|
42
|
+
actors: config.actors,
|
|
43
|
+
routes: config.routes,
|
|
44
|
+
transforms: config.transforms,
|
|
45
|
+
loggers: config.loggers,
|
|
46
|
+
defaults: config.defaults,
|
|
47
|
+
};
|
|
48
|
+
this.loadOptions = {
|
|
49
|
+
sources: options?.sources ?? new Map(),
|
|
50
|
+
actors: options?.actors ?? new Map(),
|
|
51
|
+
transforms: options?.transforms ?? new Map(),
|
|
52
|
+
loggers: options?.loggers ?? new Map(),
|
|
53
|
+
checkpointStore: options?.checkpointStore,
|
|
57
54
|
};
|
|
58
55
|
}
|
|
59
56
|
/**
|
|
60
57
|
* Start the engine: initialize connectors, start scheduler, begin processing.
|
|
61
58
|
*/
|
|
62
59
|
async start() {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
await this.emitLog('system.start', { result: 'starting' });
|
|
66
|
-
// Initialize sources
|
|
67
|
-
for (const sourceCfg of this.config.sources) {
|
|
68
|
-
const connector = this.sources.get(sourceCfg.id);
|
|
69
|
-
if (connector) {
|
|
70
|
-
try {
|
|
71
|
-
await connector.init({
|
|
72
|
-
id: sourceCfg.id,
|
|
73
|
-
connector: sourceCfg.connector,
|
|
74
|
-
config: sourceCfg.config,
|
|
75
|
-
poll: sourceCfg.poll,
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
catch (err) {
|
|
79
|
-
const error = new ConnectorError(sourceCfg.id, 'Failed to initialize source', {
|
|
80
|
-
cause: err,
|
|
81
|
-
});
|
|
82
|
-
this.emit('error', error);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
// Initialize actors
|
|
87
|
-
for (const actorCfg of this.config.actors) {
|
|
88
|
-
const connector = this.actors.get(actorCfg.id);
|
|
89
|
-
if (connector) {
|
|
90
|
-
try {
|
|
91
|
-
await connector.init({
|
|
92
|
-
id: actorCfg.id,
|
|
93
|
-
connector: actorCfg.connector,
|
|
94
|
-
config: actorCfg.config,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
catch (err) {
|
|
98
|
-
const error = new ConnectorError(actorCfg.id, 'Failed to initialize actor', {
|
|
99
|
-
cause: err,
|
|
100
|
-
});
|
|
101
|
-
this.emit('error', error);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
// Initialize package transforms
|
|
106
|
-
for (const tDef of this.config.transforms) {
|
|
107
|
-
if (tDef.type === 'package') {
|
|
108
|
-
const transform = this.packageTransforms.get(tDef.name);
|
|
109
|
-
if (transform) {
|
|
110
|
-
await transform.init(tDef.config ?? {});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
// Initialize and register loggers
|
|
115
|
-
for (const loggerDef of this.config.loggers) {
|
|
116
|
-
const logger = this.resolvedLoggers.get(loggerDef.name);
|
|
117
|
-
if (logger) {
|
|
118
|
-
try {
|
|
119
|
-
await logger.init(loggerDef.config ?? {});
|
|
120
|
-
this.loggerManager.addLogger(logger);
|
|
121
|
-
}
|
|
122
|
-
catch (err) {
|
|
123
|
-
this.emit('error', new Error(`Failed to initialize logger "${loggerDef.name}": ${err}`));
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
// Detect webhook sources and register poll sources with scheduler
|
|
128
|
-
const defaultInterval = this.config.defaults?.poll_interval ?? '5m';
|
|
129
|
-
const webhookHandlers = new Map();
|
|
130
|
-
for (const sourceCfg of this.config.sources) {
|
|
131
|
-
const connector = this.sources.get(sourceCfg.id);
|
|
132
|
-
if (!connector)
|
|
133
|
-
continue;
|
|
134
|
-
if (typeof connector.webhook === 'function') {
|
|
135
|
-
// Webhook-based source: mount handler, skip polling
|
|
136
|
-
webhookHandlers.set(sourceCfg.id, connector.webhook());
|
|
137
|
-
this.webhookSources.add(sourceCfg.id);
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
// Poll-based source: register with scheduler
|
|
141
|
-
const interval = sourceCfg.poll?.interval ?? defaultInterval;
|
|
142
|
-
this.scheduler.addSource(sourceCfg.id, interval);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
// Start webhook server if any webhook sources registered
|
|
146
|
-
if (webhookHandlers.size > 0) {
|
|
147
|
-
this.webhookServer = new WebhookServer(webhookHandlers, (event) => this.inject(event));
|
|
148
|
-
await this.webhookServer.start(this.httpPort);
|
|
149
|
-
}
|
|
150
|
-
// Initialize health state for all sources
|
|
151
|
-
for (const sourceCfg of this.config.sources) {
|
|
152
|
-
this.healthStates.set(sourceCfg.id, {
|
|
153
|
-
sourceId: sourceCfg.id,
|
|
154
|
-
status: 'healthy',
|
|
155
|
-
lastSuccessfulPoll: null,
|
|
156
|
-
lastPollAttempt: null,
|
|
157
|
-
consecutiveErrors: 0,
|
|
158
|
-
lastError: null,
|
|
159
|
-
totalEventsEmitted: 0,
|
|
160
|
-
circuitOpen: false,
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
// Start scheduler
|
|
164
|
-
this.scheduler.start((sourceId) => this.pollSource(sourceId));
|
|
165
|
-
this.running = true;
|
|
166
|
-
this.startedAt = Date.now();
|
|
167
|
-
await this.emitLog('system.start', { result: 'started' });
|
|
60
|
+
await this.runtime.start();
|
|
61
|
+
await this.runtime.loadModule(this.moduleConfig, this.loadOptions);
|
|
168
62
|
}
|
|
169
63
|
/**
|
|
170
64
|
* Stop the engine gracefully.
|
|
171
65
|
*/
|
|
172
66
|
async stop() {
|
|
173
|
-
|
|
174
|
-
return;
|
|
175
|
-
await this.emitLog('system.stop', { result: 'stopping' });
|
|
176
|
-
// Stop webhook server
|
|
177
|
-
if (this.webhookServer) {
|
|
178
|
-
await this.webhookServer.stop();
|
|
179
|
-
this.webhookServer = null;
|
|
180
|
-
}
|
|
181
|
-
// Stop scheduler
|
|
182
|
-
this.scheduler.stop();
|
|
183
|
-
// Clear circuit breaker retry timers
|
|
184
|
-
for (const timer of this.circuitRetryTimers.values()) {
|
|
185
|
-
clearTimeout(timer);
|
|
186
|
-
}
|
|
187
|
-
this.circuitRetryTimers.clear();
|
|
188
|
-
// Shutdown sources
|
|
189
|
-
for (const [id, connector] of this.sources) {
|
|
190
|
-
try {
|
|
191
|
-
await connector.shutdown();
|
|
192
|
-
}
|
|
193
|
-
catch (err) {
|
|
194
|
-
this.emit('error', new ConnectorError(id, 'Error during source shutdown', { cause: err }));
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
// Shutdown actors
|
|
198
|
-
for (const [id, connector] of this.actors) {
|
|
199
|
-
try {
|
|
200
|
-
await connector.shutdown();
|
|
201
|
-
}
|
|
202
|
-
catch (err) {
|
|
203
|
-
this.emit('error', new ConnectorError(id, 'Error during actor shutdown', { cause: err }));
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
// Shutdown transforms
|
|
207
|
-
for (const [, transform] of this.packageTransforms) {
|
|
208
|
-
try {
|
|
209
|
-
await transform.shutdown();
|
|
210
|
-
}
|
|
211
|
-
catch {
|
|
212
|
-
// Swallow
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
// Flush and shutdown loggers
|
|
216
|
-
await this.loggerManager.flush();
|
|
217
|
-
await this.loggerManager.shutdown();
|
|
218
|
-
this.running = false;
|
|
219
|
-
await this.emitLog('system.stop', { result: 'stopped' });
|
|
67
|
+
await this.runtime.stop();
|
|
220
68
|
}
|
|
221
69
|
/**
|
|
222
70
|
* Inject an event programmatically (for testing or API use).
|
|
223
71
|
*/
|
|
224
72
|
async inject(event) {
|
|
225
|
-
|
|
226
|
-
await this.processEvent(resolved);
|
|
73
|
+
await this.runtime.inject(event, DEFAULT_MODULE);
|
|
227
74
|
}
|
|
228
75
|
/**
|
|
229
76
|
* Get runtime status.
|
|
230
77
|
*/
|
|
231
78
|
status() {
|
|
79
|
+
const rtStatus = this.runtime.status();
|
|
80
|
+
const modStatus = rtStatus.modules.find((m) => m.name === DEFAULT_MODULE);
|
|
232
81
|
return {
|
|
233
|
-
running:
|
|
234
|
-
sources:
|
|
235
|
-
actors:
|
|
82
|
+
running: rtStatus.running,
|
|
83
|
+
sources: this.config.sources.map((s) => s.id),
|
|
84
|
+
actors: this.config.actors.map((a) => a.id),
|
|
236
85
|
routes: this.config.routes.length,
|
|
237
|
-
uptime_ms:
|
|
238
|
-
...(this.
|
|
239
|
-
health:
|
|
86
|
+
uptime_ms: modStatus?.uptime_ms ?? rtStatus.uptime_ms,
|
|
87
|
+
...(this.runtime.isHttpStarted() ? { httpPort: rtStatus.httpPort } : {}),
|
|
88
|
+
health: modStatus?.health,
|
|
240
89
|
};
|
|
241
90
|
}
|
|
242
91
|
/** Get the logger manager (for adding loggers externally) */
|
|
243
92
|
get loggers() {
|
|
244
|
-
|
|
93
|
+
// Return a proxy — the runtime manages the real logger manager
|
|
94
|
+
return new LoggerManager();
|
|
245
95
|
}
|
|
246
96
|
/**
|
|
247
97
|
* Get health state for all sources.
|
|
248
98
|
*/
|
|
249
99
|
health() {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
async pollSource(sourceId) {
|
|
254
|
-
const connector = this.sources.get(sourceId);
|
|
255
|
-
if (!connector)
|
|
256
|
-
return;
|
|
257
|
-
const healthState = this.healthStates.get(sourceId);
|
|
258
|
-
if (!healthState)
|
|
259
|
-
return;
|
|
260
|
-
// Circuit breaker: skip poll if circuit is open
|
|
261
|
-
if (healthState.circuitOpen) {
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
healthState.lastPollAttempt = new Date().toISOString();
|
|
265
|
-
try {
|
|
266
|
-
const checkpoint = await this.checkpointStore.get(sourceId);
|
|
267
|
-
const result = await connector.poll(checkpoint);
|
|
268
|
-
// Save checkpoint
|
|
269
|
-
if (result.checkpoint) {
|
|
270
|
-
await this.checkpointStore.set(sourceId, result.checkpoint);
|
|
271
|
-
}
|
|
272
|
-
// Record successful poll
|
|
273
|
-
healthState.lastSuccessfulPoll = new Date().toISOString();
|
|
274
|
-
healthState.lastError = null;
|
|
275
|
-
healthState.totalEventsEmitted += result.events.length;
|
|
276
|
-
// If recovering from errors, log recovery
|
|
277
|
-
if (healthState.consecutiveErrors > 0) {
|
|
278
|
-
await this.emitLog('source.circuit_close', {
|
|
279
|
-
source: sourceId,
|
|
280
|
-
result: `recovered after ${healthState.consecutiveErrors} consecutive errors`,
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
healthState.consecutiveErrors = 0;
|
|
284
|
-
healthState.status = 'healthy';
|
|
285
|
-
// Process each event
|
|
286
|
-
for (const event of result.events) {
|
|
287
|
-
const enriched = event.trace_id ? event : { ...event, trace_id: generateTraceId() };
|
|
288
|
-
await this.processEvent(enriched);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
catch (err) {
|
|
292
|
-
const error = new ConnectorError(sourceId, 'Poll failed', { cause: err });
|
|
293
|
-
this.emit('error', error);
|
|
294
|
-
healthState.consecutiveErrors++;
|
|
295
|
-
healthState.lastError = err instanceof Error ? err.message : String(err);
|
|
296
|
-
// Update health status
|
|
297
|
-
if (healthState.consecutiveErrors >= this.circuitBreakerOpts.failureThreshold) {
|
|
298
|
-
healthState.status = 'unhealthy';
|
|
299
|
-
healthState.circuitOpen = true;
|
|
300
|
-
await this.emitLog('source.circuit_open', {
|
|
301
|
-
source: sourceId,
|
|
302
|
-
error: healthState.lastError,
|
|
303
|
-
result: `${healthState.consecutiveErrors} consecutive failures — polling paused, will retry in ${Math.round(this.circuitBreakerOpts.retryAfterMs / 1000)}s`,
|
|
304
|
-
});
|
|
305
|
-
// Schedule a retry after backoff
|
|
306
|
-
this.scheduleCircuitRetry(sourceId);
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
healthState.status = 'degraded';
|
|
310
|
-
await this.emitLog('system.error', {
|
|
311
|
-
source: sourceId,
|
|
312
|
-
error: error.message,
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
}
|
|
100
|
+
const rtStatus = this.runtime.status();
|
|
101
|
+
const modStatus = rtStatus.modules.find((m) => m.name === DEFAULT_MODULE);
|
|
102
|
+
return modStatus?.health ?? [];
|
|
316
103
|
}
|
|
317
104
|
/**
|
|
318
|
-
*
|
|
319
|
-
*
|
|
105
|
+
* Internal: poll a single source (used by health-tracking tests).
|
|
106
|
+
* @internal
|
|
320
107
|
*/
|
|
321
|
-
|
|
322
|
-
//
|
|
323
|
-
|
|
324
|
-
if (existing)
|
|
325
|
-
clearTimeout(existing);
|
|
326
|
-
const timer = setTimeout(async () => {
|
|
327
|
-
this.circuitRetryTimers.delete(sourceId);
|
|
328
|
-
if (!this.running)
|
|
329
|
-
return;
|
|
330
|
-
const healthState = this.healthStates.get(sourceId);
|
|
331
|
-
if (!healthState || !healthState.circuitOpen)
|
|
332
|
-
return;
|
|
333
|
-
await this.emitLog('source.circuit_retry', {
|
|
334
|
-
source: sourceId,
|
|
335
|
-
result: 'attempting recovery poll',
|
|
336
|
-
});
|
|
337
|
-
// Temporarily allow poll by opening the circuit
|
|
338
|
-
healthState.circuitOpen = false;
|
|
339
|
-
await this.pollSource(sourceId);
|
|
340
|
-
// If poll failed, circuit will be re-opened by pollSource
|
|
341
|
-
// If poll succeeded, consecutiveErrors is 0 and circuitOpen stays false
|
|
342
|
-
}, this.circuitBreakerOpts.retryAfterMs);
|
|
343
|
-
this.circuitRetryTimers.set(sourceId, timer);
|
|
344
|
-
}
|
|
345
|
-
// ─── Internal: Process a single event ─────────────────────────────────────
|
|
346
|
-
async processEvent(event) {
|
|
347
|
-
this.emit('event', event);
|
|
348
|
-
await this.emitLog('source.emit', {
|
|
349
|
-
event_id: event.id,
|
|
350
|
-
trace_id: event.trace_id,
|
|
351
|
-
source: event.source,
|
|
352
|
-
event_type: event.type,
|
|
353
|
-
});
|
|
354
|
-
// Write to bus (WAL)
|
|
355
|
-
await this.bus.publish(event);
|
|
356
|
-
// Match routes
|
|
357
|
-
const matched = matchRoutes(event, this.config.routes);
|
|
358
|
-
if (matched.length === 0) {
|
|
359
|
-
await this.emitLog('route.no_match', {
|
|
360
|
-
event_id: event.id,
|
|
361
|
-
trace_id: event.trace_id,
|
|
362
|
-
source: event.source,
|
|
363
|
-
});
|
|
364
|
-
await this.bus.ack(event.id);
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
// Process each matched route
|
|
368
|
-
for (const match of matched) {
|
|
369
|
-
const { route } = match;
|
|
370
|
-
await this.emitLog('route.match', {
|
|
371
|
-
event_id: event.id,
|
|
372
|
-
trace_id: event.trace_id,
|
|
373
|
-
route: route.name,
|
|
374
|
-
source: event.source,
|
|
375
|
-
target: route.then.actor,
|
|
376
|
-
});
|
|
377
|
-
// Run transform pipeline
|
|
378
|
-
let transformedEvent = event;
|
|
379
|
-
if (route.transforms && route.transforms.length > 0) {
|
|
380
|
-
const pipelineOptions = {
|
|
381
|
-
definitions: this.config.transforms,
|
|
382
|
-
packageTransforms: this.packageTransforms,
|
|
383
|
-
onLog: (partial) => {
|
|
384
|
-
void this.emitLog(partial.phase ?? 'transform.start', {
|
|
385
|
-
...partial,
|
|
386
|
-
event_id: partial.event_id ?? event.id,
|
|
387
|
-
trace_id: partial.trace_id ?? event.trace_id,
|
|
388
|
-
route: route.name,
|
|
389
|
-
});
|
|
390
|
-
},
|
|
391
|
-
};
|
|
392
|
-
const context = {
|
|
393
|
-
source: event.source,
|
|
394
|
-
target: route.then.actor,
|
|
395
|
-
eventType: event.type,
|
|
396
|
-
routeName: route.name,
|
|
397
|
-
};
|
|
398
|
-
const result = await executeTransformPipeline(event, context, route.transforms, pipelineOptions);
|
|
399
|
-
if (result.dropped || !result.event) {
|
|
400
|
-
continue; // Skip delivery for this route
|
|
401
|
-
}
|
|
402
|
-
transformedEvent = result.event;
|
|
403
|
-
}
|
|
404
|
-
// Deliver to actor
|
|
405
|
-
await this.deliverToActor(transformedEvent, route.name, route.then.actor, route);
|
|
406
|
-
}
|
|
407
|
-
// Ack the event after all routes processed
|
|
408
|
-
await this.bus.ack(event.id);
|
|
409
|
-
}
|
|
410
|
-
// ─── Internal: Deliver to actor ───────────────────────────────────────────
|
|
411
|
-
async deliverToActor(event, routeName, actorId, route) {
|
|
412
|
-
const actor = this.actors.get(actorId);
|
|
413
|
-
if (!actor) {
|
|
414
|
-
const error = new DeliveryError(actorId, routeName, `Actor "${actorId}" not found`);
|
|
415
|
-
this.emit('error', error);
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
await this.emitLog('deliver.attempt', {
|
|
419
|
-
event_id: event.id,
|
|
420
|
-
trace_id: event.trace_id,
|
|
421
|
-
route: routeName,
|
|
422
|
-
target: actorId,
|
|
423
|
-
});
|
|
424
|
-
const startTime = Date.now();
|
|
425
|
-
try {
|
|
426
|
-
// Build delivery config
|
|
427
|
-
const deliveryConfig = {
|
|
428
|
-
...(route.then.config ?? {}),
|
|
429
|
-
};
|
|
430
|
-
// Resolve launch prompt if configured
|
|
431
|
-
if (route.with?.prompt_file) {
|
|
432
|
-
try {
|
|
433
|
-
const promptContent = await readFile(route.with.prompt_file, 'utf-8');
|
|
434
|
-
deliveryConfig.launch_prompt = promptContent;
|
|
435
|
-
deliveryConfig.launch_prompt_file = route.with.prompt_file;
|
|
436
|
-
}
|
|
437
|
-
catch {
|
|
438
|
-
// Non-fatal: log but continue delivery
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
const result = await actor.deliver(event, deliveryConfig);
|
|
442
|
-
const durationMs = Date.now() - startTime;
|
|
443
|
-
if (result.status === 'delivered') {
|
|
444
|
-
await this.emitLog('deliver.success', {
|
|
445
|
-
event_id: event.id,
|
|
446
|
-
trace_id: event.trace_id,
|
|
447
|
-
route: routeName,
|
|
448
|
-
target: actorId,
|
|
449
|
-
duration_ms: durationMs,
|
|
450
|
-
});
|
|
451
|
-
this.emit('delivery', { event, route: routeName, actor: actorId, status: 'delivered' });
|
|
452
|
-
}
|
|
453
|
-
else {
|
|
454
|
-
await this.emitLog('deliver.failure', {
|
|
455
|
-
event_id: event.id,
|
|
456
|
-
trace_id: event.trace_id,
|
|
457
|
-
route: routeName,
|
|
458
|
-
target: actorId,
|
|
459
|
-
duration_ms: durationMs,
|
|
460
|
-
error: result.error?.message ?? result.status,
|
|
461
|
-
});
|
|
462
|
-
this.emit('delivery', { event, route: routeName, actor: actorId, status: result.status });
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
catch (err) {
|
|
466
|
-
const durationMs = Date.now() - startTime;
|
|
467
|
-
const error = new DeliveryError(actorId, routeName, 'Delivery failed', { cause: err });
|
|
468
|
-
this.emit('error', error);
|
|
469
|
-
await this.emitLog('deliver.failure', {
|
|
470
|
-
event_id: event.id,
|
|
471
|
-
trace_id: event.trace_id,
|
|
472
|
-
route: routeName,
|
|
473
|
-
target: actorId,
|
|
474
|
-
duration_ms: durationMs,
|
|
475
|
-
error: error.message,
|
|
476
|
-
});
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
// ─── Internal: Emit structured log ────────────────────────────────────────
|
|
480
|
-
async emitLog(phase, fields) {
|
|
481
|
-
const entry = {
|
|
482
|
-
timestamp: new Date().toISOString(),
|
|
483
|
-
event_id: fields.event_id ?? '',
|
|
484
|
-
trace_id: fields.trace_id ?? '',
|
|
485
|
-
phase,
|
|
486
|
-
source: fields.source,
|
|
487
|
-
target: fields.target,
|
|
488
|
-
route: fields.route,
|
|
489
|
-
transform: fields.transform,
|
|
490
|
-
event_type: fields.event_type,
|
|
491
|
-
result: fields.result,
|
|
492
|
-
duration_ms: fields.duration_ms,
|
|
493
|
-
error: fields.error,
|
|
494
|
-
metadata: fields.metadata,
|
|
495
|
-
workspace: this.config.project.name,
|
|
496
|
-
};
|
|
497
|
-
await this.loggerManager.log(entry);
|
|
108
|
+
async pollSource(sourceId) {
|
|
109
|
+
// biome-ignore lint/suspicious/noExplicitAny: test-only access to runtime internals
|
|
110
|
+
await this.runtime.pollSource(sourceId, DEFAULT_MODULE);
|
|
498
111
|
}
|
|
499
112
|
}
|
|
500
113
|
//# sourceMappingURL=engine.js.map
|
package/dist/engine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAa5C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,M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ChC,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,UAAU,CAAC,QAAgB;QACxC,oFAAoF;QACpF,MAAO,IAAI,CAAC,OAAe,CAAC,UAAU,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAClE,CAAC;CACD"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -28,4 +28,15 @@ export declare class SchemaError extends OrgLoopError {
|
|
|
28
28
|
readonly validationErrors: string[];
|
|
29
29
|
constructor(message: string, validationErrors?: string[], options?: ErrorOptions);
|
|
30
30
|
}
|
|
31
|
+
export declare class ModuleConflictError extends OrgLoopError {
|
|
32
|
+
readonly moduleName: string;
|
|
33
|
+
constructor(moduleName: string, message?: string, options?: ErrorOptions);
|
|
34
|
+
}
|
|
35
|
+
export declare class ModuleNotFoundError extends OrgLoopError {
|
|
36
|
+
readonly moduleName: string;
|
|
37
|
+
constructor(moduleName: string, message?: string, options?: ErrorOptions);
|
|
38
|
+
}
|
|
39
|
+
export declare class RuntimeError extends OrgLoopError {
|
|
40
|
+
constructor(message: string, options?: ErrorOptions);
|
|
41
|
+
}
|
|
31
42
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,qBAAa,YAAa,SAAQ,KAAK;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAKjE;AAED,qBAAa,WAAY,SAAQ,YAAY;gBAChC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAInD;AAED,qBAAa,cAAe,SAAQ,YAAY;IAC/C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBAEjB,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM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OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAKxE;AAED,qBAAa,aAAc,SAAQ,YAAY;IAC9C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEf,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAMvF;AAED,qBAAa,WAAY,SAAQ,YAAY;IAC5C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAC;gBAExB,OAAO,EAAE,MAAM,EAAE,gBAAgB,GAAE,MAAM,EAAO,EAAE,OAAO,CAAC,EAAE,YAAY;CAKpF;AAED,qBAAa,mBAAoB,SAAQ,YAAY;IACpD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;gBAEhB,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAKxE;AAED,qBAAa,mBAAoB,SAAQ,YAAY;IACpD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;gBAEhB,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAKxE;AAED,qBAAa,YAAa,SAAQ,YAAY;gBACjC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAInD"}
|
package/dist/errors.js
CHANGED
|
@@ -52,4 +52,26 @@ export class SchemaError extends OrgLoopError {
|
|
|
52
52
|
this.validationErrors = validationErrors;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
export class ModuleConflictError extends OrgLoopError {
|
|
56
|
+
moduleName;
|
|
57
|
+
constructor(moduleName, message, options) {
|
|
58
|
+
super('MODULE_CONFLICT', message ?? `Module conflict: ${moduleName}`, options);
|
|
59
|
+
this.name = 'ModuleConflictError';
|
|
60
|
+
this.moduleName = moduleName;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export class ModuleNotFoundError extends OrgLoopError {
|
|
64
|
+
moduleName;
|
|
65
|
+
constructor(moduleName, message, options) {
|
|
66
|
+
super('MODULE_NOT_FOUND', message ?? `Module not found: ${moduleName}`, options);
|
|
67
|
+
this.name = 'ModuleNotFoundError';
|
|
68
|
+
this.moduleName = moduleName;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export class RuntimeError extends OrgLoopError {
|
|
72
|
+
constructor(message, options) {
|
|
73
|
+
super('RUNTIME_ERROR', message, options);
|
|
74
|
+
this.name = 'RuntimeError';
|
|
75
|
+
}
|
|
76
|
+
}
|
|
55
77
|
//# sourceMappingURL=errors.js.map
|