@orbytautomation/engine 0.6.1 → 0.6.2

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.
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Workflow Worker
3
+ *
4
+ * Node.js worker thread for processing scheduled/queued workflow jobs.
5
+ * Spawned by JobScheduler — one instance per worker pool slot.
6
+ *
7
+ * Protocol:
8
+ * Main → Worker: { type: 'execute', job: { id, workflowId, payload, metadata } }
9
+ * Worker → Main: { type: 'ready' }
10
+ * { type: 'completed', result: any }
11
+ * { type: 'failed', error: string }
12
+ */
13
+ export {};
14
+ //# sourceMappingURL=workflow-worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-worker.d.ts","sourceRoot":"","sources":["../../../src/scheduling/workers/workflow-worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Workflow Worker
3
+ *
4
+ * Node.js worker thread for processing scheduled/queued workflow jobs.
5
+ * Spawned by JobScheduler — one instance per worker pool slot.
6
+ *
7
+ * Protocol:
8
+ * Main → Worker: { type: 'execute', job: { id, workflowId, payload, metadata } }
9
+ * Worker → Main: { type: 'ready' }
10
+ * { type: 'completed', result: any }
11
+ * { type: 'failed', error: string }
12
+ */
13
+ import { parentPort } from 'node:worker_threads';
14
+ if (!parentPort) {
15
+ throw new Error('workflow-worker must be run as a worker thread');
16
+ }
17
+ const port = parentPort;
18
+ // Signal ready to the scheduler
19
+ port.postMessage({ type: 'ready' });
20
+ port.on('message', async (message) => {
21
+ if (message.type !== 'execute' || !message.job) {
22
+ return;
23
+ }
24
+ const job = message.job;
25
+ try {
26
+ // Scheduled workflow execution is not yet implemented.
27
+ // The scheduler worker pool is reserved for future trigger-based execution.
28
+ // Direct engine.run() calls bypass this worker entirely.
29
+ port.postMessage({
30
+ type: 'completed',
31
+ result: {
32
+ jobId: job.id,
33
+ workflowId: job.workflowId,
34
+ status: 'skipped',
35
+ message: 'Scheduled execution not yet implemented',
36
+ },
37
+ });
38
+ }
39
+ catch (err) {
40
+ port.postMessage({
41
+ type: 'failed',
42
+ error: err instanceof Error ? err.message : String(err),
43
+ });
44
+ }
45
+ });
46
+ //# sourceMappingURL=workflow-worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-worker.js","sourceRoot":"","sources":["../../../src/scheduling/workers/workflow-worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,IAAI,CAAC,UAAU,EAAE,CAAC;IAChB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,IAAI,GAAG,UAAU,CAAC;AAExB,gCAAgC;AAChC,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;AAEpC,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,OAAoC,EAAE,EAAE;IAChE,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QAC/C,OAAO;IACT,CAAC;IAED,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAExB,IAAI,CAAC;QACH,uDAAuD;QACvD,4EAA4E;QAC5E,yDAAyD;QACzD,IAAI,CAAC,WAAW,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,MAAM,EAAE;gBACN,KAAK,EAAE,GAAG,CAAC,EAAE;gBACb,UAAU,EAAE,GAAG,CAAC,UAAU;gBAC1B,MAAM,EAAE,SAAS;gBACjB,OAAO,EAAE,yCAAyC;aACnD;SACF,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,IAAI,CAAC,WAAW,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SACxD,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbytautomation/engine",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Orbyt - Automation Engine Framework",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",