@zintrust/workers 0.5.0 → 0.5.1

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.
@@ -143,7 +143,7 @@ const calculateCpuUsage = () => {
143
143
  for (const type in cpu.times) {
144
144
  totalTick += cpu.times[type];
145
145
  }
146
- totalIdle += cpu.times.idle;
146
+ totalIdle += cpu.times['idle'];
147
147
  });
148
148
  const now = Date.now();
149
149
  // If we have previous measurements, calculate real-time usage
@@ -413,7 +413,7 @@ const calculateTrend = (workerName, metric, period) => {
413
413
  });
414
414
  // Simple linear regression for trend
415
415
  const firstValue = values[0];
416
- const lastValue = values[values.length - 1] ?? values[0];
416
+ const lastValue = values.at(-1) ?? values[0];
417
417
  const changePercentage = ((lastValue - firstValue) / firstValue) * 100;
418
418
  let trend;
419
419
  if (Math.abs(changePercentage) < 5) {
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@zintrust/workers",
3
- "version": "0.4.99",
4
- "buildDate": "2026-04-12T09:59:29.806Z",
3
+ "version": "0.5.1",
4
+ "buildDate": "2026-04-12T19:52:07.100Z",
5
5
  "buildEnvironment": {
6
- "node": "v25.6.1",
6
+ "node": "v22.22.1",
7
7
  "platform": "darwin",
8
8
  "arch": "arm64"
9
9
  },
10
10
  "git": {
11
- "commit": "e4f2797b",
11
+ "commit": "87ea4893",
12
12
  "branch": "release"
13
13
  },
14
14
  "package": {
@@ -106,8 +106,8 @@
106
106
  "sha256": "dd82e7e2c23a2fcaefc0cb87a1a7931594d6a5f76b758f608c77063f5e8533cd"
107
107
  },
108
108
  "DeadLetterQueue.js": {
109
- "size": 19478,
110
- "sha256": "d99676dc1750f740ed31c0df40e4ee3ad1c7e1ea2c9ac54d43885d4f88a07888"
109
+ "size": 19512,
110
+ "sha256": "47ad34c16e8e44a7febb849c56d7558f0f5a951a771c7b2e5c73c8db1b718e63"
111
111
  },
112
112
  "HealthMonitor.d.ts": {
113
113
  "size": 1485,
@@ -162,8 +162,8 @@
162
162
  "sha256": "97e85eb898813f03871bd3bc0b9dbe67777feb198366b27b01a5281224135e79"
163
163
  },
164
164
  "ResourceMonitor.js": {
165
- "size": 19605,
166
- "sha256": "cdf240f3fb1377c456a65b7020220e91ddd95f1bb38a00ff5ca0f8094b6610f0"
165
+ "size": 19596,
166
+ "sha256": "c8d016bf18c4daed26f9e42538f0aebf8f4f9d18553116fd32c2ecd343d0f0f3"
167
167
  },
168
168
  "SLAMonitor.d.ts": {
169
169
  "size": 2727,
@@ -231,7 +231,7 @@
231
231
  },
232
232
  "build-manifest.json": {
233
233
  "size": 19881,
234
- "sha256": "cd17f42f0cf04c185545aab31d797074a1583ad0b0bf1285663979c4306be01a"
234
+ "sha256": "e10fb711cf2bcb057cb3956d6d5f765c51da8840ad43b894490a277f52969912"
235
235
  },
236
236
  "config/workerConfig.d.ts": {
237
237
  "size": 282,
@@ -414,8 +414,8 @@
414
414
  "sha256": "0dcb7ca21683ab210eeb23d067e41b55ae996fa9e52c688371dc177f070ec059"
415
415
  },
416
416
  "index.js": {
417
- "size": 2337,
418
- "sha256": "24c7780170d8bef4e981b0a7fd755bf0fec572285221fd4dd5af82983603f457"
417
+ "size": 2336,
418
+ "sha256": "61c5a2ada4b343e59445859ac3cdecb8d7f05bffb89b18f1a2e0f5d99c7f92f9"
419
419
  },
420
420
  "queueMonitorHistory.d.ts": {
421
421
  "size": 433,
@@ -538,8 +538,8 @@
538
538
  "sha256": "e1e5ade40867f1a51fb3801beee1f7bd51532267ec78bd47ae866a6a388a51f5"
539
539
  },
540
540
  "ui/types/worker-ui.d.ts": {
541
- "size": 5685,
542
- "sha256": "7114bd2a470ffe61745e6e49ba1ed02a6d67535dba29f387f1487f7b3b932fb8"
541
+ "size": 5562,
542
+ "sha256": "c732bd37f434c3e1c05042384f2a6ab286455ccba5eb6d5716f931e3699857e0"
543
543
  },
544
544
  "ui/types/worker-ui.js": {
545
545
  "size": 94,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zintrust/workers",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Worker orchestration and background job management for ZinTrust.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -40,7 +40,7 @@
40
40
  "node": ">=20.0.0"
41
41
  },
42
42
  "peerDependencies": {
43
- "@zintrust/core": ">=0.4.0 <0.5.0",
43
+ "@zintrust/core": ">=0.5.0 <0.6.0",
44
44
  "@zintrust/queue-monitor": "*",
45
45
  "@zintrust/queue-redis": "*"
46
46
  },
@@ -73,4 +73,4 @@
73
73
  "prom-client": "^15.1.3",
74
74
  "simple-statistics": "^7.8.9"
75
75
  }
76
- }
76
+ }
@@ -224,9 +224,9 @@ const calculateCpuUsage = (): number => {
224
224
 
225
225
  cpus.forEach((cpu: { times: Record<string, number> }) => {
226
226
  for (const type in cpu.times) {
227
- totalTick += cpu.times[type as keyof typeof cpu.times];
227
+ totalTick += cpu.times[type];
228
228
  }
229
- totalIdle += cpu.times.idle;
229
+ totalIdle += cpu.times['idle'];
230
230
  });
231
231
 
232
232
  const now = Date.now();
@@ -534,7 +534,7 @@ const calculateTrend = (
534
534
 
535
535
  // Simple linear regression for trend
536
536
  const firstValue = values[0];
537
- const lastValue = values[values.length - 1] ?? values[0];
537
+ const lastValue = values.at(-1) ?? values[0];
538
538
  const changePercentage = ((lastValue - firstValue) / firstValue) * 100;
539
539
 
540
540
  let trend: ResourceTrend['trend'];