@darkelogix/openclaw-trusted-mode 1.0.0-rc.1 → 1.0.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.
- package/dist/packageVersion.js +33 -0
- package/package.json +3 -2
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveOpenClawVersion = resolveOpenClawVersion;
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
function readPackageVersion(startDir) {
|
|
7
|
+
let current = startDir;
|
|
8
|
+
for (let depth = 0; depth < 5; depth += 1) {
|
|
9
|
+
const candidate = (0, node_path_1.join)(current, 'package.json');
|
|
10
|
+
if ((0, node_fs_1.existsSync)(candidate)) {
|
|
11
|
+
try {
|
|
12
|
+
const parsed = JSON.parse((0, node_fs_1.readFileSync)(candidate, 'utf8'));
|
|
13
|
+
if (typeof parsed.version === 'string' && parsed.version.trim() !== '') {
|
|
14
|
+
return parsed.version.trim();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
// Fall through to the next parent directory.
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const parent = (0, node_path_1.dirname)(current);
|
|
22
|
+
if (parent == current)
|
|
23
|
+
break;
|
|
24
|
+
current = parent;
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
function resolveOpenClawVersion(configuredVersion = process.env.OPENCLAW_VERSION) {
|
|
29
|
+
if (typeof configuredVersion === 'string' && configuredVersion.trim() !== '') {
|
|
30
|
+
return configuredVersion.trim();
|
|
31
|
+
}
|
|
32
|
+
return readPackageVersion(__dirname) ?? 'unknown';
|
|
33
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darkelogix/openclaw-trusted-mode",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "MIT-licensed OpenClaw Trusted Mode plugin with standalone hardening and optional SDE-backed governance",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"darkelogix"
|
|
28
28
|
],
|
|
29
29
|
"publishConfig": {
|
|
30
|
-
"access": "
|
|
30
|
+
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"openclaw": {
|
|
33
33
|
"extensions": [
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"dist/contextCurator.js",
|
|
42
42
|
"dist/hardening.js",
|
|
43
43
|
"dist/index.js",
|
|
44
|
+
"dist/packageVersion.js",
|
|
44
45
|
"dist/runtimeCertification.js",
|
|
45
46
|
"dist/sdeGuidance.js",
|
|
46
47
|
"openclaw.plugin.json",
|