vet-skills 0.2.0 → 0.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.
- package/dist/index.js +28 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7629,7 +7629,7 @@ import { mkdirSync, readFileSync, writeFileSync, existsSync, appendFileSync, chm
|
|
|
7629
7629
|
import { homedir } from "node:os";
|
|
7630
7630
|
import { join } from "node:path";
|
|
7631
7631
|
import { randomUUID } from "node:crypto";
|
|
7632
|
-
var VERSION = "0.
|
|
7632
|
+
var VERSION = "0.3.0";
|
|
7633
7633
|
var HOME = process.env.VET_SKILLS_HOME ?? join(homedir(), ".vet-skills");
|
|
7634
7634
|
var API = (process.env.KILLERSKILLS_API ?? "https://killerskills.ai").replace(/\/$/, "");
|
|
7635
7635
|
var CACHE_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
@@ -7995,6 +7995,27 @@ var INSTALL_PATTERNS = [
|
|
|
7995
7995
|
{ re: /claude\s+mcp\s+add(?:-json)?\s+(\S+)/, kind: "mcp" },
|
|
7996
7996
|
{ re: /vet-skills\s+install\s+(\S+)/, kind: "skill" }
|
|
7997
7997
|
];
|
|
7998
|
+
function extractRemoteMcp(command) {
|
|
7999
|
+
const m = command.match(/claude\s+mcp\s+add(?:-json)?\s+(.*)$/s);
|
|
8000
|
+
if (!m) return null;
|
|
8001
|
+
const args = (m[1].match(/"[^"]*"|'[^']*'|\S+/g) ?? []).map((a) => a.replace(/^(['"])(.*)\1$/, "$2"));
|
|
8002
|
+
const takesValue = /^(--transport|-t|--scope|-s|--header|-H|--env|-e)$/;
|
|
8003
|
+
const positional = [];
|
|
8004
|
+
for (let i = 0; i < args.length; i++) {
|
|
8005
|
+
const a = args[i];
|
|
8006
|
+
if (a === "--") break;
|
|
8007
|
+
if (takesValue.test(a)) {
|
|
8008
|
+
i += 1;
|
|
8009
|
+
continue;
|
|
8010
|
+
}
|
|
8011
|
+
if (a.startsWith("-")) continue;
|
|
8012
|
+
positional.push(a);
|
|
8013
|
+
}
|
|
8014
|
+
const url = positional.find((a) => /^https?:\/\//.test(a));
|
|
8015
|
+
if (!url) return null;
|
|
8016
|
+
const name = positional.find((a) => a !== url) ?? new URL(url).hostname;
|
|
8017
|
+
return { name, url };
|
|
8018
|
+
}
|
|
7998
8019
|
function extractInstall(command) {
|
|
7999
8020
|
for (const p of INSTALL_PATTERNS) {
|
|
8000
8021
|
const m = command.match(p.re);
|
|
@@ -8016,12 +8037,18 @@ async function hookEval(stdin) {
|
|
|
8016
8037
|
if (!found) return 0;
|
|
8017
8038
|
const r = await check(found.q, { quiet: true, agentKind: "claude_code" });
|
|
8018
8039
|
const out = renderOutcome(r);
|
|
8040
|
+
const remote = found.kind === "mcp" ? extractRemoteMcp(cmd2) : null;
|
|
8041
|
+
const watch = async () => {
|
|
8042
|
+
if (remote && readOrg()) await report({ installed: [], removed: [], mcp_servers: [remote] }).catch(() => null);
|
|
8043
|
+
};
|
|
8019
8044
|
switch (r.decision.decision) {
|
|
8020
8045
|
case "allow":
|
|
8021
8046
|
case "observe":
|
|
8047
|
+
await watch();
|
|
8022
8048
|
process.stderr.write(out + "\n");
|
|
8023
8049
|
return 0;
|
|
8024
8050
|
case "sandbox":
|
|
8051
|
+
await watch();
|
|
8025
8052
|
process.stderr.write(out + "\n");
|
|
8026
8053
|
return 0;
|
|
8027
8054
|
case "approval_required":
|