@chrysb/alphaclaw 0.8.4-beta.0 → 0.8.4
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.
|
@@ -55,22 +55,21 @@ const ensureManagedExecApprovalsDefaults = (rawFile = {}) => {
|
|
|
55
55
|
const file =
|
|
56
56
|
rawFile && typeof rawFile === "object" && !Array.isArray(rawFile) ? rawFile : {};
|
|
57
57
|
const before = JSON.stringify(file);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
defaults.askFallback = kManagedExecApprovalsDefaults.askFallback;
|
|
58
|
+
const defaults =
|
|
59
|
+
file.defaults && typeof file.defaults === "object" && !Array.isArray(file.defaults)
|
|
60
|
+
? file.defaults
|
|
61
|
+
: null;
|
|
62
|
+
const hasNonEmptyDefaults = !!defaults && Object.keys(defaults).length > 0;
|
|
63
|
+
if (!hasNonEmptyDefaults) {
|
|
64
|
+
if (!Number.isInteger(file.version)) file.version = 1;
|
|
65
|
+
file.defaults = {
|
|
66
|
+
security: kManagedExecApprovalsDefaults.security,
|
|
67
|
+
ask: kManagedExecApprovalsDefaults.ask,
|
|
68
|
+
askFallback: kManagedExecApprovalsDefaults.askFallback,
|
|
69
|
+
};
|
|
70
|
+
if (!file.agents || typeof file.agents !== "object" || Array.isArray(file.agents)) {
|
|
71
|
+
file.agents = {};
|
|
72
|
+
}
|
|
74
73
|
}
|
|
75
74
|
return {
|
|
76
75
|
file,
|
|
@@ -85,19 +84,11 @@ const ensureManagedOpenclawExecDefaults = (rawConfig = {}) => {
|
|
|
85
84
|
if (!config.tools || typeof config.tools !== "object" || Array.isArray(config.tools)) {
|
|
86
85
|
config.tools = {};
|
|
87
86
|
}
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
config.tools.exec = {};
|
|
94
|
-
}
|
|
95
|
-
const exec = config.tools.exec;
|
|
96
|
-
if (!String(exec.security || "").trim()) {
|
|
97
|
-
exec.security = kManagedOpenclawExecDefaults.security;
|
|
98
|
-
}
|
|
99
|
-
if (!hasOwn(exec, "strictInlineEval")) {
|
|
100
|
-
exec.strictInlineEval = kManagedOpenclawExecDefaults.strictInlineEval;
|
|
87
|
+
if (!hasOwn(config.tools, "exec")) {
|
|
88
|
+
config.tools.exec = {
|
|
89
|
+
security: kManagedOpenclawExecDefaults.security,
|
|
90
|
+
strictInlineEval: kManagedOpenclawExecDefaults.strictInlineEval,
|
|
91
|
+
};
|
|
101
92
|
}
|
|
102
93
|
return {
|
|
103
94
|
config,
|