@perrylink/dsh-skill-pack-security-provider 1.3.0 → 2.0.1

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 (45) hide show
  1. package/lib/index.js +36 -8
  2. package/lib/types/index.d.ts +20 -8
  3. package/lib/types/vet/checks.d.ts +43 -0
  4. package/lib/types/vet/config.d.ts +41 -0
  5. package/lib/types/vet/engine.d.ts +24 -0
  6. package/lib/types/vet/fetch.d.ts +42 -0
  7. package/lib/types/vet/manifest.d.ts +53 -0
  8. package/lib/types/vet/redact.d.ts +14 -0
  9. package/lib/types/vet/report.d.ts +17 -0
  10. package/lib/types/vet/skills.d.ts +56 -0
  11. package/lib/types/vet/source.d.ts +58 -0
  12. package/lib/types/vet/tar.d.ts +35 -0
  13. package/lib/types/vet/tool.d.ts +16 -0
  14. package/lib/types/vet/vocabulary.d.ts +123 -0
  15. package/lib/types/vet/walk.d.ts +37 -0
  16. package/lib/vet/checks.js +755 -0
  17. package/lib/vet/config.js +36 -0
  18. package/lib/vet/engine.js +236 -0
  19. package/lib/vet/fetch.js +124 -0
  20. package/lib/vet/manifest.js +345 -0
  21. package/lib/vet/redact.js +46 -0
  22. package/lib/vet/report.js +95 -0
  23. package/lib/vet/skills.js +99 -0
  24. package/lib/vet/source.js +218 -0
  25. package/lib/vet/tar.js +137 -0
  26. package/lib/vet/tool.js +164 -0
  27. package/lib/vet/vocabulary.js +19 -0
  28. package/lib/vet/walk.js +147 -0
  29. package/pack/skills/dependency-audit/SKILL.md +5 -1
  30. package/pack/skills/incident-response/SKILL.md +1 -1
  31. package/pack/skills/prompt-injection-review/SKILL.md +1 -1
  32. package/pack/skills/secret-scan/SKILL.md +1 -1
  33. package/pack/skills/security-audit/SKILL.md +5 -1
  34. package/pack/skills/supply-chain-review/SKILL.md +5 -1
  35. package/pack/skills/threat-model/SKILL.md +1 -1
  36. package/pack/skills/vuln-intel/SKILL.md +1 -1
  37. package/pack/skills-en/dependency-audit/SKILL.md +5 -1
  38. package/pack/skills-en/incident-response/SKILL.md +1 -1
  39. package/pack/skills-en/prompt-injection-review/SKILL.md +1 -1
  40. package/pack/skills-en/secret-scan/SKILL.md +1 -1
  41. package/pack/skills-en/security-audit/SKILL.md +5 -1
  42. package/pack/skills-en/supply-chain-review/SKILL.md +5 -1
  43. package/pack/skills-en/threat-model/SKILL.md +1 -1
  44. package/pack/skills-en/vuln-intel/SKILL.md +1 -1
  45. package/package.json +47 -4
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Bounded file collection: walks a local directory or normalizes an extracted
3
+ * tarball into one shared `ScannedFile` list. Everything is budget-capped so a
4
+ * hostile or simply huge target can never exhaust memory or wall time; caps are
5
+ * reported back as truncation, never hidden.
6
+ *
7
+ * @module dsh-skill-pack-security/vet/walk
8
+ */
9
+ /** One collected file: path relative to the target root, decoded text when readable. */
10
+ export interface ScannedFile {
11
+ readonly path: string;
12
+ readonly text: string | null;
13
+ /** Binary content (NUL byte detected); text is null. */
14
+ readonly binary: boolean;
15
+ /** Files that exceeded per-file budget or failed to decode; null for normal files. */
16
+ readonly skipped: 'too-large' | 'binary' | 'decode' | null;
17
+ }
18
+ /** Budget facts so reports never present truncation as completeness. */
19
+ export interface ScanBudget {
20
+ filesScanned: number;
21
+ filesSkipped: number;
22
+ bytesScanned: number;
23
+ truncated: boolean;
24
+ truncatedReason?: string;
25
+ }
26
+ /** Normalize an extracted tarball's file map into the shared scanned-file list. */
27
+ export declare function filesFromMap(files: Map<string, Uint8Array>, maxFileBytes: number): {
28
+ files: ScannedFile[];
29
+ budget: ScanBudget;
30
+ };
31
+ /** Walk a local directory with caps; symlinks are never followed. */
32
+ export declare function walkLocal(root: string, maxFiles: number, maxFileBytes: number): Promise<{
33
+ files: ScannedFile[];
34
+ budget: ScanBudget;
35
+ }>;
36
+ /** Resolve the strip-prefix of a codeload/npm tarball (its single top-level dir). */
37
+ export declare function stripRoot(files: Map<string, Uint8Array>): string;