vskill 1.2.4 → 1.2.7
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/README.md +51 -3
- package/agents.json +6 -1
- package/dist/agents/agents-registry.d.ts +43 -16
- package/dist/agents/agents-registry.js +119 -33
- package/dist/agents/agents-registry.js.map +1 -1
- package/dist/agents/global-dirs.d.ts +19 -0
- package/dist/agents/global-dirs.js +53 -0
- package/dist/agents/global-dirs.js.map +1 -0
- package/dist/audit/fix-suggestions.js +6 -0
- package/dist/audit/fix-suggestions.js.map +1 -1
- package/dist/commands/add-github-bundle.d.ts +29 -0
- package/dist/commands/add-github-bundle.js +135 -0
- package/dist/commands/add-github-bundle.js.map +1 -0
- package/dist/commands/add-lockfile.d.ts +2 -0
- package/dist/commands/add-lockfile.js +1 -1
- package/dist/commands/add-lockfile.js.map +1 -1
- package/dist/commands/add.d.ts +5 -7
- package/dist/commands/add.js +207 -111
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/audit-webmcp.d.ts +25 -0
- package/dist/commands/audit-webmcp.js +167 -0
- package/dist/commands/audit-webmcp.js.map +1 -0
- package/dist/commands/doctor.d.ts +69 -0
- package/dist/commands/doctor.js +760 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/remove.js +43 -8
- package/dist/commands/remove.js.map +1 -1
- package/dist/commands/scan.js +1 -1
- package/dist/commands/scan.js.map +1 -1
- package/dist/commands/update.js +12 -4
- package/dist/commands/update.js.map +1 -1
- package/dist/discovery/github-skill-bundle.d.ts +74 -0
- package/dist/discovery/github-skill-bundle.js +323 -0
- package/dist/discovery/github-skill-bundle.js.map +1 -0
- package/dist/eval/skill-scanner.js +7 -1
- package/dist/eval/skill-scanner.js.map +1 -1
- package/dist/eval-server/install-skill-routes.js +10 -3
- package/dist/eval-server/install-skill-routes.js.map +1 -1
- package/dist/eval-server/remove-skill-routes.js +262 -29
- package/dist/eval-server/remove-skill-routes.js.map +1 -1
- package/dist/eval-server/studio-privacy.js +2 -3
- package/dist/eval-server/studio-privacy.js.map +1 -1
- package/dist/eval-server/utils/scan-install-locations.js +22 -3
- package/dist/eval-server/utils/scan-install-locations.js.map +1 -1
- package/dist/eval-ui/assets/{CreateSkillPage-BUrgworx.js → CreateSkillPage-CXDd6gDN.js} +1 -1
- package/dist/eval-ui/assets/{FindSkillsPalette-BstJ22TI.js → FindSkillsPalette-DQ6uGhFP.js} +2 -2
- package/dist/eval-ui/assets/{SearchPaletteCore-Dagnc-E7.js → SearchPaletteCore-DpHCf0mf.js} +1 -1
- package/dist/eval-ui/assets/{SkillDetailPanel-DnujVk6g.js → SkillDetailPanel-BjHFjGxg.js} +1 -1
- package/dist/eval-ui/assets/{UpdateDropdown-B7D2vXrm.js → UpdateDropdown-Cn4Vsq5d.js} +1 -1
- package/dist/eval-ui/assets/main-BmB7Zj9I.js +86 -0
- package/dist/eval-ui/index.html +1 -1
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -1
- package/dist/installer/bundle-files.d.ts +39 -2
- package/dist/installer/bundle-files.js +80 -10
- package/dist/installer/bundle-files.js.map +1 -1
- package/dist/installer/canonical.d.ts +39 -4
- package/dist/installer/canonical.js +178 -24
- package/dist/installer/canonical.js.map +1 -1
- package/dist/installer/multi-install.d.ts +11 -2
- package/dist/installer/multi-install.js +41 -9
- package/dist/installer/multi-install.js.map +1 -1
- package/dist/installer/transformers/index.d.ts +8 -0
- package/dist/installer/yaml-safe-mutate.js +48 -2
- package/dist/installer/yaml-safe-mutate.js.map +1 -1
- package/dist/lib/github-fetch.js +2 -0
- package/dist/lib/github-fetch.js.map +1 -1
- package/dist/lib/private-source.d.ts +8 -0
- package/dist/lib/private-source.js +16 -2
- package/dist/lib/private-source.js.map +1 -1
- package/dist/scanner/hidden-content.d.ts +47 -0
- package/dist/scanner/hidden-content.js +904 -0
- package/dist/scanner/hidden-content.js.map +1 -0
- package/dist/scanner/installer-hosts.d.ts +26 -0
- package/dist/scanner/installer-hosts.js +92 -0
- package/dist/scanner/installer-hosts.js.map +1 -0
- package/dist/scanner/judge-guard.d.ts +119 -0
- package/dist/scanner/judge-guard.js +481 -0
- package/dist/scanner/judge-guard.js.map +1 -0
- package/dist/scanner/patterns.d.ts +12 -0
- package/dist/scanner/patterns.js +353 -113
- package/dist/scanner/patterns.js.map +1 -1
- package/dist/scanner/repo-scanner.d.ts +4 -0
- package/dist/scanner/repo-scanner.js +4 -1
- package/dist/scanner/repo-scanner.js.map +1 -1
- package/dist/scanner/tier1.js +37 -7
- package/dist/scanner/tier1.js.map +1 -1
- package/dist/scanner/tier2-llm.d.ts +22 -4
- package/dist/scanner/tier2-llm.js +163 -23
- package/dist/scanner/tier2-llm.js.map +1 -1
- package/dist/scanner/types.d.ts +8 -0
- package/dist/webmcp/args.d.ts +34 -0
- package/dist/webmcp/args.js +87 -0
- package/dist/webmcp/args.js.map +1 -0
- package/dist/webmcp/attribution.d.ts +38 -0
- package/dist/webmcp/attribution.js +141 -0
- package/dist/webmcp/attribution.js.map +1 -0
- package/dist/webmcp/enumerate.d.ts +81 -0
- package/dist/webmcp/enumerate.js +436 -0
- package/dist/webmcp/enumerate.js.map +1 -0
- package/dist/webmcp/format.d.ts +9 -0
- package/dist/webmcp/format.js +105 -0
- package/dist/webmcp/format.js.map +1 -0
- package/dist/webmcp/merge.d.ts +49 -0
- package/dist/webmcp/merge.js +167 -0
- package/dist/webmcp/merge.js.map +1 -0
- package/dist/webmcp/score.d.ts +70 -0
- package/dist/webmcp/score.js +586 -0
- package/dist/webmcp/score.js.map +1 -0
- package/dist/webmcp/types.d.ts +92 -0
- package/dist/webmcp/types.js +8 -0
- package/dist/webmcp/types.js.map +1 -0
- package/package.json +1 -1
- package/dist/eval-ui/assets/main-DjA5gpjV.js +0 -86
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AgentDefinition } from "./agents-registry.js";
|
|
2
|
+
/** Antigravity's legacy IDE global skills folder. */
|
|
3
|
+
export declare const ANTIGRAVITY_LEGACY_GLOBAL_DIR = "~/.gemini/antigravity/skills";
|
|
4
|
+
type AgentDirs = Pick<AgentDefinition, "id" | "globalSkillsDir">;
|
|
5
|
+
/**
|
|
6
|
+
* The global skills dir vskill installs an agent's skills into. Antigravity:
|
|
7
|
+
* `VSKILL_ANTIGRAVITY_SKILLS_DIR`, then the legacy IDE dir when it already
|
|
8
|
+
* exists, else the registry default. Every other agent: its `globalSkillsDir`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveAgentGlobalSkillsDir(agent: AgentDirs, expand?: (p: string) => string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Every global dir vskill may have put this agent's skills in: the resolved
|
|
13
|
+
* dir first, then the registry default and, for Antigravity, the legacy IDE
|
|
14
|
+
* dir (installs went there while it existed). Used by remove, uninstall,
|
|
15
|
+
* Studio scans and detection so none of them miss an install. `expand`
|
|
16
|
+
* resolves a `~/` path (callers pass their own tilde resolver).
|
|
17
|
+
*/
|
|
18
|
+
export declare function agentGlobalInstallDirs(agent: AgentDirs, expand?: (p: string) => string): string[];
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// 0894: one resolver for an agent's global skills dir(s).
|
|
3
|
+
//
|
|
4
|
+
// Kept apart from agents-registry.ts on purpose: many command tests mock the
|
|
5
|
+
// registry module wholesale, and callers (remove, add, Studio scans) need
|
|
6
|
+
// these helpers to keep working under those mocks. Pure: depends only on the
|
|
7
|
+
// agent definition, $HOME and the filesystem.
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
import { existsSync } from "node:fs";
|
|
10
|
+
/** Antigravity's legacy IDE global skills folder. */
|
|
11
|
+
export const ANTIGRAVITY_LEGACY_GLOBAL_DIR = "~/.gemini/antigravity/skills";
|
|
12
|
+
function expandHome(p) {
|
|
13
|
+
if (p.startsWith("~/")) {
|
|
14
|
+
const home = process.env.HOME || process.env.USERPROFILE || "";
|
|
15
|
+
return home + p.slice(1);
|
|
16
|
+
}
|
|
17
|
+
return p;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The global skills dir vskill installs an agent's skills into. Antigravity:
|
|
21
|
+
* `VSKILL_ANTIGRAVITY_SKILLS_DIR`, then the legacy IDE dir when it already
|
|
22
|
+
* exists, else the registry default. Every other agent: its `globalSkillsDir`.
|
|
23
|
+
*/
|
|
24
|
+
export function resolveAgentGlobalSkillsDir(agent, expand = expandHome) {
|
|
25
|
+
if (agent.id === "antigravity") {
|
|
26
|
+
const override = process.env.VSKILL_ANTIGRAVITY_SKILLS_DIR;
|
|
27
|
+
if (override && override.trim().length > 0)
|
|
28
|
+
return override.trim();
|
|
29
|
+
const legacy = expand(ANTIGRAVITY_LEGACY_GLOBAL_DIR);
|
|
30
|
+
try {
|
|
31
|
+
if (existsSync(legacy))
|
|
32
|
+
return legacy;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
// fall through to the default
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return expand(agent.globalSkillsDir);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Every global dir vskill may have put this agent's skills in: the resolved
|
|
42
|
+
* dir first, then the registry default and, for Antigravity, the legacy IDE
|
|
43
|
+
* dir (installs went there while it existed). Used by remove, uninstall,
|
|
44
|
+
* Studio scans and detection so none of them miss an install. `expand`
|
|
45
|
+
* resolves a `~/` path (callers pass their own tilde resolver).
|
|
46
|
+
*/
|
|
47
|
+
export function agentGlobalInstallDirs(agent, expand = expandHome) {
|
|
48
|
+
const dirs = [resolveAgentGlobalSkillsDir(agent, expand), expand(agent.globalSkillsDir)];
|
|
49
|
+
if (agent.id === "antigravity")
|
|
50
|
+
dirs.push(expand(ANTIGRAVITY_LEGACY_GLOBAL_DIR));
|
|
51
|
+
return [...new Set(dirs)];
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=global-dirs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,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sB,CACpC,KAAgB,EAChB,SAAgC,UAAU;IAE1C,MAAM,IAAI,GAAG,CAAC,2BAA2B,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC;IACzF,IAAI,KAAK,CAAC,EAAE,KAAK,aAAa;QAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,CAAC;IACjF,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -44,6 +44,12 @@ export const FIX_SUGGESTIONS = {
|
|
|
44
44
|
"CE-001": "Replace eval() with JSON.parse() for data or Function constructor for code; never eval user input",
|
|
45
45
|
"CE-002": "Avoid new Function(); use explicit function definitions instead",
|
|
46
46
|
"CE-003": "Avoid dynamic imports with user-controlled paths; use a module allowlist",
|
|
47
|
+
"CE-004": "Never unpickle or exec decoded data; use a safe format such as JSON and import modules statically",
|
|
48
|
+
"CI-009": "Call subprocess with an argument list and shell=False instead of os.system/os.popen or shell=True",
|
|
49
|
+
"CI-010": "Avoid Invoke-Expression and encoded PowerShell commands; run reviewed scripts with explicit parameters",
|
|
50
|
+
"CI-011": "Download the PowerShell script, review it, then run it by path instead of piping irm/iwr output into iex",
|
|
51
|
+
"NA-004": "Do not ask users to download and run external binaries or scripts as a prerequisite; ship reviewed code with the skill or name a package-manager install",
|
|
52
|
+
"NA-005": "Do not distribute password-protected archives; publish contents that can be reviewed and scanned",
|
|
47
53
|
// --- DCI-abuse patterns ---
|
|
48
54
|
"DCI-001": "Remove DCI blocks that read credential files (~/.ssh/, ~/.aws/, .env); use a secrets manager instead",
|
|
49
55
|
"DCI-002": "Remove DCI blocks that write to agent config files (CLAUDE.md, .claude/); legitimate skills do not modify agent configuration",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fix-suggestions.js","sourceRoot":"","sources":["../../src/audit/fix-suggestions.ts"],"names":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QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACxB,MAAM,UAAU,GAAG,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAC7C,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,EAAE,GAAG,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;QAC5C,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type FetchSkillBundleArgs, type GitHubSkillBundle } from "../discovery/github-skill-bundle.js";
|
|
2
|
+
export interface BundleScanReport {
|
|
3
|
+
/** Files that block the install without --force, with the reasons. */
|
|
4
|
+
critical: Array<{
|
|
5
|
+
path: string;
|
|
6
|
+
findings: string[];
|
|
7
|
+
}>;
|
|
8
|
+
/** Files with non-blocking findings. */
|
|
9
|
+
flagged: string[];
|
|
10
|
+
}
|
|
11
|
+
/** ELF, Mach-O (thin + fat) or PE/COFF header. */
|
|
12
|
+
export declare function isNativeExecutable(path: string, bytes: Uint8Array): boolean;
|
|
13
|
+
export declare function scanSkillBundle(files: GitHubSkillBundle["files"], executables?: readonly string[]): BundleScanReport;
|
|
14
|
+
export type PreparedBundle = {
|
|
15
|
+
ok: true;
|
|
16
|
+
bundle: GitHubSkillBundle;
|
|
17
|
+
} | {
|
|
18
|
+
ok: false;
|
|
19
|
+
verdict: "BUNDLE_ERROR" | "FAIL";
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Download the skill folder and scan it. A failed download, a case
|
|
24
|
+
* collision or a blocking finding comes back as `ok: false`; an unlistable
|
|
25
|
+
* or over-limit folder comes back degraded with a warning printed.
|
|
26
|
+
*/
|
|
27
|
+
export declare function prepareGitHubSkillBundle(args: FetchSkillBundleArgs & {
|
|
28
|
+
force?: boolean;
|
|
29
|
+
}): Promise<PreparedBundle>;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// 0894: fetch + scan the complete folder of a GitHub skill for `vskill install`.
|
|
3
|
+
//
|
|
4
|
+
// Every bundled file goes through the same Tier-1 scanner as SKILL.md. Text
|
|
5
|
+
// is scanned as-is; files that are not valid UTF-8 are scanned lossily, so a
|
|
6
|
+
// stray NUL or 0xFF byte cannot hide `curl … | bash` from the scan.
|
|
7
|
+
//
|
|
8
|
+
// Blocking (unless --force):
|
|
9
|
+
// - a CRITICAL finding in any file, text or lossily decoded bytes — one
|
|
10
|
+
// stray 0xFF must not turn agents/x.md or a Makefile into a "binary";
|
|
11
|
+
// - an undecodable script-like file (mode 100755, `#!`, script extension)
|
|
12
|
+
// that cannot be decoded for scanning at all;
|
|
13
|
+
// - a native executable (ELF, Mach-O, PE, .node/.so/.dylib/.dll/.exe),
|
|
14
|
+
// which no static scan can vouch for.
|
|
15
|
+
// Lower severities are reported, not blocking: skill tooling scripts
|
|
16
|
+
// legitimately spawn processes and clean temp folders. Other binaries
|
|
17
|
+
// (fonts, audio, images) pass through.
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
import { fetchGitHubSkillBundle, SkillBundleError, } from "../discovery/github-skill-bundle.js";
|
|
20
|
+
import { runTier1Scan } from "../scanner/index.js";
|
|
21
|
+
import { dim, red, yellow } from "../utils/output.js";
|
|
22
|
+
const SCRIPT_EXTENSIONS = /\.(sh|bash|zsh|fish|ksh|py|pyw|rb|pl|php|js|mjs|cjs|ts|mts|cts|ps1|psm1|bat|cmd|vbs|lua|tcl|applescript|command)$/i;
|
|
23
|
+
const NATIVE_EXTENSIONS = /\.(node|so|dylib|dll|exe)$/i;
|
|
24
|
+
/** ELF, Mach-O (thin + fat) or PE/COFF header. */
|
|
25
|
+
export function isNativeExecutable(path, bytes) {
|
|
26
|
+
if (NATIVE_EXTENSIONS.test(path))
|
|
27
|
+
return true;
|
|
28
|
+
if (bytes.byteLength < 4)
|
|
29
|
+
return false;
|
|
30
|
+
const [a, b, c, d] = bytes;
|
|
31
|
+
if (a === 0x7f && b === 0x45 && c === 0x4c && d === 0x46)
|
|
32
|
+
return true; // \x7fELF
|
|
33
|
+
const be = ((a << 24) | (b << 16) | (c << 8) | d) >>> 0;
|
|
34
|
+
if ([0xfeedface, 0xfeedfacf, 0xcefaedfe, 0xcffaedfe, 0xcafebabe, 0xbebafeca].includes(be))
|
|
35
|
+
return true;
|
|
36
|
+
if (a === 0x4d && b === 0x5a && bytes.byteLength >= 64)
|
|
37
|
+
return true; // MZ
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
function looksLikeScript(path, bytes, executable) {
|
|
41
|
+
return executable || (bytes[0] === 0x23 && bytes[1] === 0x21) || SCRIPT_EXTENSIONS.test(path);
|
|
42
|
+
}
|
|
43
|
+
function criticalOf(text) {
|
|
44
|
+
return runTier1Scan(text).findings
|
|
45
|
+
.filter((f) => f.severity === "critical")
|
|
46
|
+
.map((f) => `${f.patternId} ${f.patternName} (line ${f.lineNumber})`);
|
|
47
|
+
}
|
|
48
|
+
function hasFindings(text) {
|
|
49
|
+
return runTier1Scan(text).findings.some((f) => f.severity !== "info");
|
|
50
|
+
}
|
|
51
|
+
export function scanSkillBundle(files, executables = []) {
|
|
52
|
+
const report = { critical: [], flagged: [] };
|
|
53
|
+
const exec = new Set(executables);
|
|
54
|
+
for (const [path, content] of Object.entries(files).sort(([a], [b]) => a.localeCompare(b))) {
|
|
55
|
+
if (typeof content === "string") {
|
|
56
|
+
const crit = criticalOf(content);
|
|
57
|
+
if (crit.length > 0)
|
|
58
|
+
report.critical.push({ path, findings: crit });
|
|
59
|
+
else if (hasFindings(content))
|
|
60
|
+
report.flagged.push(path);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
if (isNativeExecutable(path, content)) {
|
|
64
|
+
report.critical.push({ path, findings: ["native executable: cannot be scanned"] });
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const scriptLike = looksLikeScript(path, content, exec.has(path));
|
|
68
|
+
let text;
|
|
69
|
+
try {
|
|
70
|
+
// Lossy: invalid sequences become U+FFFD, NULs are dropped so they
|
|
71
|
+
// cannot split a pattern such as `cu\0rl | bash`.
|
|
72
|
+
text = new TextDecoder("utf-8").decode(content).replace(/\0/g, "");
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
if (scriptLike)
|
|
76
|
+
report.critical.push({ path, findings: ["script that cannot be scanned"] });
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const crit = criticalOf(text);
|
|
80
|
+
if (crit.length > 0)
|
|
81
|
+
report.critical.push({ path, findings: crit });
|
|
82
|
+
else if (scriptLike && hasFindings(text))
|
|
83
|
+
report.flagged.push(path);
|
|
84
|
+
}
|
|
85
|
+
return report;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Download the skill folder and scan it. A failed download, a case
|
|
89
|
+
* collision or a blocking finding comes back as `ok: false`; an unlistable
|
|
90
|
+
* or over-limit folder comes back degraded with a warning printed.
|
|
91
|
+
*/
|
|
92
|
+
export async function prepareGitHubSkillBundle(args) {
|
|
93
|
+
let bundle;
|
|
94
|
+
try {
|
|
95
|
+
bundle = await fetchGitHubSkillBundle(args);
|
|
96
|
+
}
|
|
97
|
+
catch (err) {
|
|
98
|
+
const message = err instanceof SkillBundleError
|
|
99
|
+
? err.message
|
|
100
|
+
: `Could not fetch the skill folder: ${err instanceof Error ? err.message : String(err)}`;
|
|
101
|
+
return { ok: false, verdict: "BUNDLE_ERROR", message };
|
|
102
|
+
}
|
|
103
|
+
if (bundle.degraded) {
|
|
104
|
+
console.log(yellow(` WARNING: could not install the complete skill folder (${bundle.degraded}).\n` +
|
|
105
|
+
` Installed SKILL.md and up to 100 files from its standard folders; the skill may be incomplete.`));
|
|
106
|
+
}
|
|
107
|
+
const binaries = Object.values(bundle.files).filter((v) => typeof v !== "string").length;
|
|
108
|
+
console.log(dim(` Skill folder: ${bundle.fileList.length} file${bundle.fileList.length === 1 ? "" : "s"}` +
|
|
109
|
+
(binaries > 0 ? ` (${binaries} binary)` : "") +
|
|
110
|
+
(bundle.executables.length > 0 ? `, ${bundle.executables.length} executable` : "")));
|
|
111
|
+
for (const s of bundle.skipped) {
|
|
112
|
+
console.log(yellow(` Not installed: ${s.path} (${s.reason})`));
|
|
113
|
+
}
|
|
114
|
+
const scan = scanSkillBundle(bundle.files, bundle.executables);
|
|
115
|
+
if (scan.flagged.length > 0) {
|
|
116
|
+
const list = scan.flagged.slice(0, 5).join(", ") + (scan.flagged.length > 5 ? ", ..." : "");
|
|
117
|
+
console.log(dim(` Non-blocking scan findings in ${scan.flagged.length} bundled file(s): ${list}`));
|
|
118
|
+
}
|
|
119
|
+
if (scan.critical.length > 0) {
|
|
120
|
+
const lines = scan.critical
|
|
121
|
+
.slice(0, 10)
|
|
122
|
+
.map((c) => ` ${c.path}: ${c.findings.slice(0, 3).join("; ")}`)
|
|
123
|
+
.join("\n");
|
|
124
|
+
if (!args.force) {
|
|
125
|
+
return {
|
|
126
|
+
ok: false,
|
|
127
|
+
verdict: "FAIL",
|
|
128
|
+
message: `Blocking findings in ${scan.critical.length} bundled file(s):\n${lines}\n Use --force to install anyway (not recommended).`,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
console.log(red(` --force: installing despite blocking findings in bundled files:\n${lines}`));
|
|
132
|
+
}
|
|
133
|
+
return { ok: true, bundle };
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=add-github-bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-github-bundle.js","sourceRoot":"","sources":["../../src/commands/add-github-bundle.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,iFAAiF;AACjF,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,oEAAoE;AACpE,EAAE;AACF,6BAA6B;AAC7B,0EAA0E;AAC1E,0EAA0E;AAC1E,4EAA4E;AAC5E,kDAAkD;AAClD,yEAAyE;AACzE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AAE,CAAC;aACjE,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,OAAO,EAAE,MAAM;gBACf,OAAO,EAAE,wBAAwB,IAAI,CAAC,QAAQ,CAAC,MAAM,sBAAsB,KAAK,sDAAsD;aACvI,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,sEAAsE,KAAK,EAAE,CAAC,CAAC,CAAC;IAClG,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -27,5 +27,7 @@ export interface BuildGitHubInstallLockEntryArgs {
|
|
|
27
27
|
global: boolean;
|
|
28
28
|
/** ISO timestamp; injected for deterministic tests, defaults to `now`. */
|
|
29
29
|
installedAt?: string;
|
|
30
|
+
/** 0894: every installed file relative to the skill folder (defaults to SKILL.md). */
|
|
31
|
+
files?: string[];
|
|
30
32
|
}
|
|
31
33
|
export declare function buildGitHubInstallLockEntry(args: BuildGitHubInstallLockEntryArgs): SkillLockEntry;
|
|
@@ -6,7 +6,7 @@ export function buildGitHubInstallLockEntry(args) {
|
|
|
6
6
|
installedAt: args.installedAt ?? new Date().toISOString(),
|
|
7
7
|
source: `github:${args.owner}/${args.repo}`,
|
|
8
8
|
scope: args.global ? "user" : "project",
|
|
9
|
-
files: ["SKILL.md"],
|
|
9
|
+
files: args.files && args.files.length > 0 ? [...args.files] : ["SKILL.md"],
|
|
10
10
|
sourceType: "github",
|
|
11
11
|
sourceRepoUrl: `https://github.com/${args.owner}/${args.repo}`,
|
|
12
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-lockfile.js","sourceRoot":"","sources":["../../src/commands/add-lockfile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-lockfile.js","sourceRoot":"","sources":["../../src/commands/add-l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
|
1
1
|
import type { AgentDefinition } from "../agents/agents-registry.js";
|
|
2
|
-
/**
|
|
3
|
-
* Subdirectories fetched alongside SKILL.md when installing a skill that lives
|
|
4
|
-
* in a repo subdirectory. Must stay a subset of the prefixes the installer
|
|
5
|
-
* accepts in installer/bundle-files.ts, or the write is rejected.
|
|
6
|
-
*/
|
|
7
|
-
export declare const BUNDLE_SUBDIRS: readonly ["agents", "references", "scripts", "assets", "tests"];
|
|
8
|
-
export declare function isBundleTextFile(name: string): boolean;
|
|
9
2
|
interface MarketplaceDetectionResult {
|
|
10
3
|
isMarketplace: boolean;
|
|
11
4
|
manifestContent?: string;
|
|
@@ -80,4 +73,9 @@ export declare function enableAfterInstall(skillName: string, entry: {
|
|
|
80
73
|
* @internal exported for unit tests; see `enableAfterInstall` note above.
|
|
81
74
|
*/
|
|
82
75
|
export declare function rollbackInstall(skillName: string, agents: AgentDefinition[], opts: AddOptions): void;
|
|
76
|
+
/**
|
|
77
|
+
* Collect all file contents from a plugin directory for security scanning.
|
|
78
|
+
* Concatenates content from all readable files.
|
|
79
|
+
*/
|
|
80
|
+
export declare function collectPluginContent(pluginDir: string): string;
|
|
83
81
|
export declare function addCommand(source: string | undefined, opts: AddOptions): Promise<void>;
|