0sec-cli 0.22.1 → 0.22.4

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 (107) hide show
  1. package/0.js +56 -45
  2. package/README.md +12 -0
  3. package/chunks/{adapt-loop-J6QCZZTB.js → adapt-loop-3CCOWE43.js} +4 -4
  4. package/chunks/{artifact-scraper-MFKT6OI4.js → artifact-scraper-Z4UUIOH3.js} +2 -2
  5. package/chunks/{assumption-mining-646LYSJY.js → assumption-mining-2UAKQB6V.js} +18 -14
  6. package/chunks/{chunk-OHHCGDJ2.js → chunk-2WWAPKAW.js} +126 -1089
  7. package/chunks/{chunk-XDKB2P5X.js → chunk-3BPX75OR.js} +1 -1
  8. package/chunks/chunk-4ZYYX5GY.js +74 -0
  9. package/chunks/{chunk-3E2KALZ5.js → chunk-5JNTMWPK.js} +2 -2
  10. package/chunks/{chunk-CPWA6RWE.js → chunk-5WAJGLCW.js} +3 -3
  11. package/chunks/{chunk-KAU6NLGP.js → chunk-6KFB6AYN.js} +515 -20
  12. package/chunks/{chunk-XA2O4WXA.js → chunk-6WQDXWQC.js} +169 -15
  13. package/chunks/chunk-6YZE552K.js +5603 -0
  14. package/chunks/chunk-BGX53365.js +309 -0
  15. package/chunks/{chunk-X7LAEEUW.js → chunk-C6JPA32H.js} +1 -1
  16. package/chunks/chunk-CF3MNS3O.js +990 -0
  17. package/chunks/{chunk-4VGLO2YS.js → chunk-CPCHLL6A.js} +5 -2
  18. package/chunks/{chunk-ZKQ2I3S2.js → chunk-DPUXXMJW.js} +1 -1
  19. package/chunks/{chunk-XCISCI4T.js → chunk-E3OOBVOK.js} +30 -12
  20. package/chunks/{chunk-4G7OVYJX.js → chunk-E74LXQFY.js} +1 -1
  21. package/chunks/{chunk-OSBPGWTE.js → chunk-ELI3BVIK.js} +3 -3
  22. package/chunks/chunk-FFHRANYC.js +547 -0
  23. package/chunks/{chunk-WSDDGFA6.js → chunk-G2BE2FC7.js} +1 -1
  24. package/chunks/chunk-GQ3DGHWE.js +1659 -0
  25. package/chunks/{chunk-V36HVTUL.js → chunk-GVY3S5E5.js} +21 -18
  26. package/chunks/{chunk-5BTJMINS.js → chunk-H4DH7COV.js} +192 -40
  27. package/chunks/{chunk-HHPWRY2M.js → chunk-H6Q2QAIY.js} +23475 -22747
  28. package/chunks/{chunk-7XCKYNLO.js → chunk-IHPTOTLL.js} +1 -1
  29. package/chunks/chunk-IXAHQICR.js +31 -0
  30. package/chunks/{chunk-TH2LW437.js → chunk-KCA35IL3.js} +2 -190
  31. package/chunks/{chunk-VWITLWXB.js → chunk-L2CCO4KE.js} +282 -34
  32. package/chunks/{chunk-6YNKRUMC.js → chunk-NJLKFC66.js} +321 -5
  33. package/chunks/{chunk-W6UWZFKL.js → chunk-O6KPVYOI.js} +100 -5
  34. package/chunks/{chunk-LGCASF2C.js → chunk-OAS5SAVZ.js} +6767 -2100
  35. package/chunks/chunk-PS5E7LUQ.js +277 -0
  36. package/chunks/{chunk-AV2LG2L7.js → chunk-QVIRWJ45.js} +257 -145
  37. package/chunks/{chunk-TV27OWIW.js → chunk-QWK4R3DB.js} +9 -9
  38. package/chunks/{chunk-WZRVS7SB.js → chunk-RCRTSKQN.js} +1 -1
  39. package/chunks/chunk-RS4MAN3Q.js +73 -0
  40. package/chunks/{chunk-V6GHX34G.js → chunk-RTBZ36BD.js} +8 -274
  41. package/chunks/{chunk-YL6YAGLL.js → chunk-SCWWLABR.js} +1 -1
  42. package/chunks/chunk-VDOWARMJ.js +63 -0
  43. package/chunks/{chunk-IFME676H.js → chunk-WBRGXCU2.js} +79 -18
  44. package/chunks/{chunk-IVQV574Y.js → chunk-WHUAUFSX.js} +1 -1
  45. package/chunks/{chunk-GOEA3NW6.js → chunk-XODDLNBI.js} +1534 -1305
  46. package/chunks/chunk-YAZARMJY.js +355 -0
  47. package/chunks/{chunk-NLH4LMWH.js → chunk-YED25PA4.js} +1 -1
  48. package/chunks/{codex-models-NHQW45SO.js → codex-models-Z43V3427.js} +9 -3
  49. package/chunks/{commands-N6GN5SBF.js → commands-EUGF4FUZ.js} +5842 -4093
  50. package/chunks/{db-5IWEJUYV.js → db-NVAW4WWR.js} +3 -3
  51. package/chunks/{dist-L3XJWWZ6.js → dist-27BNG6WD.js} +193 -112
  52. package/chunks/{dist-FSS7MBDF.js → dist-7RUOKPRJ.js} +12 -2
  53. package/chunks/{dist-KEULE5IQ.js → dist-LNXGATR2.js} +2 -2
  54. package/chunks/{dist-XZB53PS5.js → dist-M2X367VW.js} +2 -2
  55. package/chunks/{dist-BS4CY4RG.js → dist-NG2HT5XU.js} +27 -1
  56. package/chunks/{eval-runner-EMEGF24P.js → eval-runner-6Q3H52SP.js} +13 -9
  57. package/chunks/{exploit-agent-KW4EB7BE.js → exploit-agent-FCCR2HYX.js} +1 -1
  58. package/chunks/{exploit-autoclimb-CXJ2ERRO.js → exploit-autoclimb-X5ZS5FAO.js} +1 -1
  59. package/chunks/{exploit-climb-TJWLY4XC.js → exploit-climb-3JHGEO36.js} +2 -2
  60. package/chunks/{fix-UUKPXCFB.js → fix-NSNPU33B.js} +12 -6
  61. package/chunks/{harness-C5HOKIEV.js → harness-KXQOVIDQ.js} +3 -3
  62. package/chunks/{hunt-scan-KZZ444V2.js → hunt-scan-ELTKGKC4.js} +16 -12
  63. package/chunks/{kernel-primitive-Z77IR7YS.js → kernel-primitive-MT7YZSIG.js} +2 -2
  64. package/chunks/{kernel-vm-runner-JW77P276.js → kernel-vm-runner-YFRHYC6G.js} +2 -2
  65. package/chunks/{native-loop-P6P5GYVJ.js → native-loop-OFJDRHPI.js} +18 -8
  66. package/chunks/orchestrate-DRZ2SVCP.js +62 -0
  67. package/chunks/{prepare-KYHGFWCJ.js → prepare-72GWTRVI.js} +6 -2
  68. package/chunks/{process-N245QIQG.js → process-MJYJ2K5E.js} +2 -1
  69. package/chunks/{run-GAFKBCTN.js → run-WTJCZZHV.js} +1901 -4816
  70. package/chunks/{runtime-H7YBR5IZ.js → runtime-FCKOUB7V.js} +10 -4
  71. package/chunks/{runtime-XFWJTBUO.js → runtime-LCJ4XSKE.js} +5 -1
  72. package/chunks/{scan-stream-BMOCPKQX.js → scan-stream-GT6GKQ3U.js} +7 -1
  73. package/chunks/{scope-QWY4VQZ7.js → scope-E5QZUOOH.js} +2 -2
  74. package/chunks/service-plugins-MSK2EQP6.js +62 -0
  75. package/chunks/{session-store-XIDFGG7K.js → session-store-H3Q7KCYG.js} +6 -4
  76. package/chunks/{variant-candidates-7D4F5E4H.js → variant-candidates-SZKDCOLK.js} +9 -3
  77. package/chunks/{web-recon-prepass-VXXBPDAV.js → web-recon-prepass-IO3GXQMW.js} +11 -6
  78. package/dashboard/apple-touch-icon.png +0 -0
  79. package/dashboard/assets/operations-BvB5Qpmk.css +1 -0
  80. package/dashboard/assets/operations-D8Ii01SV.js +114 -0
  81. package/dashboard/assets/zero-peek-Dzm3MT3X.png +0 -0
  82. package/dashboard/favicon.ico +0 -0
  83. package/dashboard/favicon.svg +10 -0
  84. package/dashboard/index.html +5 -3
  85. package/package.json +1 -1
  86. package/chunks/chunk-6GHSR47F.js +0 -147
  87. package/chunks/chunk-BCSRRQG5.js +0 -3514
  88. package/chunks/chunk-BOUGKEKA.js +0 -193
  89. package/chunks/chunk-GHWODZMR.js +0 -16
  90. package/chunks/orchestrate-DWWUT5RC.js +0 -58
  91. package/dashboard/assets/bot-Bg1Tp9_d.js +0 -1
  92. package/dashboard/assets/dist-B_dDCPbu.js +0 -1
  93. package/dashboard/assets/findings-page-mayGhNx6.js +0 -5
  94. package/dashboard/assets/format--susmHX7.js +0 -1
  95. package/dashboard/assets/input-TuVPR3Zl.js +0 -1
  96. package/dashboard/assets/jsx-runtime-MGseXjj5.js +0 -3
  97. package/dashboard/assets/live-page-HWWHX99U.js +0 -1
  98. package/dashboard/assets/meta-tile-ckHo-w7k.js +0 -1
  99. package/dashboard/assets/operations-BxZ0OoXO.js +0 -10
  100. package/dashboard/assets/operations-CMFVrXEe.css +0 -2
  101. package/dashboard/assets/operations-app-D3d35rgo.js +0 -46
  102. package/dashboard/assets/overview-page-W_4IteEr.js +0 -1
  103. package/dashboard/assets/page-header-Bw9AJgBV.js +0 -1
  104. package/dashboard/assets/scans-page-CgzVXHnn.js +0 -1
  105. package/dashboard/assets/siren-KQj8QAnJ.js +0 -1
  106. package/dashboard/assets/table-8EDklulN.js +0 -1
  107. package/dashboard/assets/tabs-CFHPOwg8.js +0 -1
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __0CreateRequire } from "node:module";
3
3
  const require = __0CreateRequire(import.meta.url);
4
+ import {
5
+ scanExecutionTimeout
6
+ } from "./chunk-YAZARMJY.js";
4
7
 
5
8
  // packages/core/dist/shared-analysis.js
6
9
  import { execFileSync } from "node:child_process";
@@ -69,7 +72,7 @@ function runSemgrepScan(targetPath, emit, opts) {
69
72
  let rawOutput;
70
73
  try {
71
74
  rawOutput = execFileSync("semgrep", args, {
72
- timeout: 3e5,
75
+ timeout: scanExecutionTimeout(3e5),
73
76
  stdio: "pipe",
74
77
  encoding: "utf-8",
75
78
  env: { ...process.env, SEMGREP_SEND_METRICS: "off" }
@@ -143,7 +146,7 @@ function runFoxguardScan(targetPath, emit, opts) {
143
146
  try {
144
147
  return bufferToString(runner(useNpm ? opts?.foxguardCommand ?? "npx" : "foxguard", useNpm ? ["--yes", `foxguard@${foxguardTag}`, ...args] : args, {
145
148
  cwd,
146
- timeout: 3e5,
149
+ timeout: scanExecutionTimeout(3e5),
147
150
  maxBuffer: 64 * 1024 * 1024,
148
151
  stdio: "pipe",
149
152
  encoding: "utf-8"
@@ -3,7 +3,7 @@ import { createRequire as __0CreateRequire } from "node:module";
3
3
  const require = __0CreateRequire(import.meta.url);
4
4
  import {
5
5
  severityRank
6
- } from "./chunk-KAU6NLGP.js";
6
+ } from "./chunk-6KFB6AYN.js";
7
7
 
8
8
  // packages/core/dist/triage/kernel-primitive.js
9
9
  function maxSeverity(a, b) {
@@ -3,7 +3,10 @@ import { createRequire as __0CreateRequire } from "node:module";
3
3
  const require = __0CreateRequire(import.meta.url);
4
4
  import {
5
5
  jitterFor
6
- } from "./chunk-YL6YAGLL.js";
6
+ } from "./chunk-SCWWLABR.js";
7
+ import {
8
+ scanExecutionSignal
9
+ } from "./chunk-YAZARMJY.js";
7
10
 
8
11
  // packages/core/dist/scope/rate-limit.js
9
12
  var TokenBucket = class {
@@ -57,24 +60,26 @@ var TokenBucket = class {
57
60
  * the 429 park deadline first, then refill-and-spin with sleeps
58
61
  * sized to the exact next-token-available time.
59
62
  */
60
- async acquire(n = 1) {
63
+ async acquire(n = 1, signal = scanExecutionSignal()) {
64
+ signal?.throwIfAborted();
61
65
  if (n > this.state.capacity) {
62
66
  n = this.state.capacity;
63
67
  }
64
68
  while (this.nowFn() < this.state.retryUntil) {
65
69
  const wait = this.state.retryUntil - this.nowFn();
66
- await this.sleepFn(Math.max(1, Math.min(wait, 1e3)));
70
+ await this.sleepFn(Math.max(1, Math.min(wait, 1e3)), signal);
67
71
  }
68
72
  while (true) {
73
+ signal?.throwIfAborted();
69
74
  this.refill();
70
75
  if (this.state.tokens >= n) {
71
76
  this.state.tokens -= n;
72
- await this.pace();
77
+ await this.pace(signal);
73
78
  return;
74
79
  }
75
80
  const tokensNeeded = n - this.state.tokens;
76
81
  const waitMs = Math.max(1, Math.ceil(tokensNeeded / this.state.refillRatePerMs));
77
- await this.sleepFn(waitMs);
82
+ await this.sleepFn(waitMs, signal);
78
83
  }
79
84
  }
80
85
  /**
@@ -85,12 +90,13 @@ var TokenBucket = class {
85
90
  * yields full jitter in `[0, baseMs]` — rather than growing a second
86
91
  * jitter implementation.
87
92
  */
88
- async pace() {
93
+ async pace(signal = scanExecutionSignal()) {
94
+ signal?.throwIfAborted();
89
95
  if (!this.jitter)
90
96
  return;
91
97
  const ms = jitterFor(0, this.jitter.baseMs, this.jitter.rng ?? Math.random);
92
98
  if (ms > 0)
93
- await this.sleepFn(ms);
99
+ await this.sleepFn(ms, signal);
94
100
  }
95
101
  /**
96
102
  * Park the bucket until `deadline` (ms since epoch). Subsequent
@@ -187,17 +193,18 @@ var RateLimiter = class _RateLimiter {
187
193
  * immediately) — callers should not rely on rate-limiting unknowable
188
194
  * hosts. The fetch sites that wire this up always pass full URLs.
189
195
  */
190
- async acquire(urlOrHost, n = 1) {
196
+ async acquire(urlOrHost, n = 1, signal = scanExecutionSignal()) {
197
+ signal?.throwIfAborted();
191
198
  const host = this.hostKey(urlOrHost);
192
199
  if (!host)
193
200
  return;
194
201
  const bucket = this.getBucket(host);
195
202
  if (bucket.tryConsume(n)) {
196
- await bucket.pace();
203
+ await bucket.pace(signal);
197
204
  return;
198
205
  }
199
206
  this.onThrottle?.();
200
- await bucket.acquire(n);
207
+ await bucket.acquire(n, signal);
201
208
  }
202
209
  /**
203
210
  * Non-blocking variant. Returns true and consumes if available,
@@ -238,8 +245,19 @@ var RateLimiter = class _RateLimiter {
238
245
  this.buckets.clear();
239
246
  }
240
247
  };
241
- function defaultSleep(ms) {
242
- return new Promise((r) => setTimeout(r, ms));
248
+ function defaultSleep(ms, signal) {
249
+ signal?.throwIfAborted();
250
+ const { promise, resolve, reject } = Promise.withResolvers();
251
+ const timer = setTimeout(() => {
252
+ signal?.removeEventListener("abort", abort);
253
+ resolve();
254
+ }, ms);
255
+ const abort = () => {
256
+ clearTimeout(timer);
257
+ reject(signal?.reason ?? new Error("Rate-limit wait cancelled."));
258
+ };
259
+ signal?.addEventListener("abort", abort, { once: true });
260
+ return promise;
243
261
  }
244
262
  function readHeader(headers, name) {
245
263
  if (typeof headers.get === "function") {
@@ -3,7 +3,7 @@ import { createRequire as __0CreateRequire } from "node:module";
3
3
  const require = __0CreateRequire(import.meta.url);
4
4
  import {
5
5
  LlmApiRuntime
6
- } from "./chunk-AV2LG2L7.js";
6
+ } from "./chunk-QVIRWJ45.js";
7
7
 
8
8
  // packages/core/dist/stages/variant-candidates.js
9
9
  import { execFileSync } from "node:child_process";
@@ -5,13 +5,13 @@ import {
5
5
  makeSkepticVerifier,
6
6
  runHuntScan,
7
7
  scoreGeometry
8
- } from "./chunk-5BTJMINS.js";
8
+ } from "./chunk-H4DH7COV.js";
9
9
  import {
10
10
  runReproducerInKernelVm
11
- } from "./chunk-WZRVS7SB.js";
11
+ } from "./chunk-RCRTSKQN.js";
12
12
  import {
13
13
  LlmApiRuntime
14
- } from "./chunk-AV2LG2L7.js";
14
+ } from "./chunk-QVIRWJ45.js";
15
15
  import {
16
16
  __commonJS,
17
17
  __require,