@opentrust/guards 7.3.11 → 7.3.13
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/agent/command-executor.ts +4 -13
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -32,7 +32,7 @@ function executeSkillInstall(payload: Record<string, unknown> | null, log: Logge
|
|
|
32
32
|
|
|
33
33
|
try {
|
|
34
34
|
log.info(`Command: installing skill "${skillName}"...`);
|
|
35
|
-
const output = execSync(`
|
|
35
|
+
const output = execSync(`clawhub install ${skillName}`, {
|
|
36
36
|
encoding: "utf-8",
|
|
37
37
|
timeout: 120_000,
|
|
38
38
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -62,15 +62,13 @@ function executeCustomSkillInstall(payload: Record<string, unknown> | null, log:
|
|
|
62
62
|
|
|
63
63
|
fs.mkdirSync(skillDir, { recursive: true });
|
|
64
64
|
|
|
65
|
-
const
|
|
66
|
-
const fileName = `skill.${ext}`;
|
|
65
|
+
const fileName = "SKILL.md";
|
|
67
66
|
fs.writeFileSync(path.join(skillDir, fileName), content, "utf-8");
|
|
68
67
|
|
|
69
68
|
log.info(`Command: custom skill "${skillName}" written to ${skillDir}/${fileName}`);
|
|
70
69
|
|
|
71
|
-
// Try `openclaw skills install` from local path; fall back to file-only approach
|
|
72
70
|
try {
|
|
73
|
-
const output = execSync(`
|
|
71
|
+
const output = execSync(`clawhub install ${skillDir}`, {
|
|
74
72
|
encoding: "utf-8",
|
|
75
73
|
timeout: 120_000,
|
|
76
74
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -86,20 +84,13 @@ function executeCustomSkillInstall(payload: Record<string, unknown> | null, log:
|
|
|
86
84
|
}
|
|
87
85
|
}
|
|
88
86
|
|
|
89
|
-
function detectContentFormat(content: string): string {
|
|
90
|
-
const trimmed = content.trim();
|
|
91
|
-
if (trimmed.startsWith("{") || trimmed.startsWith("[")) return "json";
|
|
92
|
-
if (trimmed.startsWith("---") || /^\w+:/m.test(trimmed)) return "yaml";
|
|
93
|
-
return "md";
|
|
94
|
-
}
|
|
95
|
-
|
|
96
87
|
function executeSkillUninstall(payload: Record<string, unknown> | null, log: Logger): CommandResult {
|
|
97
88
|
const skillName = payload?.skillName as string;
|
|
98
89
|
if (!skillName) return { success: false, error: "Missing skillName in payload" };
|
|
99
90
|
|
|
100
91
|
try {
|
|
101
92
|
log.info(`Command: uninstalling skill "${skillName}"...`);
|
|
102
|
-
const output = execSync(`
|
|
93
|
+
const output = execSync(`clawhub uninstall ${skillName}`, {
|
|
103
94
|
encoding: "utf-8",
|
|
104
95
|
timeout: 60_000,
|
|
105
96
|
stdio: ["pipe", "pipe", "pipe"],
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "opentrust-guard",
|
|
3
3
|
"name": "OpenTrust Guard",
|
|
4
4
|
"description": "AI security guard for OpenClaw agents: prompt injection detection, credential scanning, and behavioral monitoring.",
|
|
5
|
-
"version": "7.3.
|
|
5
|
+
"version": "7.3.13",
|
|
6
6
|
"configSchema": {
|
|
7
7
|
"type": "object",
|
|
8
8
|
"additionalProperties": false,
|
package/package.json
CHANGED