From 503af7afa64fcc6d1ef52992e7e33cc4c4cb11a1 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Tue, 21 Apr 2026 00:32:31 +0100 Subject: [PATCH] refactor: dedupe install scan skill spec --- src/plugins/install-security-scan.runtime.ts | 48 ++++++++------------ 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/src/plugins/install-security-scan.runtime.ts b/src/plugins/install-security-scan.runtime.ts index c060cebdbbd..c8924f22e63 100644 --- a/src/plugins/install-security-scan.runtime.ts +++ b/src/plugins/install-security-scan.runtime.ts @@ -72,6 +72,22 @@ type PluginInstallRequestKind = | "plugin-file" | "plugin-npm"; +type SkillInstallSpec = { + id?: string; + kind: "brew" | "node" | "go" | "uv" | "download"; + label?: string; + bins?: string[]; + os?: string[]; + formula?: string; + package?: string; + module?: string; + url?: string; + archive?: string; + extract?: boolean; + stripComponents?: number; + targetDir?: string; +}; + export type InstallSecurityScanResult = { blocked?: { code?: "security_scan_blocked" | "security_scan_failed"; @@ -581,21 +597,7 @@ async function runBeforeInstallHook(params: { builtinScan: BuiltinInstallScan; skill?: { installId: string; - installSpec?: { - id?: string; - kind: "brew" | "node" | "go" | "uv" | "download"; - label?: string; - bins?: string[]; - os?: string[]; - formula?: string; - package?: string; - module?: string; - url?: string; - archive?: string; - extract?: boolean; - stripComponents?: number; - targetDir?: string; - }; + installSpec?: SkillInstallSpec; }; plugin?: { contentType: "bundle" | "package" | "file"; @@ -843,21 +845,7 @@ export async function scanFileInstallSourceRuntime( export async function scanSkillInstallSourceRuntime(params: { dangerouslyForceUnsafeInstall?: boolean; installId: string; - installSpec?: { - id?: string; - kind: "brew" | "node" | "go" | "uv" | "download"; - label?: string; - bins?: string[]; - os?: string[]; - formula?: string; - package?: string; - module?: string; - url?: string; - archive?: string; - extract?: boolean; - stripComponents?: number; - targetDir?: string; - }; + installSpec?: SkillInstallSpec; logger: InstallScanLogger; origin: string; skillName: string;