@aight-cool/aight-utils 0.1.4 → 0.1.5
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/openclaw.plugin.json +22 -6
- package/package.json +1 -1
- package/src/version.ts +4 -2
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "aight-utils",
|
|
3
3
|
"name": "Aight App Utils",
|
|
4
4
|
"description": "Aight App: Push notifications, Today items, config RPC, and agent bootstrap",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.5",
|
|
6
6
|
"configSchema": {
|
|
7
7
|
"type": "object",
|
|
8
8
|
"additionalProperties": false,
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
"properties": {
|
|
14
14
|
"mode": {
|
|
15
15
|
"type": "string",
|
|
16
|
-
"enum": [
|
|
16
|
+
"enum": [
|
|
17
|
+
"private",
|
|
18
|
+
"rich"
|
|
19
|
+
],
|
|
17
20
|
"default": "rich"
|
|
18
21
|
},
|
|
19
22
|
"relayUrl": {
|
|
@@ -26,11 +29,24 @@
|
|
|
26
29
|
"type": "object",
|
|
27
30
|
"additionalProperties": false,
|
|
28
31
|
"properties": {
|
|
29
|
-
"token": {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
"token": {
|
|
33
|
+
"type": "string"
|
|
34
|
+
},
|
|
35
|
+
"platform": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"enum": [
|
|
38
|
+
"ios",
|
|
39
|
+
"android"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"registeredAt": {
|
|
43
|
+
"type": "string"
|
|
44
|
+
}
|
|
32
45
|
},
|
|
33
|
-
"required": [
|
|
46
|
+
"required": [
|
|
47
|
+
"token",
|
|
48
|
+
"platform"
|
|
49
|
+
]
|
|
34
50
|
}
|
|
35
51
|
}
|
|
36
52
|
}
|
package/package.json
CHANGED
package/src/version.ts
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { OpenClawPluginApi, GatewayRequestHandlerOptions } from "openclaw/plugin-sdk";
|
|
8
|
+
import { execSync } from "node:child_process";
|
|
9
|
+
import { createRequire } from "node:module";
|
|
8
10
|
import { readFileSync } from "node:fs";
|
|
9
11
|
import { join, dirname } from "node:path";
|
|
10
12
|
import { fileURLToPath } from "node:url";
|
|
@@ -29,13 +31,13 @@ let cachedGatewayVersion: string | null = null;
|
|
|
29
31
|
function getGatewayVersion(): string {
|
|
30
32
|
if (cachedGatewayVersion) return cachedGatewayVersion;
|
|
31
33
|
try {
|
|
32
|
-
const { execSync } = require("node:child_process");
|
|
33
34
|
const out = execSync("openclaw --version", { timeout: 5000 }).toString().trim();
|
|
34
35
|
cachedGatewayVersion = out || "unknown";
|
|
35
36
|
} catch {
|
|
36
37
|
// Try to find openclaw's package.json via require.resolve
|
|
37
38
|
try {
|
|
38
|
-
const
|
|
39
|
+
const require_ = createRequire(import.meta.url);
|
|
40
|
+
const resolved = require_.resolve("openclaw");
|
|
39
41
|
const pkgPath = join(dirname(resolved), "package.json");
|
|
40
42
|
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
41
43
|
cachedGatewayVersion = pkg.version ?? "unknown";
|