0sec-cli 0.18.0 → 0.22.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 (329) hide show
  1. package/{0sec.js → 0.js} +90 -82
  2. package/LICENSE +1 -1
  3. package/README.md +62 -46
  4. package/chunks/adapt-loop-7I57LXXR.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-HQ7HLP6V.js → artifact-scraper-PYZ3RU3O.js} +6 -6
  16. package/chunks/{assumption-mining-5SNIVVDN.js → assumption-mining-MFLF43IR.js} +24 -26
  17. package/chunks/{chunk-7DQEV5QI.js → chunk-23DG5YKS.js} +4 -4
  18. package/chunks/{chunk-UR4ELX2Y.js → chunk-2GV4HQKE.js} +340 -703
  19. package/chunks/{chunk-P6WKNFWX.js → chunk-2OQOQ2FZ.js} +8 -8
  20. package/chunks/{chunk-5G3ZXFBW.js → chunk-2WNCI664.js} +3 -3
  21. package/chunks/{chunk-DW5UWPFY.js → chunk-4VGLO2YS.js} +6 -5
  22. package/chunks/{chunk-KLTNTE2Z.js → chunk-5IBCBQEH.js} +13 -14
  23. package/chunks/{chunk-N7BOUYEV.js → chunk-5MWAG3FT.js} +14 -14
  24. package/chunks/{chunk-OEFNRYI2.js → chunk-6GHSR47F.js} +3 -6
  25. package/chunks/chunk-6YNKRUMC.js +4474 -0
  26. package/chunks/{chunk-6L26OBWI.js → chunk-76KSBWOQ.js} +255 -35
  27. package/chunks/chunk-7DEHG7YT.js +2143 -0
  28. package/chunks/{chunk-AD7WXDH6.js → chunk-7UFUALR2.js} +288 -22
  29. package/chunks/{chunk-53G27VPS.js → chunk-AZ7L3HFD.js} +7 -2
  30. package/chunks/{chunk-TSK2AG6J.js → chunk-CAYANSH6.js} +173 -1757
  31. package/chunks/{chunk-SAFFWQW4.js → chunk-DKSCN2AB.js} +7 -7
  32. package/chunks/{chunk-2JCCA2JL.js → chunk-DM5C5L5D.js} +3 -3
  33. package/chunks/{chunk-RWONANDA.js → chunk-DQTNI3KY.js} +5 -5
  34. package/chunks/{chunk-5JI7L7KV.js → chunk-EGZGZFAH.js} +10036 -12938
  35. package/chunks/{chunk-6LKRLK2R.js → chunk-FHC2B7LN.js} +3 -3
  36. package/chunks/{chunk-MYVT64FN.js → chunk-GHWODZMR.js} +2 -2
  37. package/chunks/{chunk-2RMLOJVB.js → chunk-GVD6SJGH.js} +2 -2
  38. package/chunks/{chunk-SF4KZ4O3.js → chunk-HLFS6WV2.js} +2 -2
  39. package/chunks/chunk-HR2TU42B.js +1228 -0
  40. package/chunks/{chunk-BFRB6HB2.js → chunk-HUNAPTKV.js} +3 -3
  41. package/chunks/chunk-IO7R7WBM.js +114 -0
  42. package/chunks/{chunk-WEBMRWEG.js → chunk-IXT64DV5.js} +656 -1868
  43. package/chunks/{chunk-3MOLBTLS.js → chunk-K2PWUPUI.js} +2 -2
  44. package/chunks/{chunk-WXQ6BJ6A.js → chunk-LCRTAQN2.js} +7 -7
  45. package/chunks/{chunk-SVJEDVYK.js → chunk-LPTRPRZR.js} +5 -5
  46. package/chunks/{chunk-CMKXP5RR.js → chunk-LYUAM3TG.js} +3 -3
  47. package/chunks/{chunk-BVAZO4WA.js → chunk-MICHDTBK.js} +3 -3
  48. package/chunks/{chunk-UCYRA73C.js → chunk-OAYUPGF6.js} +4 -4
  49. package/chunks/{chunk-XM5NLHYU.js → chunk-OWLJYJ5O.js} +14 -14
  50. package/chunks/{chunk-BKZFDZ23.js → chunk-QCUFBVIZ.js} +3 -3
  51. package/chunks/chunk-RE5EZDG2.js +5523 -0
  52. package/chunks/{chunk-ASUR522M.js → chunk-RRD4XXPU.js} +9 -9
  53. package/chunks/{chunk-AHTBZC3E.js → chunk-RSIUX3RW.js} +4 -4
  54. package/chunks/{chunk-BZNEY2ZS.js → chunk-SJBCK2EI.js} +15268 -16053
  55. package/chunks/{chunk-IOL7D5YV.js → chunk-SQCBHFWN.js} +3 -3
  56. package/chunks/chunk-TH2LW437.js +7829 -0
  57. package/chunks/{chunk-WVTBZEQO.js → chunk-TM74SSHC.js} +8 -8
  58. package/chunks/{chunk-U5FLXGHT.js → chunk-TO35Y326.js} +13 -729
  59. package/chunks/chunk-TRH2PJSN.js +547 -0
  60. package/chunks/{chunk-YYRBQVFE.js → chunk-TZFIAMWZ.js} +70 -16
  61. package/chunks/chunk-UELXHK2Y.js +1950 -0
  62. package/chunks/{chunk-RJWOYEOG.js → chunk-UEX7PFSE.js} +5 -5
  63. package/chunks/{chunk-VQG4FT5D.js → chunk-UFHN6RIU.js} +2 -2
  64. package/chunks/{chunk-JQHOLLTD.js → chunk-UU7PQP6N.js} +9 -9
  65. package/chunks/{chunk-BFR2CDV5.js → chunk-UV5QWZGE.js} +283 -153
  66. package/chunks/{chunk-WU6AFRAZ.js → chunk-V36HVTUL.js} +12 -12
  67. package/chunks/{chunk-IR537GON.js → chunk-VCSFCHAJ.js} +2 -2
  68. package/chunks/{chunk-YLMN3N25.js → chunk-VIT5ALXF.js} +3 -3
  69. package/chunks/{chunk-BATRQBOR.js → chunk-VMRRNRMR.js} +41 -41
  70. package/chunks/{chunk-72CISA2D.js → chunk-VNRY6AWF.js} +89 -41
  71. package/chunks/chunk-W6UWZFKL.js +298 -0
  72. package/chunks/{chunk-3KPWWJCI.js → chunk-XFCTUKXR.js} +88 -88
  73. package/chunks/{chunk-GMT2AZKM.js → chunk-YIQSGNAA.js} +897 -130
  74. package/chunks/codex-models-7TLJSY3L.js +17 -0
  75. package/chunks/{commands-TBC2F5CE.js → commands-NEI7L3QA.js} +2836 -1424
  76. package/chunks/corpus-v1.json +2 -2
  77. package/chunks/data/appsec-archetypes.json +2 -2
  78. package/chunks/data/chromium-archetypes.json +1 -1
  79. package/chunks/data/freebsd-archetypes.json +1 -1
  80. package/chunks/data/kernel-archetypes.json +2 -2
  81. package/chunks/db-5AP3JB4W.js +16 -0
  82. package/chunks/{disclose-EKTWSCGW.js → disclose-LDNKAVRH.js} +13 -11
  83. package/chunks/{dist-4YICS2J2.js → dist-3FNZIBB4.js} +394 -404
  84. package/chunks/{dist-4MAW5X6L.js → dist-5YHYNLI3.js} +6 -6
  85. package/chunks/{dist-FMGSR3DW.js → dist-DD4H6HMQ.js} +13 -5
  86. package/chunks/dist-KEULE5IQ.js +21914 -0
  87. package/chunks/dist-XZB53PS5.js +53 -0
  88. package/chunks/eval-runner-43BO2C4T.js +26 -0
  89. package/chunks/example-manifest.json +2 -2
  90. package/chunks/{exploit-agent-45YQOHPJ.js → exploit-agent-N4A5ELBK.js} +4 -4
  91. package/chunks/{exploit-autoclimb-UZGEMGYT.js → exploit-autoclimb-N7P6KIF5.js} +6 -6
  92. package/chunks/{exploit-climb-SG23KB2G.js → exploit-climb-WNEJUB5W.js} +12 -12
  93. package/chunks/fix-Z452M4EC.js +26 -0
  94. package/chunks/{github-issues-MJ6OYOOU.js → github-issues-IGTTWM7V.js} +7 -7
  95. package/chunks/harness-QJJJVSG4.js +22 -0
  96. package/chunks/http-conformance-U5F6GKYG.js +11 -0
  97. package/chunks/http-sender-I5XFFY35.js +10 -0
  98. package/chunks/hunt-scan-K6D2V3PX.js +36 -0
  99. package/chunks/{identity-6ZAIIWOR.js → identity-62SVRW4H.js} +5 -5
  100. package/chunks/{kernel-primitive-7U6CWHXD.js → kernel-primitive-TKUACPKD.js} +6 -6
  101. package/chunks/{kernel-vm-runner-3JAU4O6J.js → kernel-vm-runner-RAAO2PGT.js} +6 -6
  102. package/chunks/memsafety-scan-FCPAXIZE.js +16 -0
  103. package/chunks/{native-loop-RJCJPOUS.js → native-loop-2ZRJENZ3.js} +17 -18
  104. package/chunks/{npm-detectors-KB5Y5ZFX.js → npm-detectors-Z2ZIQCN4.js} +6 -6
  105. package/chunks/npm-dynamic-discovery-5J7FT3XM.js +13 -0
  106. package/chunks/orchestrate-2GWGNTBF.js +58 -0
  107. package/chunks/{pre-recon-cve-66EB6G4M.js → pre-recon-cve-X2K2P5YQ.js} +4 -4
  108. package/chunks/prepare-KYHGFWCJ.js +13 -0
  109. package/chunks/process-N245QIQG.js +12 -0
  110. package/chunks/{run-D56MPDKY.js → run-U3XU4CTC.js} +11507 -13632
  111. package/chunks/{runtime-G7YWIO3B.js → runtime-G75TEWQY.js} +10 -11
  112. package/chunks/runtime-XFWJTBUO.js +12 -0
  113. package/chunks/{scan-stream-FHI2FYZE.js → scan-stream-BMOCPKQX.js} +7 -7
  114. package/chunks/scope-WXI46UHJ.js +21 -0
  115. package/chunks/{session-store-GZ4A4KYT.js → session-store-27L3ZU73.js} +6 -6
  116. package/chunks/source-files-REHOM44I.js +12 -0
  117. package/chunks/{specdrift-WCLH6TTQ.js → specdrift-AFS54WEJ.js} +5 -5
  118. package/chunks/token-KRWP5JYA.js +72 -0
  119. package/chunks/token-util-DWTL33S3.js +8 -0
  120. package/chunks/variant-candidates-YWZORZMK.js +13 -0
  121. package/chunks/{web-recon-prepass-JJGPEOLE.js → web-recon-prepass-YVMFXCIK.js} +9 -9
  122. package/cli-path-traversal-fixture.js +352 -0
  123. package/dashboard/assets/bot-Bg1Tp9_d.js +1 -0
  124. package/dashboard/assets/dist-B_dDCPbu.js +1 -0
  125. package/dashboard/assets/findings-page-mayGhNx6.js +5 -0
  126. package/dashboard/assets/format--susmHX7.js +1 -0
  127. package/dashboard/assets/input-TuVPR3Zl.js +1 -0
  128. package/dashboard/assets/jsx-runtime-MGseXjj5.js +3 -0
  129. package/dashboard/assets/live-page-HWWHX99U.js +1 -0
  130. package/dashboard/assets/meta-tile-ckHo-w7k.js +1 -0
  131. package/dashboard/assets/operations-BxZ0OoXO.js +10 -0
  132. package/dashboard/assets/operations-CMFVrXEe.css +2 -0
  133. package/dashboard/assets/operations-app-D3d35rgo.js +46 -0
  134. package/dashboard/assets/overview-page-W_4IteEr.js +1 -0
  135. package/dashboard/assets/page-header-Bw9AJgBV.js +1 -0
  136. package/dashboard/assets/scans-page-CgzVXHnn.js +1 -0
  137. package/dashboard/assets/siren-KQj8QAnJ.js +1 -0
  138. package/dashboard/assets/table-8EDklulN.js +1 -0
  139. package/dashboard/assets/tabs-CFHPOwg8.js +1 -0
  140. package/dashboard/index.html +4 -5
  141. package/node_modules/node-addon-api/LICENSE.md +9 -0
  142. package/node_modules/node-addon-api/README.md +95 -0
  143. package/node_modules/node-addon-api/common.gypi +21 -0
  144. package/node_modules/node-addon-api/except.gypi +25 -0
  145. package/node_modules/node-addon-api/index.js +14 -0
  146. package/node_modules/node-addon-api/napi-inl.deprecated.h +186 -0
  147. package/node_modules/node-addon-api/napi-inl.h +7250 -0
  148. package/node_modules/node-addon-api/napi.h +3463 -0
  149. package/node_modules/node-addon-api/node_addon_api.gyp +42 -0
  150. package/node_modules/node-addon-api/node_api.gyp +9 -0
  151. package/node_modules/node-addon-api/noexcept.gypi +26 -0
  152. package/node_modules/node-addon-api/nothing.c +0 -0
  153. package/node_modules/node-addon-api/package-support.json +21 -0
  154. package/node_modules/node-addon-api/package.json +481 -0
  155. package/node_modules/node-addon-api/tools/README.md +73 -0
  156. package/node_modules/node-addon-api/tools/check-napi.js +99 -0
  157. package/node_modules/node-addon-api/tools/clang-format.js +71 -0
  158. package/node_modules/node-addon-api/tools/conversion.js +301 -0
  159. package/node_modules/node-gyp-build/LICENSE +21 -0
  160. package/node_modules/node-gyp-build/README.md +58 -0
  161. package/node_modules/node-gyp-build/SECURITY.md +5 -0
  162. package/node_modules/node-gyp-build/bin.js +84 -0
  163. package/node_modules/node-gyp-build/build-test.js +19 -0
  164. package/node_modules/node-gyp-build/index.js +6 -0
  165. package/node_modules/node-gyp-build/node-gyp-build.js +207 -0
  166. package/node_modules/node-gyp-build/optional.js +7 -0
  167. package/node_modules/node-gyp-build/package.json +43 -0
  168. package/node_modules/tree-sitter/LICENSE +21 -0
  169. package/node_modules/tree-sitter/README.md +90 -0
  170. package/node_modules/tree-sitter/binding.gyp +76 -0
  171. package/node_modules/tree-sitter/index.js +895 -0
  172. package/node_modules/tree-sitter/package.json +62 -0
  173. package/node_modules/tree-sitter/prebuilds/darwin-arm64/tree-sitter.node +0 -0
  174. package/node_modules/tree-sitter/prebuilds/darwin-x64/tree-sitter.node +0 -0
  175. package/node_modules/tree-sitter/prebuilds/linux-x64/tree-sitter.node +0 -0
  176. package/node_modules/tree-sitter/prebuilds/win32-x64/tree-sitter.node +0 -0
  177. package/node_modules/tree-sitter/src/addon_data.h +47 -0
  178. package/node_modules/tree-sitter/src/binding.cc +35 -0
  179. package/node_modules/tree-sitter/src/conversions.cc +140 -0
  180. package/node_modules/tree-sitter/src/conversions.h +22 -0
  181. package/node_modules/tree-sitter/src/language.cc +106 -0
  182. package/node_modules/tree-sitter/src/language.h +17 -0
  183. package/node_modules/tree-sitter/src/logger.cc +70 -0
  184. package/node_modules/tree-sitter/src/logger.h +19 -0
  185. package/node_modules/tree-sitter/src/lookaheaditerator.cc +122 -0
  186. package/node_modules/tree-sitter/src/lookaheaditerator.h +33 -0
  187. package/node_modules/tree-sitter/src/node.cc +1056 -0
  188. package/node_modules/tree-sitter/src/node.h +30 -0
  189. package/node_modules/tree-sitter/src/parser.cc +298 -0
  190. package/node_modules/tree-sitter/src/parser.h +35 -0
  191. package/node_modules/tree-sitter/src/query.cc +383 -0
  192. package/node_modules/tree-sitter/src/query.h +39 -0
  193. package/node_modules/tree-sitter/src/tree.cc +307 -0
  194. package/node_modules/tree-sitter/src/tree.h +45 -0
  195. package/node_modules/tree-sitter/src/tree_cursor.cc +213 -0
  196. package/node_modules/tree-sitter/src/tree_cursor.h +52 -0
  197. package/node_modules/tree-sitter/tree-sitter.d.ts +211 -0
  198. package/node_modules/tree-sitter/vendor/tree-sitter/LICENSE +21 -0
  199. package/node_modules/tree-sitter/vendor/tree-sitter/README.md +21 -0
  200. package/node_modules/tree-sitter/vendor/tree-sitter/lib/README.md +6 -0
  201. package/node_modules/tree-sitter/vendor/tree-sitter/lib/include/tree_sitter/api.h +1266 -0
  202. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.c +48 -0
  203. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.h +41 -0
  204. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/array.h +290 -0
  205. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/atomic.h +68 -0
  206. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/clock.h +146 -0
  207. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/error_costs.h +11 -0
  208. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.c +501 -0
  209. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.h +36 -0
  210. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/host.h +21 -0
  211. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.c +221 -0
  212. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.h +299 -0
  213. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/length.h +52 -0
  214. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.c +419 -0
  215. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.h +49 -0
  216. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lib.c +14 -0
  217. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/node.c +774 -0
  218. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.c +2151 -0
  219. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.h +230 -0
  220. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/point.h +62 -0
  221. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/query.c +4134 -0
  222. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reduce_action.h +34 -0
  223. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reusable_node.h +95 -0
  224. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.c +899 -0
  225. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.h +133 -0
  226. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.c +1060 -0
  227. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.h +382 -0
  228. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.c +165 -0
  229. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.h +31 -0
  230. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.c +714 -0
  231. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.h +48 -0
  232. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ICU_SHA +1 -0
  233. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/LICENSE +414 -0
  234. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/README.md +29 -0
  235. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ptypes.h +1 -0
  236. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/umachine.h +448 -0
  237. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/urename.h +1 -0
  238. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf.h +1 -0
  239. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf16.h +733 -0
  240. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf8.h +881 -0
  241. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode.h +50 -0
  242. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib-symbols.txt +23 -0
  243. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib.c +109 -0
  244. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/wasm-stdlib.h +1294 -0
  245. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.c +1823 -0
  246. package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.h +31 -0
  247. package/node_modules/tree-sitter/vendor/tree-sitter/test/fixtures/grammars/.gitkeep +0 -0
  248. package/node_modules/tree-sitter-c/LICENSE +21 -0
  249. package/node_modules/tree-sitter-c/README.md +18 -0
  250. package/node_modules/tree-sitter-c/binding.gyp +20 -0
  251. package/node_modules/tree-sitter-c/bindings/node/binding.cc +20 -0
  252. package/node_modules/tree-sitter-c/bindings/node/index.d.ts +28 -0
  253. package/node_modules/tree-sitter-c/bindings/node/index.js +7 -0
  254. package/node_modules/tree-sitter-c/grammar.js +1463 -0
  255. package/node_modules/tree-sitter-c/package.json +108 -0
  256. package/node_modules/tree-sitter-c/prebuilds/darwin-arm64/tree-sitter-c.node +0 -0
  257. package/node_modules/tree-sitter-c/prebuilds/darwin-x64/tree-sitter-c.node +0 -0
  258. package/node_modules/tree-sitter-c/prebuilds/linux-x64/tree-sitter-c.node +0 -0
  259. package/node_modules/tree-sitter-c/prebuilds/win32-x64/tree-sitter-c.node +0 -0
  260. package/node_modules/tree-sitter-c/queries/highlights.scm +81 -0
  261. package/node_modules/tree-sitter-c/queries/tags.scm +9 -0
  262. package/node_modules/tree-sitter-c/src/grammar.json +9682 -0
  263. package/node_modules/tree-sitter-c/src/node-types.json +4556 -0
  264. package/node_modules/tree-sitter-c/src/parser.c +113852 -0
  265. package/node_modules/tree-sitter-c/src/tree_sitter/alloc.h +54 -0
  266. package/node_modules/tree-sitter-c/src/tree_sitter/array.h +290 -0
  267. package/node_modules/tree-sitter-c/src/tree_sitter/parser.h +265 -0
  268. package/package.json +20 -13
  269. package/vendor/tree-sitter-0.21.1-node24.json +16 -0
  270. package/vendor/tree-sitter-0.21.1-node24.tgz +0 -0
  271. package/chunks/adapt-loop-SMH6V4PD.js +0 -18
  272. package/chunks/appsec-catalog-CBWHGTEL.js +0 -24
  273. package/chunks/chunk-242TMK6G.js +0 -110
  274. package/chunks/chunk-57ZENEX2.js +0 -169
  275. package/chunks/chunk-ADOLI6DT.js +0 -102
  276. package/chunks/chunk-ATATQACO.js +0 -471
  277. package/chunks/chunk-C2WXWFBB.js +0 -1070
  278. package/chunks/chunk-F3WBKITT.js +0 -687
  279. package/chunks/chunk-H2FFLZNK.js +0 -3
  280. package/chunks/chunk-LP3HHYQU.js +0 -245
  281. package/chunks/chunk-QI233I24.js +0 -333
  282. package/chunks/chunk-RRMJC3ZE.js +0 -105
  283. package/chunks/chunk-Z5FA2XOX.js +0 -2798
  284. package/chunks/cost-ledger-NU63MYZM.js +0 -13
  285. package/chunks/db-KFWOAUUB.js +0 -16
  286. package/chunks/eval-runner-7ZF472KV.js +0 -27
  287. package/chunks/fix-IG7LYXH3.js +0 -12
  288. package/chunks/harness-7ODOLOWU.js +0 -22
  289. package/chunks/http-conformance-DU66MZIU.js +0 -11
  290. package/chunks/http-sender-GWH2IYEA.js +0 -10
  291. package/chunks/hunt-scan-MMKUOETU.js +0 -38
  292. package/chunks/memsafety-scan-J7SECV5W.js +0 -16
  293. package/chunks/npm-dynamic-discovery-AHROOZDB.js +0 -13
  294. package/chunks/orchestrate-OC2VZN2X.js +0 -62
  295. package/chunks/pipeline-BZK5BLJR.js +0 -14
  296. package/chunks/prepare-MYY743TK.js +0 -13
  297. package/chunks/process-LQRCS5OY.js +0 -13
  298. package/chunks/replay-runner-45G3VU7X.js +0 -39
  299. package/chunks/runtime-J7PLXZNM.js +0 -12
  300. package/chunks/scope-BI7BF4ZY.js +0 -18
  301. package/chunks/source-files-PWRQR6LY.js +0 -12
  302. package/chunks/variant-candidates-YERCYMPD.js +0 -13
  303. package/dashboard/assets/0sec-icon-66SreztZ.gif +0 -0
  304. package/dashboard/assets/bot-yILPnRgD.js +0 -1
  305. package/dashboard/assets/chevron-down-BeDJ-Vka.js +0 -1
  306. package/dashboard/assets/circle-alert-BEnMBMT-.js +0 -1
  307. package/dashboard/assets/client-DRYsuOGl.js +0 -9
  308. package/dashboard/assets/copy-Bi5vzoF9.js +0 -1
  309. package/dashboard/assets/desktop-CXTQonNm.js +0 -32
  310. package/dashboard/assets/desktop-NOekk4QS.css +0 -1
  311. package/dashboard/assets/dist-CmX-h7a4.js +0 -1
  312. package/dashboard/assets/dist-DAwYQmf_.js +0 -45
  313. package/dashboard/assets/findings-page-CACW9nw2.js +0 -5
  314. package/dashboard/assets/format-PoISqsES.js +0 -1
  315. package/dashboard/assets/jsx-runtime-C7oxC63R.js +0 -1
  316. package/dashboard/assets/live-page-DrgQqQK5.js +0 -1
  317. package/dashboard/assets/meta-tile-CcskIV_o.js +0 -1
  318. package/dashboard/assets/operations-BKE8T-vY.css +0 -2
  319. package/dashboard/assets/operations-D8nUP5_m.js +0 -4
  320. package/dashboard/assets/operations-app-CQQhG54n.js +0 -2
  321. package/dashboard/assets/overview-page-DTGS8dPo.js +0 -1
  322. package/dashboard/assets/page-header-MFVvEtZW.js +0 -1
  323. package/dashboard/assets/play-Dwo-9xt6.js +0 -1
  324. package/dashboard/assets/scans-page-ChVtq8Us.js +0 -1
  325. package/dashboard/assets/search-CiooTLck.js +0 -1
  326. package/dashboard/assets/siren-CCBwTSuk.js +0 -1
  327. package/dashboard/assets/table-BYS-nIVA.js +0 -1
  328. package/dashboard/assets/tabs-DivxbhQy.js +0 -1
  329. package/dashboard/desktop.html +0 -21
@@ -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
  external_exports
6
- } from "./chunk-YLMN3N25.js";
6
+ } from "./chunk-VIT5ALXF.js";
7
7
 
8
8
  // packages/shared/dist/identity.js
9
9
  function defaultRoleFor(auth) {
@@ -45,7 +45,7 @@ import { fileURLToPath } from "node:url";
45
45
  import { dirname, join } from "node:path";
46
46
  function loadVersion() {
47
47
  if (true) {
48
- return "0.18.0";
48
+ return "0.22.0";
49
49
  }
50
50
  try {
51
51
  const here = dirname(fileURLToPath(import.meta.url));
@@ -89,6 +89,9 @@ function meetsSeverityFloor(severity, floor = DEFAULT_SEVERITY_FLOOR) {
89
89
  // packages/shared/dist/pricing.oss.generated.js
90
90
  var OSS_PRICING = {
91
91
  "gpt-6-astra": { input: 10, output: 50, cachedInput: 1 },
92
+ "gpt-6-sol": { input: 2, output: 10, cachedInput: 0.2 },
93
+ "gpt-6.1-sol": { input: 2, output: 10, cachedInput: 0.1 },
94
+ "gpt-6-luna": { input: 0.1, output: 0.5, cachedInput: 0.01 },
92
95
  "claude-fable-5-1": { input: 10, output: 50, cachedInput: 0.25 },
93
96
  "claude-opus-5": { input: 5, output: 25, cachedInput: 0.5 },
94
97
  "claude-sonnet-5": { input: 2, output: 10, cachedInput: 0.2 },
@@ -111,13 +114,12 @@ var OSS_PRICING = {
111
114
  "o4-mini": { input: 1.1, output: 4.4, cachedInput: 0.275 },
112
115
  "gemini-2.5-pro": { input: 1.25, output: 10, cachedInput: 0.125 },
113
116
  "gemini-2.5-flash": { input: 0.3, output: 2.5, cachedInput: 0.03 },
114
- "gemini-2.0-flash": { input: 0.1, output: 0.4, cachedInput: 0.025 },
115
117
  "deepseek-chat": { input: 0.28, output: 0.42, cachedInput: 0.028 },
116
118
  "deepseek-reasoner": { input: 0.28, output: 0.42, cachedInput: 0.028 }
117
119
  };
118
120
 
119
121
  // packages/shared/dist/pricing.js
120
- var PRICING_SNAPSHOT_DATE = "2026-09-11";
122
+ var PRICING_SNAPSHOT_DATE = "2026-09-29";
121
123
  var MANUAL_PRICING = {
122
124
  // Anthropic (versioned; LiteLLM keys use different suffixes → keep manual)
123
125
  "claude-opus-4-7": { input: 5, output: 25, cachedInput: 0.5 },
@@ -126,6 +128,8 @@ var MANUAL_PRICING = {
126
128
  "claude-haiku-4-5": { input: 0.8, output: 4, cachedInput: 0.08 },
127
129
  // OpenAI codex alias — mirrors gpt-5.5 (OSS feed has only the bare key)
128
130
  "gpt-5.5-codex": { input: 5, output: 30 },
131
+ // LiteLLM no longer carries this exact key; retain its last published rate.
132
+ "gemini-2.0-flash": { input: 0.1, output: 0.4, cachedInput: 0.025 },
129
133
  // Meta (hosted) — not in the OSS feed
130
134
  "llama-4-maverick": { input: 0.5, output: 0.77 },
131
135
  "llama-4-scout": { input: 0.2, output: 0.35 },
@@ -200,25 +204,47 @@ var MANUAL_PRICING = {
200
204
  // which this schema cannot represent.
201
205
  "DeepSeek-V4-Pro": { input: 1.74, output: 3.48 },
202
206
  "DeepSeek-V4-Flash": { input: 0.19, output: 0.51 },
207
+ // Fireworks Priority list-rate estimate, not an Azure invoice.
208
+ // The cache estimate remains rounded; don't substitute direct API pricing
209
+ // for the separately metered Foundry deployment.
210
+ "deepseek-v4.1-flash": { input: 0.375, output: 1.5, cachedInput: 8e-3 },
203
211
  "Kimi-K2.7-Code": { input: 0.95, output: 4, cachedInput: 0.19 },
204
212
  "gpt-oss-120b": { input: 0.15, output: 0.6 },
205
213
  "gpt-5.6-sol": { input: 5, output: 30, cachedInput: 0.5 },
206
214
  "gpt-5.6-luna": { input: 1, output: 6, cachedInput: 0.1 },
207
215
  "gpt-5.6-terra": { input: 2.5, output: 15, cachedInput: 0.25 },
216
+ // Azure Global Standard short-context list estimate (2026-09-23).
217
+ // Hosted settlement separately meters cache writes and bounds input context.
218
+ "gpt-6-luna": { input: 0.1, output: 0.5, cachedInput: 0.01 },
208
219
  default: { input: 3, output: 15 }
209
220
  };
210
221
  var MODEL_PRICING = {
211
222
  ...MANUAL_PRICING,
212
223
  ...OSS_PRICING
213
224
  };
225
+ var DISCOVERED_PRICING = /* @__PURE__ */ new Map();
226
+ function registerModelPricing(model, rates) {
227
+ if (!model || model !== model.trim() || /[\s\x00-\x1f\x7f]/.test(model) || Object.hasOwn(MODEL_PRICING, model) || !Number.isFinite(rates.input) || rates.input < 0 || !Number.isFinite(rates.output) || rates.output < 0 || rates.cachedInput !== void 0 && (!Number.isFinite(rates.cachedInput) || rates.cachedInput < 0)) {
228
+ return false;
229
+ }
230
+ DISCOVERED_PRICING.set(model, Object.freeze({
231
+ input: rates.input,
232
+ output: rates.output,
233
+ ...rates.cachedInput !== void 0 ? { cachedInput: rates.cachedInput } : {}
234
+ }));
235
+ return true;
236
+ }
214
237
  var AZURE_DEPLOYMENT_PRICE_ALIASES = /* @__PURE__ */ new Map([
215
238
  ["deepseek-v4-pro", "DeepSeek-V4-Pro"],
216
239
  ["deepseek-v4-flash", "DeepSeek-V4-Flash"],
240
+ ["deepseek-v4.1-flash", "deepseek-v4.1-flash"],
241
+ ["fw-deepseek-v4.1-flash", "deepseek-v4.1-flash"],
217
242
  ["kimi-k2.7-code", "Kimi-K2.7-Code"],
218
243
  ["gpt-oss-120b", "gpt-oss-120b"],
219
244
  ["gpt-5.6-sol", "gpt-5.6-sol"],
220
245
  ["gpt-5.6-luna", "gpt-5.6-luna"],
221
- ["gpt-5.6-terra", "gpt-5.6-terra"]
246
+ ["gpt-5.6-terra", "gpt-5.6-terra"],
247
+ ["gpt-6-luna", "gpt-6-luna"]
222
248
  ]);
223
249
  function azureDeploymentPriceKey(model) {
224
250
  const lower = model.toLowerCase();
@@ -228,34 +254,46 @@ function azureDeploymentPriceKey(model) {
228
254
  }
229
255
  return null;
230
256
  }
257
+ var MODEL_VENDOR_PREFIXES = [
258
+ "openai/",
259
+ "azure/",
260
+ "anthropic/",
261
+ "google/",
262
+ "deepseek/",
263
+ "meta/",
264
+ "mistral/",
265
+ "z-ai/",
266
+ "zai/",
267
+ "kimi/",
268
+ "moonshot/",
269
+ "qwen/",
270
+ "openrouter/",
271
+ "opencode/",
272
+ "xai/",
273
+ "x-ai/"
274
+ ];
231
275
  function normalizeModel(model) {
232
- const prefixes = [
233
- "openai/",
234
- "anthropic/",
235
- "google/",
236
- "deepseek/",
237
- "meta/",
238
- "mistral/",
239
- "z-ai/",
240
- "zai/",
241
- "kimi/",
242
- "moonshot/",
243
- "openrouter/",
244
- "opencode/"
245
- ];
246
- for (const prefix of prefixes) {
247
- if (model.startsWith(prefix))
248
- return model.slice(prefix.length);
276
+ let key = model;
277
+ for (; ; ) {
278
+ let stripped = false;
279
+ for (const prefix of MODEL_VENDOR_PREFIXES) {
280
+ if (!key.startsWith(prefix))
281
+ continue;
282
+ key = key.slice(prefix.length);
283
+ stripped = true;
284
+ break;
285
+ }
286
+ if (!stripped)
287
+ return key;
249
288
  }
250
- return model;
251
289
  }
252
290
  function getRates(model) {
253
291
  const key = model ? normalizeModel(model) : "";
254
292
  const aliasKey = azureDeploymentPriceKey(key);
255
- const rates = MODEL_PRICING[key] ?? (aliasKey ? MODEL_PRICING[aliasKey] : void 0);
293
+ const rates = (model && Object.hasOwn(MODEL_PRICING, model) ? MODEL_PRICING[model] : void 0) ?? (model ? DISCOVERED_PRICING.get(model) : void 0) ?? (Object.hasOwn(MODEL_PRICING, key) ? MODEL_PRICING[key] : void 0) ?? (aliasKey ? MODEL_PRICING[aliasKey] : void 0) ?? DISCOVERED_PRICING.get(key);
256
294
  if (!rates) {
257
295
  if (model)
258
- console.warn(`[0sec] Unknown model for cost estimation: ${model}`);
296
+ console.warn(`[0] Unknown model for cost estimation: ${model}`);
259
297
  return MODEL_PRICING.default;
260
298
  }
261
299
  return rates;
@@ -276,6 +314,8 @@ function modelProvider(model) {
276
314
  const lowered = model.toLowerCase();
277
315
  if (lowered.startsWith("openai/"))
278
316
  return "openai";
317
+ if (lowered.startsWith("azure/"))
318
+ return "azure";
279
319
  if (lowered.startsWith("anthropic/"))
280
320
  return "anthropic";
281
321
  if (lowered.startsWith("google/"))
@@ -349,7 +389,7 @@ var VerificationModeSchema = external_exports.enum([
349
389
  "deterministic_replay",
350
390
  "agent_assisted"
351
391
  ]);
352
- var RunnerKindSchema = external_exports.enum(["local", "docker", "qemu"]);
392
+ var RunnerKindSchema = external_exports.enum(["local", "smolvm", "docker", "qemu"]);
353
393
  var EngineMetadataSchema = external_exports.object({
354
394
  os: external_exports.string(),
355
395
  arch: external_exports.string(),
@@ -360,7 +400,9 @@ var VerificationCommandSchema = external_exports.object({
360
400
  exit_code: external_exports.number().int().nullable(),
361
401
  stdout_excerpt: external_exports.string().optional(),
362
402
  stderr_excerpt: external_exports.string().optional(),
363
- duration_ms: external_exports.number().nonnegative()
403
+ duration_ms: external_exports.number().nonnegative(),
404
+ timed_out: external_exports.boolean().optional(),
405
+ cancelled: external_exports.boolean().optional()
364
406
  });
365
407
  var AssertionKindSchema = external_exports.enum([
366
408
  "file_exists",
@@ -831,18 +873,22 @@ function researchPlatformLpeDisclosureReady(envelope, platform) {
831
873
  // packages/shared/dist/paths.js
832
874
  import { homedir } from "node:os";
833
875
  import { join as join2 } from "node:path";
834
- function homeStateDir(home = homedir()) {
835
- return join2(home, ".0sec");
876
+ function homeStateDir(home = process.env.HOME || homedir()) {
877
+ return join2(home, ".0");
878
+ }
879
+ function cloudStateDir(home = process.env.HOME || homedir(), env = process.env) {
880
+ const state = homeStateDir(home);
881
+ return env["ZERO_DEV_SOURCE_ROOT"]?.trim() ? join2(state, "dev") : state;
836
882
  }
837
883
  function runStateDir(runId, home) {
838
884
  if (!/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(runId)) {
839
- throw new Error(`Invalid 0sec run id ${JSON.stringify(runId)}.`);
885
+ throw new Error(`Invalid 0 run id ${JSON.stringify(runId)}.`);
840
886
  }
841
887
  return join2(homeStateDir(home), "runs", runId);
842
888
  }
843
889
 
844
890
  // packages/shared/dist/agent-assurance.js
845
- var AGENT_ACTION_ASSURANCE_SCHEMA_VERSION = "0sec.agent-action-assurance/v1";
891
+ var AGENT_ACTION_ASSURANCE_SCHEMA_VERSION = "0.agent-action-assurance/v1";
846
892
  var AgentInjectionVectorSchema = external_exports.enum([
847
893
  "readme",
848
894
  "code-comment",
@@ -972,7 +1018,7 @@ function parseAgentActionEvidenceManifest(value) {
972
1018
  }
973
1019
 
974
1020
  // packages/shared/dist/presentation.js
975
- var PRESENTATION_PROTOCOL = "0sec.presentation/v1";
1021
+ var PRESENTATION_PROTOCOL = "0.presentation/v1";
976
1022
  function createTranscriptDocument(entries) {
977
1023
  return {
978
1024
  protocol: PRESENTATION_PROTOCOL,
@@ -1015,6 +1061,176 @@ var DESKTOP_CONSOLE_SCHEMA_VERSION = 1;
1015
1061
  var DEFAULT_AUTONOMY_MODE = "yolo";
1016
1062
  var DEFAULT_ALLOW_MODEL_SELF_EXTENSION = true;
1017
1063
 
1064
+ // packages/shared/dist/jev.js
1065
+ var FEATURES = ["browser", "memory", "dedupe", "redteam", "kernel", "crash", "radar", "foxguard"];
1066
+ var INPUT_USD_PER_TOKEN = 0.042 / 1e6;
1067
+ var MAX_INPUT_TOKENS = 65536;
1068
+ var REQUEST_RESERVATION_USD = MAX_INPUT_TOKENS * INPUT_USD_PER_TOKEN;
1069
+ var probability = external_exports.number().finite().min(0).max(1);
1070
+ var questionSchema = external_exports.discriminatedUnion("type", [
1071
+ external_exports.object({
1072
+ type: external_exports.literal("boolean"),
1073
+ instructions: external_exports.string().min(1).max(8192),
1074
+ criteria: external_exports.object({ true: external_exports.string().max(4096), false: external_exports.string().max(4096) }).optional()
1075
+ }).strict(),
1076
+ external_exports.object({
1077
+ type: external_exports.literal("choice"),
1078
+ instructions: external_exports.string().min(1).max(8192),
1079
+ criteria: external_exports.record(external_exports.string().min(1).max(128), external_exports.string().max(4096)).refine((value) => Object.keys(value).length >= 2 && Object.keys(value).length <= 64)
1080
+ }).strict()
1081
+ ]);
1082
+ var normalizedAnswerSchema = external_exports.discriminatedUnion("type", [
1083
+ external_exports.object({ type: external_exports.literal("boolean"), probability }),
1084
+ external_exports.object({ type: external_exports.literal("choice"), choice: external_exports.string(), probabilities: external_exports.record(probability) })
1085
+ ]);
1086
+ var usageSchema = external_exports.object({
1087
+ inputTokens: external_exports.number().int().nonnegative().max(MAX_INPUT_TOKENS),
1088
+ outputTokens: external_exports.number().int().nonnegative()
1089
+ });
1090
+ function positiveNumber(value, fallback, name) {
1091
+ if (value === void 0)
1092
+ return fallback;
1093
+ const parsed = Number(value);
1094
+ if (!Number.isFinite(parsed) || parsed <= 0)
1095
+ throw new Error(`${name} must be a positive number`);
1096
+ return parsed;
1097
+ }
1098
+ function jevConfigFromEnvironment(feature, environment) {
1099
+ const requested = (environment["ZERO_JEV_FEATURES"] ?? "").split(",").map((item) => item.trim()).filter(Boolean);
1100
+ for (const name of requested) {
1101
+ if (!FEATURES.includes(name))
1102
+ throw new Error(`Unknown ZERO_JEV_FEATURES entry: ${name}`);
1103
+ }
1104
+ if (!requested.includes(feature))
1105
+ return void 0;
1106
+ const provider = environment["ZERO_JEV_PROVIDER"] ?? "vercel";
1107
+ if (provider !== "vercel" && provider !== "cloud") {
1108
+ throw new Error("ZERO_JEV_PROVIDER must be vercel or cloud");
1109
+ }
1110
+ const common = {
1111
+ timeoutMs: positiveNumber(environment["ZERO_JEV_TIMEOUT_MS"], 1e4, "ZERO_JEV_TIMEOUT_MS"),
1112
+ maxRequests: positiveNumber(environment["ZERO_JEV_MAX_REQUESTS"], 100, "ZERO_JEV_MAX_REQUESTS"),
1113
+ maxCostUsd: positiveNumber(environment["ZERO_JEV_MAX_COST_USD"], 0.1, "ZERO_JEV_MAX_COST_USD")
1114
+ };
1115
+ const keyName = provider === "cloud" ? "ZERO_JEV_CLOUD_TOKEN" : "AI_GATEWAY_API_KEY";
1116
+ const apiKey = environment[keyName]?.trim();
1117
+ if (!apiKey)
1118
+ throw new Error(`${keyName} is required when Jev assistance is enabled`);
1119
+ if (provider === "cloud") {
1120
+ return { provider, apiKey, cloudUrl: environment["ZERO_JEV_CLOUD_URL"], feature, ...common };
1121
+ }
1122
+ return {
1123
+ provider,
1124
+ apiKey,
1125
+ ...common
1126
+ };
1127
+ }
1128
+ function createJevEvaluator(config) {
1129
+ if (!config.apiKey.trim())
1130
+ throw new Error("A Jev provider credential is required");
1131
+ const timeoutMs = config.timeoutMs ?? 1e4;
1132
+ const maxRequests = config.maxRequests ?? 100;
1133
+ const maxCostUsd = config.maxCostUsd ?? 0.1;
1134
+ if (!Number.isInteger(timeoutMs) || timeoutMs < 1 || timeoutMs > 6e4 || !Number.isInteger(maxRequests) || maxRequests < 1 || maxRequests > 1e4 || !Number.isFinite(maxCostUsd) || maxCostUsd <= 0) {
1135
+ throw new Error("Invalid Jev timeout, request limit, or cost budget");
1136
+ }
1137
+ if (config.provider === "cloud") {
1138
+ const url = new URL(config.cloudUrl ?? "");
1139
+ if (url.protocol !== "https:" && !(url.protocol === "http:" && ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname)) || url.username || url.password || url.search || url.hash || !config.feature || !FEATURES.includes(config.feature)) {
1140
+ throw new Error("Invalid Jev cloud evaluation endpoint or feature");
1141
+ }
1142
+ }
1143
+ let requests = 0;
1144
+ let chargedOrReservedUsd = 0;
1145
+ const fetchImpl = config.fetch ?? globalThis.fetch;
1146
+ return {
1147
+ async evaluate(request) {
1148
+ request.signal?.throwIfAborted();
1149
+ const questions = external_exports.record(external_exports.string().regex(/^[a-zA-Z][a-zA-Z0-9_]{0,63}$/), questionSchema).parse(request.questions);
1150
+ const questionIds = Object.keys(questions);
1151
+ if (questionIds.length < 1 || questionIds.length > 64)
1152
+ throw new Error("Jev requires between 1 and 64 questions");
1153
+ const encoded = JSON.stringify({ state: request.state, questions });
1154
+ if (encoded.length > 32e3)
1155
+ throw new Error("Jev state and questions exceed the bounded input limit");
1156
+ if (requests >= maxRequests || chargedOrReservedUsd + REQUEST_RESERVATION_USD > maxCostUsd) {
1157
+ throw new Error("Jev workflow evaluation budget exhausted");
1158
+ }
1159
+ requests++;
1160
+ chargedOrReservedUsd += REQUEST_RESERVATION_USD;
1161
+ const startedAt = performance.now();
1162
+ const signal = request.signal ? AbortSignal.any([request.signal, AbortSignal.timeout(timeoutMs)]) : AbortSignal.timeout(timeoutMs);
1163
+ let rawAnswers;
1164
+ let model;
1165
+ let rawUsage;
1166
+ try {
1167
+ if (config.provider === "cloud") {
1168
+ const response = await fetchImpl(config.cloudUrl, {
1169
+ method: "POST",
1170
+ signal,
1171
+ redirect: "error",
1172
+ headers: { Authorization: `Bearer ${config.apiKey}`, "Content-Type": "application/json" },
1173
+ body: JSON.stringify({ feature: config.feature, state: request.state, questions })
1174
+ });
1175
+ if (!response.ok)
1176
+ throw new Error(`Jev provider returned HTTP ${response.status}`);
1177
+ const body = external_exports.object({ model: external_exports.string().min(1), answers: external_exports.record(external_exports.unknown()), usage: usageSchema }).parse(await response.json());
1178
+ model = body.model;
1179
+ rawUsage = body.usage;
1180
+ rawAnswers = body.answers;
1181
+ } else {
1182
+ const [{ experimental_evaluate: evaluate }, { createGateway }] = await Promise.all([
1183
+ import("./dist-KEULE5IQ.js"),
1184
+ import("./dist-XZB53PS5.js")
1185
+ ]);
1186
+ signal.throwIfAborted();
1187
+ const gateway = createGateway({ apiKey: config.apiKey, fetch: fetchImpl });
1188
+ const result = await evaluate({
1189
+ model: gateway.evaluationModel("typesafe-ai/jev"),
1190
+ state: typeof request.state === "string" ? request.state : JSON.stringify(request.state),
1191
+ questions,
1192
+ abortSignal: signal,
1193
+ maxRetries: 0
1194
+ });
1195
+ model = result.response.modelId;
1196
+ rawUsage = result.usage;
1197
+ rawAnswers = result.answers;
1198
+ }
1199
+ signal.throwIfAborted();
1200
+ const parsedUsage = usageSchema.parse(rawUsage);
1201
+ const usage = { ...parsedUsage, estimatedCostUsd: parsedUsage.inputTokens * INPUT_USD_PER_TOKEN };
1202
+ chargedOrReservedUsd += usage.estimatedCostUsd - REQUEST_RESERVATION_USD;
1203
+ config.onUsage?.(usage);
1204
+ if (Object.keys(rawAnswers).length !== questionIds.length)
1205
+ throw new Error("Jev returned unexpected answer IDs");
1206
+ const answers = /* @__PURE__ */ Object.create(null);
1207
+ for (const id of questionIds) {
1208
+ const question = questions[id];
1209
+ const answer = normalizedAnswerSchema.parse(rawAnswers[id]);
1210
+ if (question.type !== answer.type)
1211
+ throw new Error("Jev answer type does not match its question");
1212
+ if (question.type === "choice" && answer.type === "choice") {
1213
+ const options = Object.keys(question.criteria);
1214
+ if (!Object.hasOwn(question.criteria, answer.choice) || Object.keys(answer.probabilities).length !== options.length || options.some((option) => !Object.hasOwn(answer.probabilities, option)) || Math.abs(options.reduce((sum, option) => sum + answer.probabilities[option], 0) - 1) > 0.02 || options.some((option) => answer.probabilities[option] > answer.probabilities[answer.choice])) {
1215
+ throw new Error("Jev returned an invalid choice distribution");
1216
+ }
1217
+ }
1218
+ answers[id] = answer;
1219
+ }
1220
+ return { model, answers, usage, durationMs: performance.now() - startedAt };
1221
+ } catch (error) {
1222
+ if (signal.aborted)
1223
+ throw new Error(request.signal?.aborted ? "Jev evaluation cancelled" : "Jev evaluation timed out");
1224
+ if (error instanceof external_exports.ZodError)
1225
+ throw new Error("Jev provider returned malformed evaluation data");
1226
+ if (error instanceof Error && /^Jev (provider returned HTTP \d{3}|returned (unexpected answer IDs|an invalid choice distribution)|answer type does not match its question)$/.test(error.message))
1227
+ throw error;
1228
+ throw new Error("Jev evaluation unavailable; retain the existing decision path");
1229
+ }
1230
+ }
1231
+ };
1232
+ }
1233
+
1018
1234
  export {
1019
1235
  defaultRoleFor,
1020
1236
  resolveIdentities,
@@ -1033,6 +1249,7 @@ export {
1033
1249
  PRICING_SNAPSHOT_DATE,
1034
1250
  MANUAL_PRICING,
1035
1251
  MODEL_PRICING,
1252
+ registerModelPricing,
1036
1253
  getRates,
1037
1254
  estimateCost,
1038
1255
  priceRun,
@@ -1073,6 +1290,7 @@ export {
1073
1290
  researchWindowsLpeDisclosureReady,
1074
1291
  researchPlatformLpeDisclosureReady,
1075
1292
  homeStateDir,
1293
+ cloudStateDir,
1076
1294
  runStateDir,
1077
1295
  AGENT_ACTION_ASSURANCE_SCHEMA_VERSION,
1078
1296
  AgentInjectionVectorSchema,
@@ -1090,5 +1308,7 @@ export {
1090
1308
  isPresentationEvent,
1091
1309
  DESKTOP_CONSOLE_SCHEMA_VERSION,
1092
1310
  DEFAULT_AUTONOMY_MODE,
1093
- DEFAULT_ALLOW_MODEL_SELF_EXTENSION
1311
+ DEFAULT_ALLOW_MODEL_SELF_EXTENSION,
1312
+ jevConfigFromEnvironment,
1313
+ createJevEvaluator
1094
1314
  };