proof-of-commitment 1.18.2 → 1.19.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 (3) hide show
  1. package/README.md +12 -15
  2. package/index.js +31 -19
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -51,26 +51,23 @@ npx proof-of-commitment --file go.sum # full transitive set
51
51
 
52
52
  **Web demo (no install):** [getcommit.dev/audit](https://getcommit.dev/audit) — paste your packages, see risk scores in seconds.
53
53
 
54
- **Account + monitoring (v1.10.0):**
54
+ ## Get notified before the next attack
55
+
56
+ The CLI tells you what's risky today. A free API key unlocks **monitoring** — daily score recomputation across the packages you depend on, with alerts when one degrades (publisher drops, release stalls, score falls ≥10 points).
57
+
58
+ [**Get a free API key →**](https://getcommit.dev/get-started?ref=npm-readme-monitoring&utm_source=cli) — no card, 30 seconds · 200 audits/day free · Developer $15/mo unlocks alerts + watchlist.
59
+
55
60
  ```bash
56
61
  # Install once, then use the `poc` alias:
57
62
  npm install -g proof-of-commitment
58
63
 
59
- # Get a free API key at https://getcommit.dev/get-started?utm_source=cli, then:
60
- poc login sk_commit_your_key_here
61
- # Authenticated Tier: Free — Usage: 0/200 requests (daily)
62
-
63
- poc status # check tier + usage anytime
64
- poc logout # remove saved key
65
-
66
- # Monitoring (Developer $15/mo+ — daily scans + alerts):
67
- poc watch chalk
64
+ # After getting your free key:
65
+ poc login sk_commit_your_key_here # save and validate
66
+ poc status # check tier + usage
67
+ poc watch chalk # start monitoring (Developer $15/mo)
68
68
  poc watch requests --ecosystem pypi
69
- poc watch serde --ecosystem cargo
70
- poc watchlist # view scores + risk levels
71
- poc unwatch chalk
72
-
73
- # Enable monitoring: https://getcommit.dev/pricing
69
+ poc watchlist # view all watched packages
70
+ poc init # add CI gate to this project
74
71
  ```
75
72
 
76
73
  Alerts fire on: score drop ≥10 points · package crosses CRITICAL threshold · recovery to HEALTHY.
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * proof-of-commitment CLI v1.18.1
3
+ * proof-of-commitment CLI v1.19.0
4
4
  * Scores npm/PyPI/Cargo/Go packages on behavioral commitment signals.
5
5
  * Usage: npx proof-of-commitment [packages...] [options]
6
6
  */
@@ -293,15 +293,11 @@ function printTable(results, { totalScanned, totalCritical, lockfile } = {}) {
293
293
  console.log(clr(c.dim, ' Then run: ') + clr(c.cyan, 'poc login'));
294
294
  }
295
295
  // else: TTY mode — inlineSignup() will prompt interactively after printTable
296
- } else if (!hasKey) {
297
- // HEALTHY case + no saved key: soft watchlist CTA. The all-healthy
298
- // footer previously surfaced only CI-shaped CTAs (Action, `poc init`)
299
- // which both require active commitment workflow change + repo edit.
300
- // The lowest-friction conversion (email API key watchlist) was
301
- // hidden behind the CRITICAL gate of inlineSignup(). Buyer-journey
302
- // dogfood 2026-05-24 found 1472 weekly downloads → 0 organic signups;
303
- // the watchlist value prop ("alert me when these degrade") is real
304
- // for healthy packages too — that's exactly when monitoring matters.
296
+ } else if (!hasKey && (!process.stdin.isTTY || !process.stdout.isTTY)) {
297
+ // HEALTHY case + no saved key + non-TTY (CI/piped): static baseline CTA.
298
+ // In TTY mode, inlineSignup() now prompts interactively for healthy results
299
+ // too the dim text below converted 0/621 weekly downloads. Keep static
300
+ // text only in CI/piped output where interactive prompts can't fire.
305
301
  // ref=audit-baseline distinguishes this funnel from audit-cli-429
306
302
  // (rate-limit rescue) and from the static utm_source=cli help-line.
307
303
  console.log(clr(c.dim, '\n 📊 Save this scan as your baseline. Re-run anytime with a free key:'));
@@ -311,23 +307,35 @@ function printTable(results, { totalScanned, totalCritical, lockfile } = {}) {
311
307
  }
312
308
 
313
309
  /**
314
- * Inline signup: after CRITICAL findings, offer one-step email→key flow.
310
+ * Inline signup: after any real audit, offer one-step email→key flow.
315
311
  * Collapses 6-step funnel (visit site → email → check inbox → copy key → login → watch)
316
312
  * into a single CLI prompt.
313
+ *
314
+ * v1.19: Triggers on healthy results too (≥3 packages). The dim "Save this scan
315
+ * as your baseline" footer line converted 0/621 weekly downloads — replacing it
316
+ * with an interactive prompt at the moment of audit success captures more
317
+ * intent. Copy adapts to context: degradation alerts (CRITICAL) vs baseline
318
+ * lock-in (healthy). Quick lookups (<3 packages) still skip the prompt.
317
319
  */
318
320
  async function inlineSignup(results) {
319
- // Only prompt in interactive TTY when findings make monitoring relevant and no key saved
321
+ // Only prompt in interactive TTY when no key saved
320
322
  if (!process.stdin.isTTY || !process.stdout.isTTY) return;
321
323
  const hasKey = !!process.env.COMMIT_API_KEY || _cachedHasKey;
322
324
  if (hasKey) return;
323
325
  const critPkgs = results.filter(r => hasCritical(r.riskFlags));
324
326
  const lowScorePkgs = results.filter(r => typeof r.score === 'number' && r.score < 60);
325
- // Gate: ≥1 CRITICAL, OR ≥2 packages with score<60, OR large scan (≥50 packages)
326
- const shouldPrompt = critPkgs.length >= 1 || lowScorePkgs.length >= 2 || results.length >= 50;
327
- if (!shouldPrompt) return;
327
+ // Gate: ≥3 packages scanned (real audit, not a one-off `npx poc somepkg` check)
328
+ if (results.length < 3) return;
329
+
330
+ const hasFindings = critPkgs.length >= 1 || lowScorePkgs.length >= 2;
331
+ // Copy adapts to context. Findings → degradation framing.
332
+ // Healthy → baseline-lock framing (still real value: alert me if any score drops).
333
+ const heading = hasFindings
334
+ ? ' 🔔 Lock in this audit. Get alerted if these packages get worse.'
335
+ : ' 🔔 Lock in this baseline. Get alerted if any of these packages degrade.';
328
336
 
329
337
  console.log(clr(c.dim, ' ─────────────────────────────────────────────'));
330
- console.log(clr(c.bold, ' 🔔 Lock in this audit. Get alerts if these packages get worse.'));
338
+ console.log(clr(c.bold, heading));
331
339
  console.log(clr(c.dim, ' Free, no card, 10 seconds. Saves to ~/.commit/config.\n'));
332
340
 
333
341
  const { createInterface } = await import('readline');
@@ -366,8 +374,12 @@ async function inlineSignup(results) {
366
374
  console.log();
367
375
  console.log(clr(c.bold, ' Next steps:'));
368
376
  console.log(clr(c.dim, ' • ') + clr(c.cyan, 'poc status') + clr(c.dim, ' — check your account'));
369
- if (critPkgs.length > 0) {
370
- console.log(clr(c.dim, ' • ') + clr(c.cyan, `poc watch ${critPkgs[0].name}`) + clr(c.dim, ' — start monitoring (Developer $15/mo)'));
377
+ // Surface a concrete watch target. CRITICAL first (highest urgency);
378
+ // otherwise pick the lowest-score package as the most-likely-to-degrade.
379
+ const watchTarget = critPkgs[0]?.name
380
+ || results.slice().sort((a, b) => (a.score || 100) - (b.score || 100))[0]?.name;
381
+ if (watchTarget) {
382
+ console.log(clr(c.dim, ' • ') + clr(c.cyan, `poc watch ${watchTarget}`) + clr(c.dim, ' — start monitoring (Developer $15/mo)'));
371
383
  }
372
384
  console.log(clr(c.dim, ' • ') + clr(c.cyan, 'poc init') + clr(c.dim, ' — add CI gate to this project'));
373
385
  } else if (data.message) {
@@ -384,7 +396,7 @@ async function inlineSignup(results) {
384
396
 
385
397
  function printHelp() {
386
398
  console.log(`
387
- ${clr(c.bold, 'proof-of-commitment')} v1.18.2 — supply chain risk scorer
399
+ ${clr(c.bold, 'proof-of-commitment')} v1.19.0 — supply chain risk scorer
388
400
 
389
401
  ${clr(c.bold, 'Usage:')}
390
402
  npx proof-of-commitment Auto-detect manifest in current dir
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proof-of-commitment",
3
- "version": "1.18.2",
3
+ "version": "1.19.0",
4
4
  "mcpName": "io.github.piiiico/proof-of-commitment",
5
5
  "description": "Supply chain risk scorer for npm, PyPI, Cargo, and Go packages — behavioral signals that can't be faked",
6
6
  "type": "module",