@shieldaai/security-watch 0.0.0-stage → 1.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.
Files changed (110) hide show
  1. package/CHANGELOG.md +170 -0
  2. package/CONTRIBUTING.md +92 -0
  3. package/LICENSE +202 -0
  4. package/README.md +394 -2
  5. package/SECURITY.md +62 -0
  6. package/dist/assessment.d.ts +16 -0
  7. package/dist/assessment.js +569 -0
  8. package/dist/cli.d.ts +2 -0
  9. package/dist/cli.js +1105 -0
  10. package/dist/config.d.ts +302 -0
  11. package/dist/config.js +381 -0
  12. package/dist/coverage.d.ts +4 -0
  13. package/dist/coverage.js +11 -0
  14. package/dist/cve-now.d.ts +35 -0
  15. package/dist/cve-now.js +1002 -0
  16. package/dist/cvss4.d.ts +3 -0
  17. package/dist/cvss4.js +39 -0
  18. package/dist/delivery.d.ts +58 -0
  19. package/dist/delivery.js +687 -0
  20. package/dist/ecosystems.d.ts +48 -0
  21. package/dist/ecosystems.js +332 -0
  22. package/dist/engine.d.ts +80 -0
  23. package/dist/engine.js +388 -0
  24. package/dist/everyday-words.d.ts +11 -0
  25. package/dist/everyday-words.js +256 -0
  26. package/dist/health.d.ts +24 -0
  27. package/dist/health.js +122 -0
  28. package/dist/heartbeat.d.ts +13 -0
  29. package/dist/heartbeat.js +74 -0
  30. package/dist/http.d.ts +15 -0
  31. package/dist/http.js +280 -0
  32. package/dist/index.d.ts +36 -0
  33. package/dist/index.js +23 -0
  34. package/dist/inventory-evidence.d.ts +10 -0
  35. package/dist/inventory-evidence.js +206 -0
  36. package/dist/inventory.d.ts +276 -0
  37. package/dist/inventory.js +336 -0
  38. package/dist/lock.d.ts +3 -0
  39. package/dist/lock.js +112 -0
  40. package/dist/maintenance.d.ts +48 -0
  41. package/dist/maintenance.js +295 -0
  42. package/dist/matching.d.ts +29 -0
  43. package/dist/matching.js +537 -0
  44. package/dist/models.d.ts +33 -0
  45. package/dist/models.js +932 -0
  46. package/dist/operations.d.ts +17 -0
  47. package/dist/operations.js +117 -0
  48. package/dist/pilot-cases.d.ts +171 -0
  49. package/dist/pilot-cases.js +330 -0
  50. package/dist/pilot-input.d.ts +16 -0
  51. package/dist/pilot-input.js +125 -0
  52. package/dist/pilot-recall.d.ts +166 -0
  53. package/dist/pilot-recall.js +231 -0
  54. package/dist/pilot-report.d.ts +113 -0
  55. package/dist/pilot-report.js +279 -0
  56. package/dist/pilot-responses.d.ts +111 -0
  57. package/dist/pilot-responses.js +159 -0
  58. package/dist/providers.d.ts +209 -0
  59. package/dist/providers.js +459 -0
  60. package/dist/python-version.d.ts +3 -0
  61. package/dist/python-version.js +30 -0
  62. package/dist/rehearsal.d.ts +440 -0
  63. package/dist/rehearsal.js +372 -0
  64. package/dist/sbom.d.ts +13 -0
  65. package/dist/sbom.js +193 -0
  66. package/dist/setup.d.ts +113 -0
  67. package/dist/setup.js +100 -0
  68. package/dist/source-error.d.ts +38 -0
  69. package/dist/source-error.js +71 -0
  70. package/dist/sources.d.ts +3 -0
  71. package/dist/sources.js +1725 -0
  72. package/dist/store.d.ts +96 -0
  73. package/dist/store.js +953 -0
  74. package/dist/types.d.ts +404 -0
  75. package/dist/types.js +1 -0
  76. package/dist/util.d.ts +29 -0
  77. package/dist/util.js +94 -0
  78. package/dist/vendor/cvss4-reference.d.ts +2 -0
  79. package/dist/vendor/cvss4-reference.js +789 -0
  80. package/dist/vendor-sources.d.ts +24 -0
  81. package/dist/vendor-sources.js +56 -0
  82. package/dist/word-filter.d.ts +3 -0
  83. package/dist/word-filter.js +3291 -0
  84. package/docs/alert-outcome-evaluation.md +150 -0
  85. package/docs/compatibility.md +35 -0
  86. package/docs/configuration.md +666 -0
  87. package/docs/cvss-v4-support.md +41 -0
  88. package/docs/offline-advisory-preview.md +114 -0
  89. package/docs/offline-rehearsal.md +44 -0
  90. package/docs/pilot-cases.md +58 -0
  91. package/docs/pilot-recall.md +124 -0
  92. package/docs/pilot-report.md +52 -0
  93. package/docs/validation/alert-outcome-evaluation-2026-11-05.json +2935 -0
  94. package/docs/validation/cvss-v4-reference-parity-2026-11-05.json +93 -0
  95. package/docs/validation/rehearsal-accepted-2026-11-05.json +175 -0
  96. package/docs/validation/rehearsal-unknown-2026-11-05.json +175 -0
  97. package/docs/vendor/cvss-v4-LICENSE.txt +22 -0
  98. package/docs/vendor/cvss-v4-provenance.json +38 -0
  99. package/examples/advisories.json +17 -0
  100. package/examples/agent-advisories-2026.json +145 -0
  101. package/examples/agent-advisory-cases-2026.json +397 -0
  102. package/examples/common-systems.yaml +243 -0
  103. package/examples/libraries.example.txt +18 -0
  104. package/examples/libraries.example.yaml +40 -0
  105. package/examples/library-watch.example.yaml +27 -0
  106. package/examples/offline-advisory-preview.mjs +42 -0
  107. package/examples/rehearsal.json +75 -0
  108. package/examples/security-watch.example.yaml +86 -0
  109. package/examples/systems.example.yaml +35 -0
  110. package/package.json +85 -4
@@ -0,0 +1,96 @@
1
+ import type { AiReview, Assessment, Config, Decision, Evidence, Notification } from './types.js';
2
+ import { type PilotWindow, type PilotReport } from './pilot-report.js';
3
+ import { type PruneReport, type RetentionPolicy } from './maintenance.js';
4
+ export declare const SCHEMA_VERSION = 7;
5
+ /** Durable state for one local worker. Stores evidence and results, never provider credentials. */
6
+ export declare class Store {
7
+ #private;
8
+ /** Collect one consistent read-only snapshot from an existing local database. */
9
+ static readPilotReport(database: string, window: PilotWindow): PilotReport;
10
+ constructor(path: string, options?: {
11
+ readOnly?: boolean;
12
+ migrate?: boolean;
13
+ });
14
+ close(): void;
15
+ saveEvidence(evidence: Evidence[], checkpoints: Record<string, string>): void;
16
+ evidence(): Evidence[];
17
+ getEvidence(ids: readonly string[]): Evidence[];
18
+ evidenceHistory(source: string, id: string): {
19
+ content_hash: string;
20
+ evidence: Evidence;
21
+ recorded_at: number;
22
+ }[];
23
+ checkpoints(): Record<string, string>;
24
+ saveAssessment(assessment: Assessment, decision: Decision, now?: number, digestMs?: number, reviewBasis?: string): void;
25
+ /** Bounded local queue. Cursor is the stable (created_at, finding_id, revision) tuple. */
26
+ reviews(options?: {
27
+ includeResolved?: boolean;
28
+ limit?: number;
29
+ after?: {
30
+ created_at: number;
31
+ finding_id: string;
32
+ revision: number;
33
+ };
34
+ }): AiReview[];
35
+ reviewSummary(now?: number): {
36
+ pending: number;
37
+ investigate: number;
38
+ oldest_open_at: number | null;
39
+ oldest_open_age_ms: number | null;
40
+ };
41
+ /** OS/private database access authenticates this local operation; reviewer is a declared label. */
42
+ reviewFinding(id: string, revision: number, decision: {
43
+ disposition: 'dismiss' | 'investigate';
44
+ reviewer: string;
45
+ reason: string;
46
+ }, now?: number): void;
47
+ findings(): Assessment[];
48
+ getFinding(id: string): Assessment | undefined;
49
+ controls(id: string, now?: number): {
50
+ revision: number;
51
+ acknowledged: boolean;
52
+ acknowledged_revision: number | null;
53
+ suppressed: boolean;
54
+ suppressed_until: number | null;
55
+ suppression_reason: string | null;
56
+ } | undefined;
57
+ summary(): {
58
+ active_findings: number;
59
+ delivery_states: Record<string, number>;
60
+ pending: number;
61
+ next_pending_at: number | null;
62
+ };
63
+ deliveryIssues(now?: number, maxPendingAgeMs?: number, config?: Config): {
64
+ failed: number;
65
+ unknown: number;
66
+ overdue_pending: number;
67
+ };
68
+ history(id: string): {
69
+ revision: number;
70
+ assessment: Assessment;
71
+ decision: Decision;
72
+ recorded_at: number;
73
+ }[];
74
+ jobs(): Notification[];
75
+ retryJob(id: string, now?: number): void;
76
+ /** The current revision number of a finding, or undefined when it does not exist. */
77
+ revisionOf(id: string): number | undefined;
78
+ /** Acknowledge the current revision. Pass the revision that was read to refuse a newer, unseen one. */
79
+ acknowledge(id: string, revision?: number): number;
80
+ suppress(id: string, until: number, reason: string): void;
81
+ prune(policy: RetentionPolicy, now?: number, apply?: boolean): PruneReport;
82
+ budgets(): {
83
+ day: string;
84
+ requests: number;
85
+ tokens: number;
86
+ usd: number | null;
87
+ known_usd?: number;
88
+ unpriced_requests?: number;
89
+ }[];
90
+ /**
91
+ * Write a snapshot and publish it at `path`. When `verify` is given it checks the snapshot first,
92
+ * and a snapshot that fails is removed instead of being left at the destination.
93
+ */
94
+ backup(path: string, verify?: (snapshot: string) => Promise<void>): Promise<void>;
95
+ }
96
+ export declare const readPilotReport: typeof Store.readPilotReport;