echelongraph-mcp 2.7.1 → 3.0.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.
@@ -0,0 +1,28 @@
1
+ // fix_status (#2841, #2518 item 3): the API's fix-status rule for a CVE (core-backend
2
+ // internal/cve/fixstatus.go, the rule CVE Pulse pages render), as get_cve's remediation summary
3
+ // (its first field) and cve_remediation's answer carry it. Relayed, never derived here.
4
+ //
5
+ // A module of its own, importing only zod: index.ts and tools/cve_remediation.ts import each
6
+ // other, so a const shared between them would be read before it is initialised whichever loads
7
+ // first.
8
+ import * as z from "zod";
9
+ export const FIX_STATES = ["available", "fix_referenced", "fix_merged", "none_confirmed", "unknown"];
10
+ export const FIX_STATUS_FIELD = "The API's fix-status rule for the CVE, the one CVE Pulse pages show: state is available (a fix is on record), fix_referenced (a reference tagged Patch, often a source commit, and no release confirmed), fix_merged (an upstream fix merged, not yet in a tagged release), none_confirmed (no fix evidence on record, which is not a finding that no fix exists) or unknown (an input could not be read). basis is the step of the rule that decided it; described_by is the CVE description's sentence naming the fix, solution_by the CVE record's solution sentence naming it (statement) and the CNA that wrote it (cna), stated_in_record that patch_evidence counts a fix the CVE record states with no sentence to quote, listed_in_patch_table that a fixed version or patch row is on record; unread_inputs names any input the API could not read.";
11
+ const opt = (t) => t.nullable().optional();
12
+ export function fixStatusSchema() {
13
+ return z
14
+ .looseObject({
15
+ // A state a later API adds is admitted, never a failed call.
16
+ state: opt(z.union([z.enum(FIX_STATES), z.string()])),
17
+ basis: opt(z.string()),
18
+ described_by: opt(z.string()),
19
+ // #3076 (merged from 24dad5eb): the CVE record's own fix sentence, and its CNA.
20
+ solution_by: opt(z.looseObject({ statement: opt(z.string()), cna: opt(z.string()) })),
21
+ stated_in_record: opt(z.boolean()),
22
+ listed_in_patch_table: opt(z.boolean()),
23
+ unread_inputs: opt(z.array(z.string())),
24
+ })
25
+ .nullable()
26
+ .optional()
27
+ .describe(FIX_STATUS_FIELD);
28
+ }