0sec-cli 0.17.0 → 0.21.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 (171) hide show
  1. package/{0sec.js → 0.js} +92 -79
  2. package/LICENSE +1 -1
  3. package/README.md +77 -37
  4. package/chunks/adapt-loop-IGBRQAXO.js +18 -0
  5. package/chunks/{adgraph-JLGA6RYI.js → adgraph-AUDQTBYA.js} +5 -5
  6. package/chunks/agent/skills/frameworks/entra-id.yaml +2 -2
  7. package/chunks/agent/skills/techniques/assumption-mining.yaml +2 -2
  8. package/chunks/agent/skills/techniques/cve-poc-adaptation.yaml +2 -2
  9. package/chunks/agent/skills/techniques/entra-attack-paths.yaml +1 -1
  10. package/chunks/agent/skills/techniques/kernel-weaponization.yaml +1 -1
  11. package/chunks/agent/skills/techniques/llm-prompt-injection.yaml +2 -2
  12. package/chunks/agent/skills/techniques/npm-ecosystem.yaml +1 -1
  13. package/chunks/agent/skills/techniques/poc-verification.yaml +1 -1
  14. package/chunks/agent/skills/techniques/seedless-depth-review.yaml +20 -38
  15. package/chunks/{artifact-scraper-GJEZMOHF.js → artifact-scraper-LNQJUORS.js} +6 -6
  16. package/chunks/{assumption-mining-BVMMUZHB.js → assumption-mining-4MJTP6H5.js} +24 -26
  17. package/chunks/{chunk-P6WKNFWX.js → chunk-2OQOQ2FZ.js} +8 -8
  18. package/chunks/{chunk-5G3ZXFBW.js → chunk-2WNCI664.js} +3 -3
  19. package/chunks/{chunk-HDWV7PGI.js → chunk-2WSXFFJZ.js} +4 -4
  20. package/chunks/{chunk-DW5UWPFY.js → chunk-4VGLO2YS.js} +6 -5
  21. package/chunks/{chunk-SNKTC4BP.js → chunk-5T6D5BVY.js} +88 -88
  22. package/chunks/{chunk-OEFNRYI2.js → chunk-6GHSR47F.js} +3 -6
  23. package/chunks/chunk-6YNKRUMC.js +4474 -0
  24. package/chunks/{chunk-O462Y7P2.js → chunk-ANDKY54G.js} +22317 -19616
  25. package/chunks/{chunk-53G27VPS.js → chunk-AZ7L3HFD.js} +7 -2
  26. package/chunks/{chunk-2SANI5RH.js → chunk-BACXRTQ4.js} +691 -318
  27. package/chunks/{chunk-SOG2U7B3.js → chunk-CAJJRUTV.js} +4 -4
  28. package/chunks/{chunk-57ZENEX2.js → chunk-CGHCEN7W.js} +3 -3
  29. package/chunks/{chunk-VGRDNSHA.js → chunk-CL5KAUM6.js} +17 -16
  30. package/chunks/{chunk-QOKTUOU2.js → chunk-CXKDWFNO.js} +6 -6
  31. package/chunks/{chunk-RWONANDA.js → chunk-DQTNI3KY.js} +5 -5
  32. package/chunks/{chunk-K26SZ37E.js → chunk-E2UOY5PJ.js} +288 -100
  33. package/chunks/{chunk-CLHCDHP4.js → chunk-ER3SUMYJ.js} +40 -18
  34. package/chunks/{chunk-IORC6MQX.js → chunk-FAH6V4QM.js} +31964 -32279
  35. package/chunks/{chunk-6LKRLK2R.js → chunk-FHC2B7LN.js} +3 -3
  36. package/chunks/{chunk-4Y4KQJXE.js → chunk-FWAYJ2IV.js} +16 -16
  37. package/chunks/{chunk-WVTBZEQO.js → chunk-G34QP2XW.js} +8 -8
  38. package/chunks/{chunk-MYVT64FN.js → chunk-GHWODZMR.js} +2 -2
  39. package/chunks/{chunk-F3WBKITT.js → chunk-GIQKESMN.js} +10 -10
  40. package/chunks/{chunk-2RMLOJVB.js → chunk-GVD6SJGH.js} +2 -2
  41. package/chunks/{chunk-RDZYQQLW.js → chunk-HBKCGJAV.js} +7 -7
  42. package/chunks/{chunk-SF4KZ4O3.js → chunk-HLFS6WV2.js} +2 -2
  43. package/chunks/chunk-HPQZHOIU.js +67 -0
  44. package/chunks/{chunk-3QFDYBZQ.js → chunk-IMGWPNQM.js} +231 -1308
  45. package/chunks/{chunk-3MOLBTLS.js → chunk-K2PWUPUI.js} +2 -2
  46. package/chunks/{chunk-MMLDQR4H.js → chunk-NDJU5ZZ7.js} +14 -14
  47. package/chunks/{chunk-H44E2CRN.js → chunk-NOPBXZUV.js} +3 -3
  48. package/chunks/{chunk-HE7LCA7G.js → chunk-O6SD4A36.js} +3 -3
  49. package/chunks/{chunk-SAFFWQW4.js → chunk-P6YG6TEZ.js} +6 -6
  50. package/chunks/{chunk-KKGE5RQE.js → chunk-PC6RCKQV.js} +198 -11
  51. package/chunks/{chunk-LP3HHYQU.js → chunk-PD2BBBKT.js} +2 -2
  52. package/chunks/{chunk-BKZFDZ23.js → chunk-QCUFBVIZ.js} +3 -3
  53. package/chunks/{chunk-KLTNTE2Z.js → chunk-QZVG3BG4.js} +14 -14
  54. package/chunks/{chunk-D6S3IIPG.js → chunk-RF5QGKLR.js} +9 -9
  55. package/chunks/{chunk-LOHTE223.js → chunk-SBMB4OL3.js} +9 -9
  56. package/chunks/{chunk-IOL7D5YV.js → chunk-SQCBHFWN.js} +3 -3
  57. package/chunks/{chunk-A6CLR72I.js → chunk-TF46UWFU.js} +3 -3
  58. package/chunks/chunk-TH2LW437.js +7829 -0
  59. package/chunks/chunk-TRH2PJSN.js +547 -0
  60. package/chunks/{chunk-RJWOYEOG.js → chunk-UEX7PFSE.js} +5 -5
  61. package/chunks/{chunk-VQG4FT5D.js → chunk-UFHN6RIU.js} +2 -2
  62. package/chunks/{chunk-WU6AFRAZ.js → chunk-V36HVTUL.js} +12 -12
  63. package/chunks/{chunk-IR537GON.js → chunk-VCSFCHAJ.js} +2 -2
  64. package/chunks/{chunk-YLMN3N25.js → chunk-VIT5ALXF.js} +3 -3
  65. package/chunks/{chunk-UJ4IK5PO.js → chunk-VOAXLO4A.js} +10 -10
  66. package/chunks/{chunk-UM3ZNQIM.js → chunk-W4JOXE4N.js} +100 -84
  67. package/chunks/{chunk-DN25OQQA.js → chunk-WF5W75WY.js} +25 -25
  68. package/chunks/{chunk-QKICO43A.js → chunk-WPQLBN4S.js} +5 -5
  69. package/chunks/{chunk-HT6P7RY3.js → chunk-WZISK5VC.js} +37 -35
  70. package/chunks/{chunk-QJQKHO7G.js → chunk-Y5H6E24H.js} +3 -3
  71. package/chunks/{chunk-KTQDLNSR.js → chunk-YA4PUM4H.js} +41 -41
  72. package/chunks/{chunk-47TQJWDH.js → chunk-YHWWF4QY.js} +9 -9
  73. package/chunks/{chunk-2CJ776PV.js → chunk-YPOA3W4O.js} +48 -39
  74. package/chunks/{chunk-7DQEV5QI.js → chunk-Z3IKZX3X.js} +4 -4
  75. package/chunks/codex-models-TYYV4JNN.js +15 -0
  76. package/chunks/{commands-U3AMV5ZU.js → commands-WF5RG4I2.js} +5620 -2513
  77. package/chunks/corpus-v1.json +2 -2
  78. package/chunks/data/appsec-archetypes.json +2 -2
  79. package/chunks/data/chromium-archetypes.json +1 -1
  80. package/chunks/data/freebsd-archetypes.json +1 -1
  81. package/chunks/data/kernel-archetypes.json +2 -2
  82. package/chunks/db-U3WQZVAO.js +16 -0
  83. package/chunks/{disclose-A6AEIEDA.js → disclose-67GZCDBO.js} +5 -5
  84. package/chunks/{dist-JR67XKYO.js → dist-ACC3DZUZ.js} +11 -5
  85. package/chunks/{dist-GL66KMUX.js → dist-EVTN3UTT.js} +6 -6
  86. package/chunks/{dist-FDKALV4R.js → dist-F6X62TQK.js} +290 -327
  87. package/chunks/dist-KEULE5IQ.js +21914 -0
  88. package/chunks/dist-XZB53PS5.js +53 -0
  89. package/chunks/eval-runner-SA6OUGHZ.js +26 -0
  90. package/chunks/example-manifest.json +2 -2
  91. package/chunks/{exploit-agent-XP23ISN7.js → exploit-agent-36Q7XQFP.js} +4 -4
  92. package/chunks/{exploit-autoclimb-E6T7RRSC.js → exploit-autoclimb-J4OTSTZ6.js} +6 -6
  93. package/chunks/{exploit-climb-2FAUP6XU.js → exploit-climb-PYEJDIC4.js} +12 -12
  94. package/chunks/fix-J2KBRJDV.js +12 -0
  95. package/chunks/{github-issues-MJ6OYOOU.js → github-issues-IGTTWM7V.js} +7 -7
  96. package/chunks/harness-GDUMKGSE.js +22 -0
  97. package/chunks/http-conformance-U5F6GKYG.js +11 -0
  98. package/chunks/http-sender-I5XFFY35.js +10 -0
  99. package/chunks/hunt-scan-UDJSCISU.js +36 -0
  100. package/chunks/{identity-6ZAIIWOR.js → identity-JTIVJSV7.js} +5 -5
  101. package/chunks/{kernel-primitive-TENE3R7T.js → kernel-primitive-F2IXUFAX.js} +6 -6
  102. package/chunks/{kernel-vm-runner-4F6QSNFY.js → kernel-vm-runner-276LHIOV.js} +6 -6
  103. package/chunks/memsafety-scan-NHUOGTEX.js +16 -0
  104. package/chunks/{native-loop-NTONUDP7.js → native-loop-3BSYVDUI.js} +17 -18
  105. package/chunks/{npm-detectors-KB5Y5ZFX.js → npm-detectors-VIYJXKFQ.js} +6 -6
  106. package/chunks/npm-dynamic-discovery-5J7FT3XM.js +13 -0
  107. package/chunks/orchestrate-DHBFRTSI.js +59 -0
  108. package/chunks/{pre-recon-cve-66EB6G4M.js → pre-recon-cve-X2K2P5YQ.js} +4 -4
  109. package/chunks/prepare-KYHGFWCJ.js +13 -0
  110. package/chunks/process-PNMC36JI.js +15 -0
  111. package/chunks/{replay-runner-RRR4E2A7.js → replay-runner-LK2XFIVG.js} +7 -7
  112. package/chunks/{run-ESNN4V5W.js → run-CBGE6DRQ.js} +2401 -1810
  113. package/chunks/{runtime-62ZQAH7H.js → runtime-PXO5G6UV.js} +11 -11
  114. package/chunks/runtime-XFWJTBUO.js +12 -0
  115. package/chunks/{scan-stream-FHI2FYZE.js → scan-stream-BMOCPKQX.js} +7 -7
  116. package/chunks/{scope-BI7BF4ZY.js → scope-NJHIDDTN.js} +4 -4
  117. package/chunks/{session-store-BCFQYDCE.js → session-store-46WBZM22.js} +6 -6
  118. package/chunks/source-files-REHOM44I.js +12 -0
  119. package/chunks/{specdrift-WCLH6TTQ.js → specdrift-AFS54WEJ.js} +5 -5
  120. package/chunks/token-KRWP5JYA.js +72 -0
  121. package/chunks/token-util-DWTL33S3.js +8 -0
  122. package/chunks/variant-candidates-UH2WC2HA.js +13 -0
  123. package/chunks/{web-recon-prepass-DPVCBRZA.js → web-recon-prepass-SFXU44SS.js} +9 -9
  124. package/dashboard/assets/desktop-BT7RkC4q.js +32 -0
  125. package/dashboard/assets/desktop-OaBI0E0e.css +1 -0
  126. package/dashboard/assets/{findings-page-CACW9nw2.js → findings-page-B4rwF6fZ.js} +2 -2
  127. package/dashboard/assets/{format-PoISqsES.js → format-LNQSSpn6.js} +1 -1
  128. package/dashboard/assets/live-page-DoNwpPAO.js +1 -0
  129. package/dashboard/assets/{meta-tile-CcskIV_o.js → meta-tile-BMtBC-Qq.js} +1 -1
  130. package/dashboard/assets/operations-CMFVrXEe.css +2 -0
  131. package/dashboard/assets/operations-app-ER0gg7GN.js +2 -0
  132. package/dashboard/assets/{operations-D8nUP5_m.js → operations-e2CGYKB1.js} +2 -2
  133. package/dashboard/assets/{overview-page-DTGS8dPo.js → overview-page-CmeWH17A.js} +1 -1
  134. package/dashboard/assets/{page-header-MFVvEtZW.js → page-header-CIJyycfz.js} +1 -1
  135. package/dashboard/assets/scans-page-CuhzWhHx.js +1 -0
  136. package/dashboard/assets/{table-BYS-nIVA.js → table-BgsSBdke.js} +1 -1
  137. package/dashboard/assets/{tabs-DivxbhQy.js → tabs-vn6v7Bk6.js} +1 -1
  138. package/dashboard/desktop.html +3 -3
  139. package/dashboard/index.html +3 -3
  140. package/package.json +11 -11
  141. package/chunks/adapt-loop-ECQG7454.js +0 -18
  142. package/chunks/appsec-catalog-CBWHGTEL.js +0 -24
  143. package/chunks/chunk-H2FFLZNK.js +0 -3
  144. package/chunks/chunk-QI233I24.js +0 -333
  145. package/chunks/chunk-RRMJC3ZE.js +0 -105
  146. package/chunks/chunk-SZJCPG2I.js +0 -110
  147. package/chunks/chunk-WKNNZVJS.js +0 -2798
  148. package/chunks/cost-ledger-ZCKMBJEN.js +0 -13
  149. package/chunks/db-26NGQFKO.js +0 -16
  150. package/chunks/eval-runner-DDLE5RQ3.js +0 -27
  151. package/chunks/fix-IG7LYXH3.js +0 -12
  152. package/chunks/harness-HWOYFKFY.js +0 -22
  153. package/chunks/http-conformance-DU66MZIU.js +0 -11
  154. package/chunks/http-sender-GWH2IYEA.js +0 -10
  155. package/chunks/hunt-scan-XPELSPQQ.js +0 -38
  156. package/chunks/memsafety-scan-J7SECV5W.js +0 -16
  157. package/chunks/npm-dynamic-discovery-AHROOZDB.js +0 -13
  158. package/chunks/orchestrate-ZUWAUWBC.js +0 -62
  159. package/chunks/pipeline-FCARFZU3.js +0 -14
  160. package/chunks/prepare-MYY743TK.js +0 -13
  161. package/chunks/process-3Q7QJIOZ.js +0 -13
  162. package/chunks/runtime-J7PLXZNM.js +0 -12
  163. package/chunks/source-files-PWRQR6LY.js +0 -12
  164. package/chunks/variant-candidates-6KM6F6MD.js +0 -13
  165. package/dashboard/assets/0sec-icon-66SreztZ.gif +0 -0
  166. package/dashboard/assets/desktop-CXTQonNm.js +0 -32
  167. package/dashboard/assets/desktop-NOekk4QS.css +0 -1
  168. package/dashboard/assets/live-page-DrgQqQK5.js +0 -1
  169. package/dashboard/assets/operations-BKE8T-vY.css +0 -2
  170. package/dashboard/assets/operations-app-CQQhG54n.js +0 -2
  171. package/dashboard/assets/scans-page-ChVtq8Us.js +0 -1
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import { createRequire as __0secCreateRequire } from "node:module";
3
- const require = __0secCreateRequire(import.meta.url);
2
+ import { createRequire as __0CreateRequire } from "node:module";
3
+ const require = __0CreateRequire(import.meta.url);
4
4
  import {
5
5
  homeStateDir,
6
6
  runStateDir
7
- } from "./chunk-KKGE5RQE.js";
7
+ } from "./chunk-PC6RCKQV.js";
8
8
  import {
9
9
  __export
10
- } from "./chunk-IR537GON.js";
10
+ } from "./chunk-VCSFCHAJ.js";
11
11
 
12
12
  // packages/db/dist/wasm-shim.js
13
13
  import { BetterSQLiteSession } from "drizzle-orm/better-sqlite3/session";
@@ -99,7 +99,7 @@ var ShimmedDatabase = class {
99
99
  * only uses it as a setter ("journal_mode = WAL", "foreign_keys = ON"), so
100
100
  * we just `exec()` the pragma and swallow errors — some PRAGMAs (notably
101
101
  * WAL journal mode) are not supported by node-sqlite3-wasm's VFS and error
102
- * here, but losing them is acceptable for 0sec's single-process workload.
102
+ * here, but losing them is acceptable for 0's single-process workload.
103
103
  */
104
104
  pragma(query, _opts) {
105
105
  try {
@@ -112,7 +112,7 @@ var ShimmedDatabase = class {
112
112
  * better-sqlite3's `db.transaction(fn)` returns a callable object with
113
113
  * `.deferred`, `.immediate`, `.exclusive`, and `.default` methods, each
114
114
  * running `fn` inside a BEGIN/COMMIT of the corresponding isolation level.
115
- * All three variants are functionally equivalent for 0sec's single-writer
115
+ * All three variants are functionally equivalent for 0's single-writer
116
116
  * workload, so we wire them to the same underlying implementation.
117
117
  */
118
118
  transaction(fn) {
@@ -357,29 +357,29 @@ var findings = sqliteTable("findings", {
357
357
  evidenceResponse: text("evidenceResponse").notNull(),
358
358
  evidenceAnalysis: text("evidenceAnalysis"),
359
359
  /**
360
- * JSON-stringified LayerVerdict[] (see @0sec/shared types). NULL until
360
+ * JSON-stringified LayerVerdict[] (see @0/shared types). NULL until
361
361
  * the triage stage runs. Stored as text rather than a join table because
362
362
  * the array is read-and-write together at finding-save time and we never
363
- * query individual verdict rows. See 0sec#112.
363
+ * query individual verdict rows. See 0#112.
364
364
  */
365
365
  layerVerdicts: text("layerVerdicts"),
366
366
  impactAssessment: text("impactAssessment"),
367
367
  // JSON: ImpactAssessment (reachability/blast/weaponizability/business)
368
368
  /**
369
- * JSON-stringified PocStep[] (see @0sec/shared types). NULL when the
369
+ * JSON-stringified PocStep[] (see @0/shared types). NULL when the
370
370
  * agent only produced prose evidence (the legacy default). Stored as
371
371
  * text rather than a join table because the array is read-and-write
372
372
  * together at finding-save time and we never query individual steps.
373
- * See 0sec#170.
373
+ * See 0#170.
374
374
  */
375
375
  pocSteps: text("pocSteps"),
376
376
  /**
377
- * JSON-stringified VerificationSpec (see @0sec/shared types). NULL
377
+ * JSON-stringified VerificationSpec (see @0/shared types). NULL
378
378
  * when the agent produced a finding without a deterministic re-check
379
379
  * contract — every reader must continue to work in that case. Stored
380
380
  * as text because the spec is an opaque blob that the verifier reads
381
- * whole; we never query individual predicates. See 0sec#193 /
382
- * 0sec-cloud#111.
381
+ * whole; we never query individual predicates. See 0#193 /
382
+ * 0-cloud#111.
383
383
  */
384
384
  verificationSpec: text("verificationSpec"),
385
385
  /**
@@ -395,11 +395,11 @@ var findings = sqliteTable("findings", {
395
395
  /**
396
396
  * JSON-stringified PocExecutionReport written when `disclose --target-url`
397
397
  * runs the step graph against a live target. NULL until that runs. See
398
- * 0sec#171.
398
+ * 0#171.
399
399
  */
400
400
  pocExecution: text("pocExecution"),
401
401
  /**
402
- * JSON-stringified VerificationResult (see @0sec/shared
402
+ * JSON-stringified VerificationResult (see @0/shared
403
403
  * `VerificationResultSchema`) — the last deterministic-replay result
404
404
  * attached to the finding. NULL when the finding was never verified;
405
405
  * readers MUST treat NULL / malformed / statusless payloads as
@@ -609,9 +609,9 @@ var trustGraphEdges = sqliteTable("trust_graph_edges", {
609
609
 
610
610
  // packages/db/dist/database.js
611
611
  var DEFAULT_DB_DIR = homeStateDir();
612
- var DEFAULT_DB_PATH = join(DEFAULT_DB_DIR, "0sec.db");
612
+ var DEFAULT_DB_PATH = join(DEFAULT_DB_DIR, "0.db");
613
613
  function resolveOsecDbPath(dbPath) {
614
- const configuredPath = process.env["0SEC_DB_PATH"]?.trim();
614
+ const configuredPath = process.env["ZERO_DB_PATH"]?.trim();
615
615
  return dbPath ?? (configuredPath ? configuredPath : DEFAULT_DB_PATH);
616
616
  }
617
617
  function resetOsecDatabase(dbPath) {
@@ -725,7 +725,7 @@ function migrateWalHeaderIfNeeded(path) {
725
725
  }
726
726
  }
727
727
  if (hadWalData) {
728
- console.warn(`[0sec] Migrated ${path} from WAL mode to rollback mode for WASM engine compatibility. A non-empty WAL sidecar was present and has been removed; any uncommitted transactions from a prior crashed run were discarded.`);
728
+ console.warn(`[0] Migrated ${path} from WAL mode to rollback mode for WASM engine compatibility. A non-empty WAL sidecar was present and has been removed; any uncommitted transactions from a prior crashed run were discarded.`);
729
729
  }
730
730
  }
731
731
  function clearStaleLockIfAny(path) {
@@ -744,7 +744,7 @@ function clearStaleLockIfAny(path) {
744
744
  return;
745
745
  try {
746
746
  rmSync(lockPath, { recursive: true, force: true });
747
- console.warn(`[0sec] Removed stale database lock at ${lockPath} (age ${Math.floor(ageMs / 1e3)}s \u2014 previous holder likely crashed).`);
747
+ console.warn(`[0] Removed stale database lock at ${lockPath} (age ${Math.floor(ageMs / 1e3)}s \u2014 previous holder likely crashed).`);
748
748
  } catch {
749
749
  }
750
750
  }
@@ -779,7 +779,7 @@ var osecDB = class {
779
779
  throw error;
780
780
  const backupPath = backupCorruptDatabase(path);
781
781
  this.initializeDatabase(path);
782
- console.warn(backupPath ? `[0sec] Recovered malformed database at ${path}. Backup saved to ${backupPath}.` : `[0sec] Recovered malformed database state at ${path} by recreating a fresh database.`);
782
+ console.warn(backupPath ? `[0] Recovered malformed database at ${path}. Backup saved to ${backupPath}.` : `[0] Recovered malformed database state at ${path} by recreating a fresh database.`);
783
783
  }
784
784
  }
785
785
  initializeDatabase(path) {
@@ -787,9 +787,11 @@ var osecDB = class {
787
787
  this.sqlite.pragma("foreign_keys = ON");
788
788
  ensureDatabaseHealthy(this.sqlite);
789
789
  this.db = createDrizzleFromShim(this.sqlite, { schema: schema_exports });
790
- this.sqlite.exec(SCHEMA_TABLES_SQL);
791
- this.migrate();
792
- this.sqlite.exec(SCHEMA_INDEXES_SQL);
790
+ this.sqlite.transaction(() => {
791
+ this.sqlite.exec(SCHEMA_TABLES_SQL);
792
+ this.migrate();
793
+ this.sqlite.exec(SCHEMA_INDEXES_SQL);
794
+ })();
793
795
  }
794
796
  initializeReadOnlyDatabase(path) {
795
797
  this.sqlite = createShimmedDatabase(path);
@@ -797,7 +799,7 @@ var osecDB = class {
797
799
  this.db = createDrizzleFromShim(this.sqlite, { schema: schema_exports });
798
800
  }
799
801
  /**
800
- * Upgrade databases created by older 0sec versions.
802
+ * Upgrade databases created by older 0 versions.
801
803
  *
802
804
  * SCHEMA_TABLES_SQL (above) now contains every table and every column from
803
805
  * the drizzle schema, so fresh installs need no patching. This method only
@@ -806,7 +808,7 @@ var osecDB = class {
806
808
  * table_info is cached by SQLite) and the ALTERs are no-ops when the
807
809
  * column is already present, so running on a fresh DB is harmless.
808
810
  *
809
- * See: https://github.com/0sec-labs/0sec/issues/420
811
+ * See: https://github.com/0sec-labs/0/issues/420
810
812
  */
811
813
  migrate() {
812
814
  const cols = this.sqlite.prepare("PRAGMA table_info(findings)").all();
@@ -1949,7 +1951,7 @@ var osecDB = class {
1949
1951
  const result = this.sqlite.prepare(`DELETE FROM workers WHERE status IN (${placeholders})`).run(...values);
1950
1952
  return result.changes;
1951
1953
  }
1952
- // ── Persistent credential store (0sec#771) ──
1954
+ // ── Persistent credential store (0#771) ──
1953
1955
  /**
1954
1956
  * Upsert a discovered foothold keyed by (credentialKind, valueHash). First
1955
1957
  * write records the discovery attribution (target/finding/scan/turn);
@@ -2019,7 +2021,7 @@ var osecDB = class {
2019
2021
  const limit = query.limit ?? 500;
2020
2022
  return this.sqlite.prepare(`SELECT * FROM persistent_credentials ${whereSql} ORDER BY lastSeenAt DESC LIMIT ${limit}`).all(...params);
2021
2023
  }
2022
- // ── Trust graph edges (0sec#771) ──
2024
+ // ── Trust graph edges (0#771) ──
2023
2025
  /**
2024
2026
  * Upsert a directed trust edge keyed by
2025
2027
  * (srcKind, srcId, dstKind, dstId, relation). Re-observing an edge refreshes
@@ -2484,24 +2486,24 @@ var STATE_DB_FILE = "state.db";
2484
2486
  var REPORT_FILE = "report.json";
2485
2487
  function normalizeRunId(value) {
2486
2488
  if (!/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(value)) {
2487
- throw new Error(`Invalid 0sec run id ${JSON.stringify(value)}.`);
2489
+ throw new Error(`Invalid 0 run id ${JSON.stringify(value)}.`);
2488
2490
  }
2489
2491
  return value;
2490
2492
  }
2491
2493
  function resolveOsecRunStorage(options = {}) {
2492
2494
  const env = options.env ?? process.env;
2493
- const cloudRunId = env["0SEC_CLOUD_SCAN_ID"]?.trim() || void 0;
2495
+ const cloudRunId = env["ZERO_CLOUD_SCAN_ID"]?.trim() || void 0;
2494
2496
  let runId = normalizeRunId(options.runId ?? cloudRunId ?? randomUUID2());
2495
2497
  const stateDir = homeStateDir(options.homeDir);
2496
- const configuredRunDir = env["0SEC_RUN_DIR"]?.trim() || void 0;
2497
- const configuredDbPath = options.dbPath ?? (env["0SEC_DB_PATH"]?.trim() || void 0);
2498
+ const configuredRunDir = env["ZERO_RUN_DIR"]?.trim() || void 0;
2499
+ const configuredDbPath = options.dbPath ?? (env["ZERO_DB_PATH"]?.trim() || void 0);
2498
2500
  let runDir = configuredRunDir ? resolve(configuredRunDir) : runStateDir(runId, options.homeDir);
2499
2501
  if (options.resume && !configuredRunDir && !configuredDbPath && !existsSync2(runDir)) {
2500
2502
  const runsDir = join2(stateDir, "runs");
2501
2503
  if (existsSync2(runsDir)) {
2502
2504
  const matches = readdirSync(runsDir, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.startsWith(runId));
2503
2505
  if (matches.length > 1) {
2504
- throw new Error(`0sec run id prefix '${runId}' is ambiguous.`);
2506
+ throw new Error(`0 run id prefix '${runId}' is ambiguous.`);
2505
2507
  }
2506
2508
  const match = matches[0];
2507
2509
  if (match) {
@@ -2511,13 +2513,13 @@ function resolveOsecRunStorage(options = {}) {
2511
2513
  }
2512
2514
  }
2513
2515
  if (!isAbsolute(runDir)) {
2514
- throw new Error(`0sec run directory must be absolute: ${JSON.stringify(runDir)}.`);
2516
+ throw new Error(`0 run directory must be absolute: ${JSON.stringify(runDir)}.`);
2515
2517
  }
2516
2518
  let dbPath = configuredDbPath ? configuredDbPath === ":memory:" ? configuredDbPath : resolve(configuredDbPath) : join2(runDir, STATE_DB_FILE);
2517
- const configuredReportPath = env["0SEC_REPORT_PATH"]?.trim() || void 0;
2519
+ const configuredReportPath = env["ZERO_REPORT_PATH"]?.trim() || void 0;
2518
2520
  const reportPath = configuredReportPath ? resolve(configuredReportPath) : !configuredDbPath || configuredRunDir ? join2(runDir, REPORT_FILE) : void 0;
2519
2521
  if (options.resume && !configuredDbPath && !existsSync2(dbPath)) {
2520
- const legacyDbPath = join2(stateDir, "0sec.db");
2522
+ const legacyDbPath = join2(stateDir, "0.db");
2521
2523
  if (existsSync2(legacyDbPath))
2522
2524
  dbPath = legacyDbPath;
2523
2525
  }
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { createRequire as __0secCreateRequire } from "node:module";
3
- const require = __0secCreateRequire(import.meta.url);
2
+ import { createRequire as __0CreateRequire } from "node:module";
3
+ const require = __0CreateRequire(import.meta.url);
4
4
  import {
5
5
  jitterFor
6
- } from "./chunk-LOHTE223.js";
6
+ } from "./chunk-SBMB4OL3.js";
7
7
 
8
8
  // packages/core/dist/scope/rate-limit.js
9
9
  var TokenBucket = class {