@shieldaai/security-watch 0.0.0-stage → 0.1.0-alpha.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 (62) hide show
  1. package/CONTRIBUTING.md +90 -0
  2. package/LICENSE +202 -0
  3. package/README.md +269 -2
  4. package/SECURITY.md +47 -0
  5. package/dist/assessment.d.ts +5 -0
  6. package/dist/assessment.js +398 -0
  7. package/dist/cli.d.ts +2 -0
  8. package/dist/cli.js +792 -0
  9. package/dist/config.d.ts +242 -0
  10. package/dist/config.js +298 -0
  11. package/dist/cve-now.d.ts +5 -0
  12. package/dist/cve-now.js +413 -0
  13. package/dist/delivery.d.ts +26 -0
  14. package/dist/delivery.js +394 -0
  15. package/dist/ecosystems.d.ts +25 -0
  16. package/dist/ecosystems.js +254 -0
  17. package/dist/engine.d.ts +26 -0
  18. package/dist/engine.js +307 -0
  19. package/dist/health.d.ts +17 -0
  20. package/dist/health.js +70 -0
  21. package/dist/heartbeat.d.ts +13 -0
  22. package/dist/heartbeat.js +74 -0
  23. package/dist/http.d.ts +8 -0
  24. package/dist/http.js +251 -0
  25. package/dist/index.d.ts +18 -0
  26. package/dist/index.js +15 -0
  27. package/dist/inventory.d.ts +3 -0
  28. package/dist/inventory.js +143 -0
  29. package/dist/lock.d.ts +3 -0
  30. package/dist/lock.js +112 -0
  31. package/dist/maintenance.d.ts +43 -0
  32. package/dist/maintenance.js +227 -0
  33. package/dist/models.d.ts +20 -0
  34. package/dist/models.js +602 -0
  35. package/dist/operations.d.ts +17 -0
  36. package/dist/operations.js +117 -0
  37. package/dist/providers.d.ts +209 -0
  38. package/dist/providers.js +459 -0
  39. package/dist/setup.d.ts +113 -0
  40. package/dist/setup.js +100 -0
  41. package/dist/source-error.d.ts +22 -0
  42. package/dist/source-error.js +56 -0
  43. package/dist/sources.d.ts +3 -0
  44. package/dist/sources.js +1071 -0
  45. package/dist/store.d.ts +71 -0
  46. package/dist/store.js +651 -0
  47. package/dist/types.d.ts +247 -0
  48. package/dist/types.js +1 -0
  49. package/dist/util.d.ts +6 -0
  50. package/dist/util.js +14 -0
  51. package/dist/vendor-sources.d.ts +24 -0
  52. package/dist/vendor-sources.js +56 -0
  53. package/docs/configuration.md +406 -0
  54. package/docs/quality-review.md +104 -0
  55. package/examples/advisories.json +17 -0
  56. package/examples/common-systems.yaml +243 -0
  57. package/examples/libraries.example.txt +16 -0
  58. package/examples/libraries.example.yaml +38 -0
  59. package/examples/library-watch.example.yaml +27 -0
  60. package/examples/security-watch.example.yaml +86 -0
  61. package/examples/systems.example.yaml +31 -0
  62. package/package.json +69 -4
@@ -0,0 +1,71 @@
1
+ import type { Assessment, Config, Decision, Evidence, Notification } from './types.js';
2
+ import { type PruneReport, type RetentionPolicy } from './maintenance.js';
3
+ export declare const SCHEMA_VERSION = 5;
4
+ /** Durable state for one local worker. Stores evidence and results, never provider credentials. */
5
+ export declare class Store {
6
+ #private;
7
+ constructor(path: string, options?: {
8
+ readOnly?: boolean;
9
+ migrate?: boolean;
10
+ });
11
+ close(): void;
12
+ saveEvidence(evidence: Evidence[], checkpoints: Record<string, string>): void;
13
+ evidence(): Evidence[];
14
+ getEvidence(ids: readonly string[]): Evidence[];
15
+ evidenceHistory(source: string, id: string): {
16
+ content_hash: string;
17
+ evidence: Evidence;
18
+ recorded_at: number;
19
+ }[];
20
+ checkpoints(): Record<string, string>;
21
+ saveAssessment(assessment: Assessment, decision: Decision, now?: number, digestMs?: number): void;
22
+ findings(): Assessment[];
23
+ getFinding(id: string): Assessment | undefined;
24
+ controls(id: string, now?: number): {
25
+ revision: number;
26
+ acknowledged: boolean;
27
+ acknowledged_revision: number | null;
28
+ suppressed: boolean;
29
+ suppressed_until: number | null;
30
+ suppression_reason: string | null;
31
+ } | undefined;
32
+ summary(): {
33
+ active_findings: number;
34
+ delivery_states: Record<string, number>;
35
+ pending: number;
36
+ next_pending_at: number | null;
37
+ };
38
+ deliveryIssues(now?: number, maxPendingAgeMs?: number, config?: Config): {
39
+ failed: number;
40
+ unknown: number;
41
+ overdue_pending: number;
42
+ };
43
+ history(id: string): {
44
+ revision: number;
45
+ assessment: Assessment;
46
+ decision: Decision;
47
+ recorded_at: number;
48
+ }[];
49
+ jobs(): Notification[];
50
+ claimDue(now?: number, excludedChannels?: Notification['channel'][]): Notification | undefined;
51
+ claimAdditionalDigest(channel: Notification['channel'], now?: number, limit?: number): Notification[];
52
+ completeJob(id: string, status: 'accepted' | 'unknown' | 'failed' | 'pending', nextAt: number, error?: string): void;
53
+ deferJob(id: string, nextAt: number, reason?: string): void;
54
+ retryJob(id: string, now?: number): void;
55
+ recoverSending(now?: number): void;
56
+ acknowledge(id: string): void;
57
+ suppress(id: string, until: number, reason: string): void;
58
+ getMeta(key: string): string | undefined;
59
+ setMeta(key: string, value: string, now?: number): void;
60
+ prune(policy: RetentionPolicy, now?: number, apply?: boolean): PruneReport;
61
+ reserveBudget(day: string, maxRequests: number, maxTokens: number, maxUsd: number | undefined, tokens: number, usd: number | undefined): boolean;
62
+ budgets(): {
63
+ day: string;
64
+ requests: number;
65
+ tokens: number;
66
+ usd: number | null;
67
+ known_usd?: number;
68
+ unpriced_requests?: number;
69
+ }[];
70
+ backup(path: string): Promise<void>;
71
+ }