@westbayberry/dg 1.0.56 → 1.0.57

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 (64) hide show
  1. package/README.md +51 -12
  2. package/dist/index.mjs +5570 -1456
  3. package/package.json +3 -3
  4. package/dist/packages/cli/src/alt-screen.js +0 -36
  5. package/dist/packages/cli/src/api.js +0 -322
  6. package/dist/packages/cli/src/auth.js +0 -218
  7. package/dist/packages/cli/src/bin.js +0 -386
  8. package/dist/packages/cli/src/config.js +0 -228
  9. package/dist/packages/cli/src/discover.js +0 -126
  10. package/dist/packages/cli/src/first-run.js +0 -135
  11. package/dist/packages/cli/src/hook.js +0 -360
  12. package/dist/packages/cli/src/lockfile.js +0 -303
  13. package/dist/packages/cli/src/npm-wrapper.js +0 -218
  14. package/dist/packages/cli/src/pip-wrapper.js +0 -273
  15. package/dist/packages/cli/src/sanitize.js +0 -38
  16. package/dist/packages/cli/src/scan-core.js +0 -144
  17. package/dist/packages/cli/src/setup-status.js +0 -46
  18. package/dist/packages/cli/src/static-output.js +0 -625
  19. package/dist/packages/cli/src/telemetry.js +0 -141
  20. package/dist/packages/cli/src/ui/App.js +0 -137
  21. package/dist/packages/cli/src/ui/InitApp.js +0 -391
  22. package/dist/packages/cli/src/ui/LoginApp.js +0 -51
  23. package/dist/packages/cli/src/ui/NpmWrapperApp.js +0 -73
  24. package/dist/packages/cli/src/ui/PipWrapperApp.js +0 -72
  25. package/dist/packages/cli/src/ui/components/ConfirmPrompt.js +0 -24
  26. package/dist/packages/cli/src/ui/components/DemoScanAnimation.js +0 -26
  27. package/dist/packages/cli/src/ui/components/DurationLine.js +0 -7
  28. package/dist/packages/cli/src/ui/components/ErrorView.js +0 -30
  29. package/dist/packages/cli/src/ui/components/FileSavePrompt.js +0 -210
  30. package/dist/packages/cli/src/ui/components/InteractiveResultsView.js +0 -557
  31. package/dist/packages/cli/src/ui/components/Mascot.js +0 -33
  32. package/dist/packages/cli/src/ui/components/ProgressBar.js +0 -51
  33. package/dist/packages/cli/src/ui/components/ProgressDots.js +0 -35
  34. package/dist/packages/cli/src/ui/components/ProjectSelector.js +0 -60
  35. package/dist/packages/cli/src/ui/components/ResultsView.js +0 -105
  36. package/dist/packages/cli/src/ui/components/ScanResultCard.js +0 -54
  37. package/dist/packages/cli/src/ui/components/ScoreHeader.js +0 -142
  38. package/dist/packages/cli/src/ui/components/SetupBanner.js +0 -17
  39. package/dist/packages/cli/src/ui/components/Spinner.js +0 -11
  40. package/dist/packages/cli/src/ui/hooks/useExpandAnimation.js +0 -44
  41. package/dist/packages/cli/src/ui/hooks/useInit.js +0 -341
  42. package/dist/packages/cli/src/ui/hooks/useLogin.js +0 -121
  43. package/dist/packages/cli/src/ui/hooks/useNpmWrapper.js +0 -192
  44. package/dist/packages/cli/src/ui/hooks/usePipWrapper.js +0 -195
  45. package/dist/packages/cli/src/ui/hooks/useScan.js +0 -202
  46. package/dist/packages/cli/src/ui/hooks/useTerminalSize.js +0 -29
  47. package/dist/packages/cli/src/update-check.js +0 -152
  48. package/dist/packages/cli/src/wizard-demo-data.js +0 -63
  49. package/dist/src/ecosystem.js +0 -2
  50. package/dist/src/lockfile/diff.js +0 -38
  51. package/dist/src/lockfile/parse_package_json.js +0 -41
  52. package/dist/src/lockfile/parse_package_lock.js +0 -55
  53. package/dist/src/lockfile/parse_pipfile_lock.js +0 -69
  54. package/dist/src/lockfile/parse_pnpm_lock.js +0 -62
  55. package/dist/src/lockfile/parse_poetry_lock.js +0 -71
  56. package/dist/src/lockfile/parse_requirements.js +0 -83
  57. package/dist/src/lockfile/parse_yarn_lock.js +0 -66
  58. package/dist/src/logger.js +0 -21
  59. package/dist/src/npm/h2pool.js +0 -161
  60. package/dist/src/npm/registry.js +0 -299
  61. package/dist/src/npm/tarball.js +0 -274
  62. package/dist/src/pypi/registry.js +0 -299
  63. package/dist/src/pypi/tarball.js +0 -361
  64. package/dist/src/types.js +0 -2
package/README.md CHANGED
@@ -1,10 +1,27 @@
1
1
  # @westbayberry/dg
2
2
 
3
- Behavioral supply chain security scanner for npm and Python. Reads what packages actually do — install hooks, credential access, network exfiltration, obfuscation — and blocks the PR before merge.
3
+ Behavioral supply chain security for npm and Python. Reads what packages
4
+ actually do — install hooks, credential access, network exfiltration,
5
+ obfuscation — and gates risky installs before they touch your machine.
4
6
 
5
- **35 detectors · 99.66% catch rate on 155,704 packages · 0.66% FPR** — [published methodology](https://westbayberry.com/benchmark).
7
+ **35 detectors · 99.66% catch rate on 155,704 packages · 0.66% FPR** —
8
+ [published methodology](https://westbayberry.com/benchmark).
6
9
 
7
- Catches zero-day supply chain attacks CVE databases miss. `npm audit`, Snyk, and Dependabot passed the March 2026 axios RAT, the Shai-Hulud worm, and the chalk/debug hijack as clean. Behavioral scanning caught all three in seconds.
10
+ ## What `dg` actually does
11
+
12
+ | Surface | What it does | Default mode |
13
+ |---|---|---|
14
+ | `dg npm install <pkg>` | Resolves the full dependency tree (top-level + transitive) without running install scripts, scans every package, then invokes the real `npm install` only if the verdict permits. Top-level versions are pinned to the exact version we scanned. Bare `dg npm install` honors `package-lock.json` pinned versions. | **block** |
15
+ | `dg pip install <pkg>` | Resolves the full pip tree via `pip install --dry-run --report=-` (pip ≥ 23.0); scans the full set before invoking real `pip install`. On older pip, transitive scan is reported as unavailable and (in block mode) the install is refused. | **block** |
16
+ | `dg scan` | Read-only audit. Diffs lockfiles and reports findings. Does **not** block anything by default. | warn |
17
+ | `dg hook install` | Adds a pre-commit hook that runs `dg scan --mode block` when a lockfile change is staged. Quiet when nothing is wrong. | block |
18
+
19
+ For maximum protection in CI/build pipelines, add `--strict` to the install
20
+ wrapper. `--strict` implies `--dg-no-scripts` and refuses any partial-coverage
21
+ scan (transitive enumeration must succeed).
22
+
23
+ DG only activates when you intentionally invoke it, install the hook, or
24
+ run it in CI. It does not globally hijack `npm`/`pip`.
8
25
 
9
26
  ## Install
10
27
 
@@ -18,29 +35,49 @@ Requires Node.js 18+.
18
35
 
19
36
  ```bash
20
37
  dg login
21
- dg scan
38
+ dg scan # read-only audit of the current project
22
39
  ```
23
40
 
24
- `dg scan` finds your lockfiles, diffs against `main`, and sends the changed package names and versions to the Dependency Guardian API. Results come back as a summary with severity, evidence, and safe-version recommendations.
41
+ Scope-truthful output: a clean project shows
42
+ `✓ Dependency Guardian checked 142 packages. No risky behavior found.`
43
+ A flagged install shows only the warn/block packages with one-line
44
+ reasons and a clear next step.
25
45
 
26
- Supports `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `requirements.txt`, `Pipfile.lock`, and `poetry.lock`.
46
+ Supports `package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`,
47
+ `requirements.txt`, `Pipfile.lock`, and `poetry.lock`.
27
48
 
28
49
  ## Commands
29
50
 
30
51
  ```
31
- dg scan Scan dependencies for supply chain threats
32
- dg npm install <pkg> Scan packages before installing them
52
+ dg scan Read-only audit of the project's lockfiles
53
+ dg status Show your auth state, plan tier, and whether protection is on
33
54
  dg login / logout Manage authentication
34
- dg hook install Install git pre-commit hook
55
+ dg npm install <pkg> Protective install wrapper (default mode: block)
56
+ dg pip install <pkg> Protective install wrapper (default mode: block)
57
+ dg protect Opt this project in to auto-protection on every install
58
+ dg protect off Disable opt-in protection in this project
59
+ dg wrap Print the shell-alias snippet without writing a project marker
60
+ dg hook install Install a git pre-commit hook that gates lockfile diffs
61
+ dg hook uninstall Remove the git pre-commit hook
62
+ dg publish-check Self-scan before `npm publish` / `pip upload`
35
63
  dg update Check for and install the latest version
36
64
  ```
37
65
 
66
+ Full reference: <https://westbayberry.com/docs/cli-reference>
67
+
38
68
  ## Common Options
39
69
 
40
70
  | Flag | Default | Description |
41
71
  |------|---------|-------------|
42
- | `--mode <mode>` | `warn` | `block` / `warn` / `off` |
43
- | `--json` | | Output raw JSON (for CI parsing) |
72
+ | `--mode <mode>` | `warn` for `scan`, `block` for install wrappers | `block` / `warn` / `off` |
73
+ | `--details` | off | Verbose table view (the older format) |
74
+ | `--explain` | off | Plain-English explanation of findings |
75
+ | `--json` | off | Stable machine-readable JSON (CI) |
76
+ | `--ci` | auto when `CI=1` | Deterministic output, no spinners |
77
+ | `--dg-force` | off | Bypass a block (visible in output, audit-friendly) |
78
+ | `--dg-no-scripts` | off | Pass `--ignore-scripts` to the real install |
79
+ | `--strict` | off | Refuse partial-coverage scans + auto `--dg-no-scripts` |
80
+ | `--quiet` | off | Suppress login + update nudges (still prints findings) |
44
81
  | `--workspace <dir>` | | Scan a specific workspace subdirectory |
45
82
 
46
83
  ## Exit Codes
@@ -86,5 +123,7 @@ export DO_NOT_TRACK=1
86
123
  ## Links
87
124
 
88
125
  - [Dashboard](https://westbayberry.com/dashboard)
89
- - [Documentation](https://westbayberry.com/docs)
126
+ - [Documentation](https://westbayberry.com/docs) — setup walkthrough
127
+ - [CLI reference](https://westbayberry.com/docs/cli-reference) — every command and flag
90
128
  - [Pricing](https://westbayberry.com/pricing)
129
+ - [Changelog](https://github.com/WestBayBerry/dependency-guardian-action/blob/main/CHANGELOG.md)