openclaw-elys 1.1.0 → 1.3.0

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.
@@ -1,5 +1,26 @@
1
1
  import os from "os";
2
+ import fs from "fs";
3
+ import path from "path";
4
+ import { fileURLToPath } from "url";
2
5
  import { saveCredentials } from "./config.js";
6
+ function getClientVersion() {
7
+ try {
8
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
+ // Try multiple paths: dist/src/ → ../../package.json, or src/ → ../package.json
10
+ for (const rel of ["../..", ".."]) {
11
+ const pkgPath = path.resolve(__dirname, rel, "package.json");
12
+ if (fs.existsSync(pkgPath)) {
13
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
14
+ if (pkg.version)
15
+ return pkg.version;
16
+ }
17
+ }
18
+ return "unknown";
19
+ }
20
+ catch {
21
+ return "unknown";
22
+ }
23
+ }
3
24
  /**
4
25
  * Register this device with the Elys gateway.
5
26
  * Saves credentials to ~/.elys/config.json on success.
@@ -11,7 +32,7 @@ export async function registerDevice(gatewayUrl, registerToken) {
11
32
  os: process.platform,
12
33
  os_version: os.release(),
13
34
  arch: os.arch(),
14
- client_version: "1.0.0",
35
+ client_version: getClientVersion(),
15
36
  };
16
37
  const resp = await fetch(`${gatewayUrl}/api/v1/device/register`, {
17
38
  method: "POST",
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "openclaw-elys",
2
+ "id": "elys",
3
3
  "channels": ["elys"],
4
4
  "configSchema": {
5
5
  "type": "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-elys",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "OpenClaw Elys channel plugin — connects to Elys App",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",