channel-worker 2.3.2 → 2.3.3

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/lib/api-client.js CHANGED
@@ -29,10 +29,11 @@ class ApiClient {
29
29
  return this.request('POST', '/workers/register', workerData);
30
30
  }
31
31
 
32
- async heartbeat(workerId, version, extensionVersion) {
32
+ async heartbeat(workerId, version, extensionVersion, ccExtensionVersion) {
33
33
  const body = { worker_id: workerId };
34
34
  if (version) body.version = version;
35
35
  if (extensionVersion) body.extension_version = extensionVersion;
36
+ if (ccExtensionVersion) body.cc_extension_version = ccExtensionVersion;
36
37
  return this.request('POST', '/workers/heartbeat', body);
37
38
  }
38
39
 
package/lib/heartbeat.js CHANGED
@@ -1,6 +1,19 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const os = require('os');
1
4
  const { getLocalVersion } = require('./updater');
2
5
  const { getLocalExtensionVersion } = require('./extension-updater');
3
6
 
7
+ function readCcExtensionVersion(config) {
8
+ try {
9
+ const dir = config.content_creator_ext_path || path.join(os.homedir(), 'content-creator-ext');
10
+ const manifest = JSON.parse(fs.readFileSync(path.join(dir, 'manifest.json'), 'utf8'));
11
+ return manifest.version || null;
12
+ } catch {
13
+ return null;
14
+ }
15
+ }
16
+
4
17
  class Heartbeat {
5
18
  constructor(api, workerId, intervalMs = 30000, config = {}) {
6
19
  this.api = api;
@@ -26,7 +39,8 @@ class Heartbeat {
26
39
  try {
27
40
  const version = getLocalVersion();
28
41
  const extVersion = getLocalExtensionVersion(this.config.extension_path);
29
- await this.api.heartbeat(this.workerId, version, extVersion);
42
+ const ccExtVersion = readCcExtensionVersion(this.config);
43
+ await this.api.heartbeat(this.workerId, version, extVersion, ccExtVersion);
30
44
  } catch (err) {
31
45
  console.error(`[heartbeat] Failed: ${err.message}`);
32
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "channel-worker",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "description": "Channel Manager worker daemon — runs on remote machines to execute video pipeline jobs",
5
5
  "main": "lib/daemon.js",
6
6
  "bin": {