feat(llm-security-copilot): port llm-security v5.1.0 to GitHub Copilot CLI
Full port of llm-security plugin for internal use on Windows with GitHub Copilot CLI. Protocol translation layer (copilot-hook-runner.mjs) normalizes Copilot camelCase I/O to Claude Code snake_case format — all original hook scripts run unmodified. - 8 hooks with protocol translation (stdin/stdout/exit code) - 18 SKILL.md skills (Agent Skills Open Standard) - 6 .agent.md agent definitions - 20 scanners + 14 scanner lib modules (unchanged) - 14 knowledge files (unchanged) - 39 test files including copilot-port-verify.mjs (17 tests) - Windows-ready: node:path, os.tmpdir(), process.execPath, no bash Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
901bf0ae12
commit
f418a8fe08
169 changed files with 37631 additions and 0 deletions
19
plugins/llm-security-copilot/hooks/scripts/lib/cache-dir.mjs
Normal file
19
plugins/llm-security-copilot/hooks/scripts/lib/cache-dir.mjs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// cache-dir.mjs — Cross-platform cache directory resolution.
|
||||
// Windows: %LOCALAPPDATA%/llm-security or %APPDATA%/llm-security
|
||||
// macOS/Linux: ~/.cache/llm-security (XDG_CACHE_HOME fallback)
|
||||
|
||||
import { homedir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
|
||||
export function getCacheDir() {
|
||||
if (process.platform === 'win32') {
|
||||
const localAppData = process.env.LOCALAPPDATA;
|
||||
if (localAppData) return join(localAppData, 'llm-security');
|
||||
const appData = process.env.APPDATA;
|
||||
if (appData) return join(appData, 'llm-security');
|
||||
return join(homedir(), '.cache', 'llm-security');
|
||||
}
|
||||
const xdg = process.env.XDG_CACHE_HOME;
|
||||
if (xdg) return join(xdg, 'llm-security');
|
||||
return join(homedir(), '.cache', 'llm-security');
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue