mirror of
https://github.com/prompt-security/clawsec.git
synced 2026-06-13 13:38:03 +03:00
382db82483
* feat: add severity filter tabs to advisory feed page Add horizontal severity filter tabs (All, Critical, High, Medium, Low) to the advisory feed page. Advisories are filtered by CVSS score ranges matching NVD conventions. Tab counts update dynamically. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: extract severity filter tabs into data-driven map Replace five duplicated button blocks with a SEVERITY_TABS metadata array and a single .map() loop. Class strings are kept as full literals for Tailwind purge compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: replace filteredAdvisories state with useMemo filteredAdvisories is derived from advisories + selectedSeverity and should not be independent state. Replace useState + filtering useEffect with a single useMemo. Keep a minimal useEffect that only resets currentPage on dependency changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add platform filter tabs (OpenClaw / NanoClaw) to advisory feed Add a second row of filter tabs for platform selection using the clawd color palette. Add platforms field to Advisory type to match feed data. Both severity and platform filters compose via useMemo. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: extract shared FilterTabs component and treat missing platforms as universal Extract a reusable FilterTabs component so severity and platform tab rows share identical markup. Fix platform filter to treat advisories with missing or empty platforms as matching all platforms, preventing legacy entries from being silently dropped. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
124 lines
2.4 KiB
TypeScript
124 lines
2.4 KiB
TypeScript
export interface Skill {
|
|
id: string;
|
|
name: string;
|
|
version: string;
|
|
description: string;
|
|
installCommand: string;
|
|
hash: string;
|
|
tags: string[];
|
|
}
|
|
|
|
export interface FeedItem {
|
|
id: string;
|
|
date: string;
|
|
severity: 'low' | 'medium' | 'high' | 'critical';
|
|
title: string;
|
|
description: string;
|
|
}
|
|
|
|
export type AdvisoryType =
|
|
| 'malicious_skill'
|
|
| 'vulnerable_skill'
|
|
| 'prompt_injection'
|
|
| 'attack_pattern'
|
|
| 'best_practice'
|
|
| 'tampering_attempt'
|
|
// NVD CVE advisories use normalized weakness names (for example:
|
|
// "missing_authentication_for_critical_function", "os_command_injection").
|
|
// Keep this open for new categories without requiring type updates.
|
|
| string;
|
|
|
|
// Full advisory type from NVD CVE feed or community reports
|
|
export interface Advisory {
|
|
id: string;
|
|
severity: 'low' | 'medium' | 'high' | 'critical';
|
|
type: AdvisoryType;
|
|
title: string;
|
|
description: string;
|
|
affected?: string[];
|
|
action: string;
|
|
published: string;
|
|
references?: string[];
|
|
cvss_score?: number | null;
|
|
nvd_url?: string;
|
|
platforms?: string[];
|
|
// Community report fields (source defaults to "Prompt Security Staff" when absent)
|
|
source?: string;
|
|
github_issue_url?: string;
|
|
reporter?: {
|
|
agent_name?: string;
|
|
opener_type?: 'human' | 'agent';
|
|
};
|
|
}
|
|
|
|
export interface AdvisoryFeed {
|
|
version: string;
|
|
updated: string;
|
|
description: string;
|
|
advisories: Advisory[];
|
|
}
|
|
|
|
export interface NavItem {
|
|
label: string;
|
|
path: string;
|
|
external?: boolean;
|
|
}
|
|
|
|
// Multi-skill distribution types
|
|
|
|
export interface SkillMetadata {
|
|
id: string;
|
|
name: string;
|
|
version: string;
|
|
description: string;
|
|
emoji: string;
|
|
category: string;
|
|
tag: string;
|
|
}
|
|
|
|
export interface SkillsIndex {
|
|
version: string;
|
|
updated: string;
|
|
skills: SkillMetadata[];
|
|
}
|
|
|
|
export interface SkillChecksums {
|
|
skill: string;
|
|
version: string;
|
|
generated_at: string;
|
|
repository: string;
|
|
tag: string;
|
|
files: Record<string, {
|
|
sha256: string;
|
|
size: number;
|
|
path?: string;
|
|
url: string;
|
|
}>;
|
|
}
|
|
|
|
export interface SkillJson {
|
|
name: string;
|
|
version: string;
|
|
description: string;
|
|
author: string;
|
|
license: string;
|
|
homepage: string;
|
|
keywords: string[];
|
|
sbom: {
|
|
files: Array<{
|
|
path: string;
|
|
required: boolean;
|
|
description: string;
|
|
}>;
|
|
};
|
|
openclaw: {
|
|
emoji: string;
|
|
category: string;
|
|
feed_url?: string;
|
|
requires?: {
|
|
bins?: string[];
|
|
};
|
|
triggers: string[];
|
|
};
|
|
}
|