@siftd/connect-agent 0.2.24 → 0.2.25

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 (2) hide show
  1. package/dist/heartbeat.js +18 -1
  2. package/package.json +1 -1
package/dist/heartbeat.js CHANGED
@@ -8,9 +8,26 @@
8
8
  */
9
9
  import { hostname } from 'os';
10
10
  import { createHash } from 'crypto';
11
+ import { readFileSync } from 'fs';
12
+ import { fileURLToPath } from 'url';
13
+ import { dirname, join } from 'path';
11
14
  import { getServerUrl, getAgentToken, getUserId, isCloudMode } from './config.js';
12
15
  const HEARTBEAT_INTERVAL = 10000; // 10 seconds
13
- const VERSION = '0.2.20'; // Should match package.json
16
+ // Read version from package.json dynamically
17
+ function getVersion() {
18
+ try {
19
+ // Try to find package.json relative to this file
20
+ const __filename = fileURLToPath(import.meta.url);
21
+ const __dirname = dirname(__filename);
22
+ const pkgPath = join(__dirname, '..', 'package.json');
23
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
24
+ return pkg.version || '0.0.0';
25
+ }
26
+ catch {
27
+ return '0.0.0';
28
+ }
29
+ }
30
+ const VERSION = getVersion();
14
31
  const state = {
15
32
  intervalId: null,
16
33
  runnerId: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siftd/connect-agent",
3
- "version": "0.2.24",
3
+ "version": "0.2.25",
4
4
  "description": "Master orchestrator agent - control Claude Code remotely via web",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",