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.
- package/{0sec.js → 0.js} +90 -82
- package/LICENSE +1 -1
- package/README.md +62 -46
- package/chunks/adapt-loop-7I57LXXR.js +18 -0
- package/chunks/{adgraph-JLGA6RYI.js → adgraph-AUDQTBYA.js} +5 -5
- package/chunks/agent/skills/frameworks/entra-id.yaml +2 -2
- package/chunks/agent/skills/techniques/assumption-mining.yaml +2 -2
- package/chunks/agent/skills/techniques/cve-poc-adaptation.yaml +2 -2
- package/chunks/agent/skills/techniques/entra-attack-paths.yaml +1 -1
- package/chunks/agent/skills/techniques/kernel-weaponization.yaml +1 -1
- package/chunks/agent/skills/techniques/llm-prompt-injection.yaml +2 -2
- package/chunks/agent/skills/techniques/npm-ecosystem.yaml +1 -1
- package/chunks/agent/skills/techniques/poc-verification.yaml +1 -1
- package/chunks/agent/skills/techniques/seedless-depth-review.yaml +20 -38
- package/chunks/{artifact-scraper-HQ7HLP6V.js → artifact-scraper-PYZ3RU3O.js} +6 -6
- package/chunks/{assumption-mining-5SNIVVDN.js → assumption-mining-MFLF43IR.js} +24 -26
- package/chunks/{chunk-7DQEV5QI.js → chunk-23DG5YKS.js} +4 -4
- package/chunks/{chunk-UR4ELX2Y.js → chunk-2GV4HQKE.js} +340 -703
- package/chunks/{chunk-P6WKNFWX.js → chunk-2OQOQ2FZ.js} +8 -8
- package/chunks/{chunk-5G3ZXFBW.js → chunk-2WNCI664.js} +3 -3
- package/chunks/{chunk-DW5UWPFY.js → chunk-4VGLO2YS.js} +6 -5
- package/chunks/{chunk-KLTNTE2Z.js → chunk-5IBCBQEH.js} +13 -14
- package/chunks/{chunk-N7BOUYEV.js → chunk-5MWAG3FT.js} +14 -14
- package/chunks/{chunk-OEFNRYI2.js → chunk-6GHSR47F.js} +3 -6
- package/chunks/chunk-6YNKRUMC.js +4474 -0
- package/chunks/{chunk-6L26OBWI.js → chunk-76KSBWOQ.js} +255 -35
- package/chunks/chunk-7DEHG7YT.js +2143 -0
- package/chunks/{chunk-AD7WXDH6.js → chunk-7UFUALR2.js} +288 -22
- package/chunks/{chunk-53G27VPS.js → chunk-AZ7L3HFD.js} +7 -2
- package/chunks/{chunk-TSK2AG6J.js → chunk-CAYANSH6.js} +173 -1757
- package/chunks/{chunk-SAFFWQW4.js → chunk-DKSCN2AB.js} +7 -7
- package/chunks/{chunk-2JCCA2JL.js → chunk-DM5C5L5D.js} +3 -3
- package/chunks/{chunk-RWONANDA.js → chunk-DQTNI3KY.js} +5 -5
- package/chunks/{chunk-5JI7L7KV.js → chunk-EGZGZFAH.js} +10036 -12938
- package/chunks/{chunk-6LKRLK2R.js → chunk-FHC2B7LN.js} +3 -3
- package/chunks/{chunk-MYVT64FN.js → chunk-GHWODZMR.js} +2 -2
- package/chunks/{chunk-2RMLOJVB.js → chunk-GVD6SJGH.js} +2 -2
- package/chunks/{chunk-SF4KZ4O3.js → chunk-HLFS6WV2.js} +2 -2
- package/chunks/chunk-HR2TU42B.js +1228 -0
- package/chunks/{chunk-BFRB6HB2.js → chunk-HUNAPTKV.js} +3 -3
- package/chunks/chunk-IO7R7WBM.js +114 -0
- package/chunks/{chunk-WEBMRWEG.js → chunk-IXT64DV5.js} +656 -1868
- package/chunks/{chunk-3MOLBTLS.js → chunk-K2PWUPUI.js} +2 -2
- package/chunks/{chunk-WXQ6BJ6A.js → chunk-LCRTAQN2.js} +7 -7
- package/chunks/{chunk-SVJEDVYK.js → chunk-LPTRPRZR.js} +5 -5
- package/chunks/{chunk-CMKXP5RR.js → chunk-LYUAM3TG.js} +3 -3
- package/chunks/{chunk-BVAZO4WA.js → chunk-MICHDTBK.js} +3 -3
- package/chunks/{chunk-UCYRA73C.js → chunk-OAYUPGF6.js} +4 -4
- package/chunks/{chunk-XM5NLHYU.js → chunk-OWLJYJ5O.js} +14 -14
- package/chunks/{chunk-BKZFDZ23.js → chunk-QCUFBVIZ.js} +3 -3
- package/chunks/chunk-RE5EZDG2.js +5523 -0
- package/chunks/{chunk-ASUR522M.js → chunk-RRD4XXPU.js} +9 -9
- package/chunks/{chunk-AHTBZC3E.js → chunk-RSIUX3RW.js} +4 -4
- package/chunks/{chunk-BZNEY2ZS.js → chunk-SJBCK2EI.js} +15268 -16053
- package/chunks/{chunk-IOL7D5YV.js → chunk-SQCBHFWN.js} +3 -3
- package/chunks/chunk-TH2LW437.js +7829 -0
- package/chunks/{chunk-WVTBZEQO.js → chunk-TM74SSHC.js} +8 -8
- package/chunks/{chunk-U5FLXGHT.js → chunk-TO35Y326.js} +13 -729
- package/chunks/chunk-TRH2PJSN.js +547 -0
- package/chunks/{chunk-YYRBQVFE.js → chunk-TZFIAMWZ.js} +70 -16
- package/chunks/chunk-UELXHK2Y.js +1950 -0
- package/chunks/{chunk-RJWOYEOG.js → chunk-UEX7PFSE.js} +5 -5
- package/chunks/{chunk-VQG4FT5D.js → chunk-UFHN6RIU.js} +2 -2
- package/chunks/{chunk-JQHOLLTD.js → chunk-UU7PQP6N.js} +9 -9
- package/chunks/{chunk-BFR2CDV5.js → chunk-UV5QWZGE.js} +283 -153
- package/chunks/{chunk-WU6AFRAZ.js → chunk-V36HVTUL.js} +12 -12
- package/chunks/{chunk-IR537GON.js → chunk-VCSFCHAJ.js} +2 -2
- package/chunks/{chunk-YLMN3N25.js → chunk-VIT5ALXF.js} +3 -3
- package/chunks/{chunk-BATRQBOR.js → chunk-VMRRNRMR.js} +41 -41
- package/chunks/{chunk-72CISA2D.js → chunk-VNRY6AWF.js} +89 -41
- package/chunks/chunk-W6UWZFKL.js +298 -0
- package/chunks/{chunk-3KPWWJCI.js → chunk-XFCTUKXR.js} +88 -88
- package/chunks/{chunk-GMT2AZKM.js → chunk-YIQSGNAA.js} +897 -130
- package/chunks/codex-models-7TLJSY3L.js +17 -0
- package/chunks/{commands-TBC2F5CE.js → commands-NEI7L3QA.js} +2836 -1424
- package/chunks/corpus-v1.json +2 -2
- package/chunks/data/appsec-archetypes.json +2 -2
- package/chunks/data/chromium-archetypes.json +1 -1
- package/chunks/data/freebsd-archetypes.json +1 -1
- package/chunks/data/kernel-archetypes.json +2 -2
- package/chunks/db-5AP3JB4W.js +16 -0
- package/chunks/{disclose-EKTWSCGW.js → disclose-LDNKAVRH.js} +13 -11
- package/chunks/{dist-4YICS2J2.js → dist-3FNZIBB4.js} +394 -404
- package/chunks/{dist-4MAW5X6L.js → dist-5YHYNLI3.js} +6 -6
- package/chunks/{dist-FMGSR3DW.js → dist-DD4H6HMQ.js} +13 -5
- package/chunks/dist-KEULE5IQ.js +21914 -0
- package/chunks/dist-XZB53PS5.js +53 -0
- package/chunks/eval-runner-43BO2C4T.js +26 -0
- package/chunks/example-manifest.json +2 -2
- package/chunks/{exploit-agent-45YQOHPJ.js → exploit-agent-N4A5ELBK.js} +4 -4
- package/chunks/{exploit-autoclimb-UZGEMGYT.js → exploit-autoclimb-N7P6KIF5.js} +6 -6
- package/chunks/{exploit-climb-SG23KB2G.js → exploit-climb-WNEJUB5W.js} +12 -12
- package/chunks/fix-Z452M4EC.js +26 -0
- package/chunks/{github-issues-MJ6OYOOU.js → github-issues-IGTTWM7V.js} +7 -7
- package/chunks/harness-QJJJVSG4.js +22 -0
- package/chunks/http-conformance-U5F6GKYG.js +11 -0
- package/chunks/http-sender-I5XFFY35.js +10 -0
- package/chunks/hunt-scan-K6D2V3PX.js +36 -0
- package/chunks/{identity-6ZAIIWOR.js → identity-62SVRW4H.js} +5 -5
- package/chunks/{kernel-primitive-7U6CWHXD.js → kernel-primitive-TKUACPKD.js} +6 -6
- package/chunks/{kernel-vm-runner-3JAU4O6J.js → kernel-vm-runner-RAAO2PGT.js} +6 -6
- package/chunks/memsafety-scan-FCPAXIZE.js +16 -0
- package/chunks/{native-loop-RJCJPOUS.js → native-loop-2ZRJENZ3.js} +17 -18
- package/chunks/{npm-detectors-KB5Y5ZFX.js → npm-detectors-Z2ZIQCN4.js} +6 -6
- package/chunks/npm-dynamic-discovery-5J7FT3XM.js +13 -0
- package/chunks/orchestrate-2GWGNTBF.js +58 -0
- package/chunks/{pre-recon-cve-66EB6G4M.js → pre-recon-cve-X2K2P5YQ.js} +4 -4
- package/chunks/prepare-KYHGFWCJ.js +13 -0
- package/chunks/process-N245QIQG.js +12 -0
- package/chunks/{run-D56MPDKY.js → run-U3XU4CTC.js} +11507 -13632
- package/chunks/{runtime-G7YWIO3B.js → runtime-G75TEWQY.js} +10 -11
- package/chunks/runtime-XFWJTBUO.js +12 -0
- package/chunks/{scan-stream-FHI2FYZE.js → scan-stream-BMOCPKQX.js} +7 -7
- package/chunks/scope-WXI46UHJ.js +21 -0
- package/chunks/{session-store-GZ4A4KYT.js → session-store-27L3ZU73.js} +6 -6
- package/chunks/source-files-REHOM44I.js +12 -0
- package/chunks/{specdrift-WCLH6TTQ.js → specdrift-AFS54WEJ.js} +5 -5
- package/chunks/token-KRWP5JYA.js +72 -0
- package/chunks/token-util-DWTL33S3.js +8 -0
- package/chunks/variant-candidates-YWZORZMK.js +13 -0
- package/chunks/{web-recon-prepass-JJGPEOLE.js → web-recon-prepass-YVMFXCIK.js} +9 -9
- package/cli-path-traversal-fixture.js +352 -0
- package/dashboard/assets/bot-Bg1Tp9_d.js +1 -0
- package/dashboard/assets/dist-B_dDCPbu.js +1 -0
- package/dashboard/assets/findings-page-mayGhNx6.js +5 -0
- package/dashboard/assets/format--susmHX7.js +1 -0
- package/dashboard/assets/input-TuVPR3Zl.js +1 -0
- package/dashboard/assets/jsx-runtime-MGseXjj5.js +3 -0
- package/dashboard/assets/live-page-HWWHX99U.js +1 -0
- package/dashboard/assets/meta-tile-ckHo-w7k.js +1 -0
- package/dashboard/assets/operations-BxZ0OoXO.js +10 -0
- package/dashboard/assets/operations-CMFVrXEe.css +2 -0
- package/dashboard/assets/operations-app-D3d35rgo.js +46 -0
- package/dashboard/assets/overview-page-W_4IteEr.js +1 -0
- package/dashboard/assets/page-header-Bw9AJgBV.js +1 -0
- package/dashboard/assets/scans-page-CgzVXHnn.js +1 -0
- package/dashboard/assets/siren-KQj8QAnJ.js +1 -0
- package/dashboard/assets/table-8EDklulN.js +1 -0
- package/dashboard/assets/tabs-CFHPOwg8.js +1 -0
- package/dashboard/index.html +4 -5
- package/node_modules/node-addon-api/LICENSE.md +9 -0
- package/node_modules/node-addon-api/README.md +95 -0
- package/node_modules/node-addon-api/common.gypi +21 -0
- package/node_modules/node-addon-api/except.gypi +25 -0
- package/node_modules/node-addon-api/index.js +14 -0
- package/node_modules/node-addon-api/napi-inl.deprecated.h +186 -0
- package/node_modules/node-addon-api/napi-inl.h +7250 -0
- package/node_modules/node-addon-api/napi.h +3463 -0
- package/node_modules/node-addon-api/node_addon_api.gyp +42 -0
- package/node_modules/node-addon-api/node_api.gyp +9 -0
- package/node_modules/node-addon-api/noexcept.gypi +26 -0
- package/node_modules/node-addon-api/nothing.c +0 -0
- package/node_modules/node-addon-api/package-support.json +21 -0
- package/node_modules/node-addon-api/package.json +481 -0
- package/node_modules/node-addon-api/tools/README.md +73 -0
- package/node_modules/node-addon-api/tools/check-napi.js +99 -0
- package/node_modules/node-addon-api/tools/clang-format.js +71 -0
- package/node_modules/node-addon-api/tools/conversion.js +301 -0
- package/node_modules/node-gyp-build/LICENSE +21 -0
- package/node_modules/node-gyp-build/README.md +58 -0
- package/node_modules/node-gyp-build/SECURITY.md +5 -0
- package/node_modules/node-gyp-build/bin.js +84 -0
- package/node_modules/node-gyp-build/build-test.js +19 -0
- package/node_modules/node-gyp-build/index.js +6 -0
- package/node_modules/node-gyp-build/node-gyp-build.js +207 -0
- package/node_modules/node-gyp-build/optional.js +7 -0
- package/node_modules/node-gyp-build/package.json +43 -0
- package/node_modules/tree-sitter/LICENSE +21 -0
- package/node_modules/tree-sitter/README.md +90 -0
- package/node_modules/tree-sitter/binding.gyp +76 -0
- package/node_modules/tree-sitter/index.js +895 -0
- package/node_modules/tree-sitter/package.json +62 -0
- package/node_modules/tree-sitter/prebuilds/darwin-arm64/tree-sitter.node +0 -0
- package/node_modules/tree-sitter/prebuilds/darwin-x64/tree-sitter.node +0 -0
- package/node_modules/tree-sitter/prebuilds/linux-x64/tree-sitter.node +0 -0
- package/node_modules/tree-sitter/prebuilds/win32-x64/tree-sitter.node +0 -0
- package/node_modules/tree-sitter/src/addon_data.h +47 -0
- package/node_modules/tree-sitter/src/binding.cc +35 -0
- package/node_modules/tree-sitter/src/conversions.cc +140 -0
- package/node_modules/tree-sitter/src/conversions.h +22 -0
- package/node_modules/tree-sitter/src/language.cc +106 -0
- package/node_modules/tree-sitter/src/language.h +17 -0
- package/node_modules/tree-sitter/src/logger.cc +70 -0
- package/node_modules/tree-sitter/src/logger.h +19 -0
- package/node_modules/tree-sitter/src/lookaheaditerator.cc +122 -0
- package/node_modules/tree-sitter/src/lookaheaditerator.h +33 -0
- package/node_modules/tree-sitter/src/node.cc +1056 -0
- package/node_modules/tree-sitter/src/node.h +30 -0
- package/node_modules/tree-sitter/src/parser.cc +298 -0
- package/node_modules/tree-sitter/src/parser.h +35 -0
- package/node_modules/tree-sitter/src/query.cc +383 -0
- package/node_modules/tree-sitter/src/query.h +39 -0
- package/node_modules/tree-sitter/src/tree.cc +307 -0
- package/node_modules/tree-sitter/src/tree.h +45 -0
- package/node_modules/tree-sitter/src/tree_cursor.cc +213 -0
- package/node_modules/tree-sitter/src/tree_cursor.h +52 -0
- package/node_modules/tree-sitter/tree-sitter.d.ts +211 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/LICENSE +21 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/README.md +21 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/README.md +6 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/include/tree_sitter/api.h +1266 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.c +48 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/alloc.h +41 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/array.h +290 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/atomic.h +68 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/clock.h +146 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/error_costs.h +11 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.c +501 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/get_changed_ranges.h +36 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/host.h +21 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.c +221 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/language.h +299 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/length.h +52 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.c +419 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lexer.h +49 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/lib.c +14 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/node.c +774 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.c +2151 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/parser.h +230 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/point.h +62 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/query.c +4134 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reduce_action.h +34 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/reusable_node.h +95 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.c +899 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/stack.h +133 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.c +1060 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/subtree.h +382 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.c +165 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree.h +31 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.c +714 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/tree_cursor.h +48 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ICU_SHA +1 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/LICENSE +414 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/README.md +29 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/ptypes.h +1 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/umachine.h +448 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/urename.h +1 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf.h +1 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf16.h +733 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode/utf8.h +881 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/unicode.h +50 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib-symbols.txt +23 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/stdlib.c +109 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm/wasm-stdlib.h +1294 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.c +1823 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/lib/src/wasm_store.h +31 -0
- package/node_modules/tree-sitter/vendor/tree-sitter/test/fixtures/grammars/.gitkeep +0 -0
- package/node_modules/tree-sitter-c/LICENSE +21 -0
- package/node_modules/tree-sitter-c/README.md +18 -0
- package/node_modules/tree-sitter-c/binding.gyp +20 -0
- package/node_modules/tree-sitter-c/bindings/node/binding.cc +20 -0
- package/node_modules/tree-sitter-c/bindings/node/index.d.ts +28 -0
- package/node_modules/tree-sitter-c/bindings/node/index.js +7 -0
- package/node_modules/tree-sitter-c/grammar.js +1463 -0
- package/node_modules/tree-sitter-c/package.json +108 -0
- package/node_modules/tree-sitter-c/prebuilds/darwin-arm64/tree-sitter-c.node +0 -0
- package/node_modules/tree-sitter-c/prebuilds/darwin-x64/tree-sitter-c.node +0 -0
- package/node_modules/tree-sitter-c/prebuilds/linux-x64/tree-sitter-c.node +0 -0
- package/node_modules/tree-sitter-c/prebuilds/win32-x64/tree-sitter-c.node +0 -0
- package/node_modules/tree-sitter-c/queries/highlights.scm +81 -0
- package/node_modules/tree-sitter-c/queries/tags.scm +9 -0
- package/node_modules/tree-sitter-c/src/grammar.json +9682 -0
- package/node_modules/tree-sitter-c/src/node-types.json +4556 -0
- package/node_modules/tree-sitter-c/src/parser.c +113852 -0
- package/node_modules/tree-sitter-c/src/tree_sitter/alloc.h +54 -0
- package/node_modules/tree-sitter-c/src/tree_sitter/array.h +290 -0
- package/node_modules/tree-sitter-c/src/tree_sitter/parser.h +265 -0
- package/package.json +20 -13
- package/vendor/tree-sitter-0.21.1-node24.json +16 -0
- package/vendor/tree-sitter-0.21.1-node24.tgz +0 -0
- package/chunks/adapt-loop-SMH6V4PD.js +0 -18
- package/chunks/appsec-catalog-CBWHGTEL.js +0 -24
- package/chunks/chunk-242TMK6G.js +0 -110
- package/chunks/chunk-57ZENEX2.js +0 -169
- package/chunks/chunk-ADOLI6DT.js +0 -102
- package/chunks/chunk-ATATQACO.js +0 -471
- package/chunks/chunk-C2WXWFBB.js +0 -1070
- package/chunks/chunk-F3WBKITT.js +0 -687
- package/chunks/chunk-H2FFLZNK.js +0 -3
- package/chunks/chunk-LP3HHYQU.js +0 -245
- package/chunks/chunk-QI233I24.js +0 -333
- package/chunks/chunk-RRMJC3ZE.js +0 -105
- package/chunks/chunk-Z5FA2XOX.js +0 -2798
- package/chunks/cost-ledger-NU63MYZM.js +0 -13
- package/chunks/db-KFWOAUUB.js +0 -16
- package/chunks/eval-runner-7ZF472KV.js +0 -27
- package/chunks/fix-IG7LYXH3.js +0 -12
- package/chunks/harness-7ODOLOWU.js +0 -22
- package/chunks/http-conformance-DU66MZIU.js +0 -11
- package/chunks/http-sender-GWH2IYEA.js +0 -10
- package/chunks/hunt-scan-MMKUOETU.js +0 -38
- package/chunks/memsafety-scan-J7SECV5W.js +0 -16
- package/chunks/npm-dynamic-discovery-AHROOZDB.js +0 -13
- package/chunks/orchestrate-OC2VZN2X.js +0 -62
- package/chunks/pipeline-BZK5BLJR.js +0 -14
- package/chunks/prepare-MYY743TK.js +0 -13
- package/chunks/process-LQRCS5OY.js +0 -13
- package/chunks/replay-runner-45G3VU7X.js +0 -39
- package/chunks/runtime-J7PLXZNM.js +0 -12
- package/chunks/scope-BI7BF4ZY.js +0 -18
- package/chunks/source-files-PWRQR6LY.js +0 -12
- package/chunks/variant-candidates-YERCYMPD.js +0 -13
- package/dashboard/assets/0sec-icon-66SreztZ.gif +0 -0
- package/dashboard/assets/bot-yILPnRgD.js +0 -1
- package/dashboard/assets/chevron-down-BeDJ-Vka.js +0 -1
- package/dashboard/assets/circle-alert-BEnMBMT-.js +0 -1
- package/dashboard/assets/client-DRYsuOGl.js +0 -9
- package/dashboard/assets/copy-Bi5vzoF9.js +0 -1
- package/dashboard/assets/desktop-CXTQonNm.js +0 -32
- package/dashboard/assets/desktop-NOekk4QS.css +0 -1
- package/dashboard/assets/dist-CmX-h7a4.js +0 -1
- package/dashboard/assets/dist-DAwYQmf_.js +0 -45
- package/dashboard/assets/findings-page-CACW9nw2.js +0 -5
- package/dashboard/assets/format-PoISqsES.js +0 -1
- package/dashboard/assets/jsx-runtime-C7oxC63R.js +0 -1
- package/dashboard/assets/live-page-DrgQqQK5.js +0 -1
- package/dashboard/assets/meta-tile-CcskIV_o.js +0 -1
- package/dashboard/assets/operations-BKE8T-vY.css +0 -2
- package/dashboard/assets/operations-D8nUP5_m.js +0 -4
- package/dashboard/assets/operations-app-CQQhG54n.js +0 -2
- package/dashboard/assets/overview-page-DTGS8dPo.js +0 -1
- package/dashboard/assets/page-header-MFVvEtZW.js +0 -1
- package/dashboard/assets/play-Dwo-9xt6.js +0 -1
- package/dashboard/assets/scans-page-ChVtq8Us.js +0 -1
- package/dashboard/assets/search-CiooTLck.js +0 -1
- package/dashboard/assets/siren-CCBwTSuk.js +0 -1
- package/dashboard/assets/table-BYS-nIVA.js +0 -1
- package/dashboard/assets/tabs-DivxbhQy.js +0 -1
- package/dashboard/desktop.html +0 -21
package/chunks/chunk-ATATQACO.js
DELETED
|
@@ -1,471 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __0secCreateRequire } from "node:module";
|
|
3
|
-
const require = __0secCreateRequire(import.meta.url);
|
|
4
|
-
import {
|
|
5
|
-
eventBus,
|
|
6
|
-
isCloudEventSinkActive
|
|
7
|
-
} from "./chunk-ADOLI6DT.js";
|
|
8
|
-
|
|
9
|
-
// packages/core/dist/runtime/process.js
|
|
10
|
-
import { spawn } from "node:child_process";
|
|
11
|
-
import { tmpdir } from "node:os";
|
|
12
|
-
import { join, resolve } from "node:path";
|
|
13
|
-
import { writeFileSync } from "node:fs";
|
|
14
|
-
var dim = (text) => `\x1B[2m${text}\x1B[0m`;
|
|
15
|
-
function formatToolDetail(input) {
|
|
16
|
-
const inp = input;
|
|
17
|
-
if (inp?.file_path)
|
|
18
|
-
return String(inp.file_path).split("/").slice(-2).join("/");
|
|
19
|
-
if (inp?.command)
|
|
20
|
-
return String(inp.command).slice(0, 60);
|
|
21
|
-
if (inp?.pattern)
|
|
22
|
-
return String(inp.pattern).slice(0, 40);
|
|
23
|
-
if (inp?.path)
|
|
24
|
-
return String(inp.path).slice(0, 60);
|
|
25
|
-
if (inp?.content)
|
|
26
|
-
return "(writing file)";
|
|
27
|
-
return "";
|
|
28
|
-
}
|
|
29
|
-
function friendlyToolName(name) {
|
|
30
|
-
const stripped = name.replace(/^mcp__\w+__/, "");
|
|
31
|
-
return stripped.split("_").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
|
|
32
|
-
}
|
|
33
|
-
function showToolCall(onToolCall, name, input) {
|
|
34
|
-
const rawName = name || "tool";
|
|
35
|
-
if (/^(ToolSearch|Read|Glob|Grep|Write|Edit|Bash|LSP|Agent)$/i.test(rawName))
|
|
36
|
-
return;
|
|
37
|
-
const toolName = friendlyToolName(rawName);
|
|
38
|
-
const detail = formatToolDetail(input);
|
|
39
|
-
if (onToolCall) {
|
|
40
|
-
onToolCall(toolName, detail);
|
|
41
|
-
}
|
|
42
|
-
if (process.stderr.isTTY && !onToolCall) {
|
|
43
|
-
process.stderr.write(dim(` ${toolName}${detail ? ": " + detail : ""}
|
|
44
|
-
`));
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
var RUNTIME_COMMANDS = {
|
|
48
|
-
claude: "claude",
|
|
49
|
-
codex: "codex",
|
|
50
|
-
gemini: "gemini"
|
|
51
|
-
};
|
|
52
|
-
function resolveCliEntrypoint() {
|
|
53
|
-
return resolve(process.argv[1] ?? join(process.cwd(), "dist", "index.js"));
|
|
54
|
-
}
|
|
55
|
-
function buildOsecMcpCommandArgs(context) {
|
|
56
|
-
const cliEntrypoint = resolveCliEntrypoint();
|
|
57
|
-
const args = [
|
|
58
|
-
cliEntrypoint,
|
|
59
|
-
"mcp-server",
|
|
60
|
-
"--target",
|
|
61
|
-
context.target ?? "",
|
|
62
|
-
"--scan-id",
|
|
63
|
-
context.scanId ?? "no-scan-id"
|
|
64
|
-
];
|
|
65
|
-
if (context.mcp?.dbPath) {
|
|
66
|
-
args.push("--db-path", context.mcp.dbPath);
|
|
67
|
-
}
|
|
68
|
-
if (context.mcp?.scopeFile) {
|
|
69
|
-
args.push("--scope", context.mcp.scopeFile);
|
|
70
|
-
}
|
|
71
|
-
if (context.mcp?.rateLimit) {
|
|
72
|
-
args.push("--rate-limit", context.mcp.rateLimit);
|
|
73
|
-
}
|
|
74
|
-
if (context.mcp?.allowScanners) {
|
|
75
|
-
args.push("--allow-scanners");
|
|
76
|
-
}
|
|
77
|
-
return args;
|
|
78
|
-
}
|
|
79
|
-
function numericField(obj, key) {
|
|
80
|
-
const v = obj[key];
|
|
81
|
-
if (typeof v === "number" && Number.isFinite(v))
|
|
82
|
-
return v;
|
|
83
|
-
if (typeof v === "string" && /^\d+$/.test(v))
|
|
84
|
-
return Number(v);
|
|
85
|
-
return void 0;
|
|
86
|
-
}
|
|
87
|
-
function safeJsonStringify(v) {
|
|
88
|
-
try {
|
|
89
|
-
return JSON.stringify(v) ?? "";
|
|
90
|
-
} catch {
|
|
91
|
-
return "(unserialisable)";
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
function buildClaudeMcpConfig(context) {
|
|
95
|
-
return JSON.stringify({
|
|
96
|
-
mcpServers: {
|
|
97
|
-
"0sec": {
|
|
98
|
-
command: process.execPath,
|
|
99
|
-
args: buildOsecMcpCommandArgs(context)
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
var ProcessRuntime = class {
|
|
105
|
-
type;
|
|
106
|
-
config;
|
|
107
|
-
command;
|
|
108
|
-
constructor(config) {
|
|
109
|
-
this.type = config.type;
|
|
110
|
-
this.config = config;
|
|
111
|
-
this.command = RUNTIME_COMMANDS[config.type] ?? config.type;
|
|
112
|
-
}
|
|
113
|
-
async execute(prompt, context) {
|
|
114
|
-
const start = Date.now();
|
|
115
|
-
const args = this.buildArgs(prompt, context);
|
|
116
|
-
const env = this.buildEnv(context);
|
|
117
|
-
const onToolCall = this.config.onToolCall;
|
|
118
|
-
const scanId = context?.scanId;
|
|
119
|
-
const emitScanEvents = this.type === "codex" && isCloudEventSinkActive();
|
|
120
|
-
const maxTurnsHint = 40;
|
|
121
|
-
let turnNumber = 0;
|
|
122
|
-
let toolCallSeq = 0;
|
|
123
|
-
let deltaSeq = 0;
|
|
124
|
-
let turnStartedAt = 0;
|
|
125
|
-
const toolCallStartedAt = /* @__PURE__ */ new Map();
|
|
126
|
-
const seenSequenceNumbers = /* @__PURE__ */ new Set();
|
|
127
|
-
const isSeenSequence = (event) => {
|
|
128
|
-
const seq = event.sequence_number;
|
|
129
|
-
if (typeof seq !== "number" && typeof seq !== "string")
|
|
130
|
-
return false;
|
|
131
|
-
const key = `${event.type ?? "?"}|${seq}`;
|
|
132
|
-
if (seenSequenceNumbers.has(key))
|
|
133
|
-
return true;
|
|
134
|
-
seenSequenceNumbers.add(key);
|
|
135
|
-
return false;
|
|
136
|
-
};
|
|
137
|
-
const emitCodexCloudEvents = (event) => {
|
|
138
|
-
if (isSeenSequence(event))
|
|
139
|
-
return;
|
|
140
|
-
const eventType = typeof event.type === "string" ? event.type : "";
|
|
141
|
-
switch (eventType) {
|
|
142
|
-
case "thread.started": {
|
|
143
|
-
eventBus.emit("llm_planner_invoked", {
|
|
144
|
-
turn: 0,
|
|
145
|
-
model: this.config.model,
|
|
146
|
-
role: "attack"
|
|
147
|
-
});
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
case "turn.started": {
|
|
151
|
-
turnNumber += 1;
|
|
152
|
-
turnStartedAt = Date.now();
|
|
153
|
-
deltaSeq = 0;
|
|
154
|
-
eventBus.emit("agent_turn_started", {
|
|
155
|
-
turn: turnNumber,
|
|
156
|
-
max_turns: maxTurnsHint,
|
|
157
|
-
role: "attack"
|
|
158
|
-
});
|
|
159
|
-
eventBus.emit("llm_planner_invoked", {
|
|
160
|
-
turn: turnNumber,
|
|
161
|
-
model: this.config.model,
|
|
162
|
-
role: "attack"
|
|
163
|
-
});
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
case "turn.completed": {
|
|
167
|
-
const usage = event.usage ?? {};
|
|
168
|
-
const inputTokens = numericField(usage, "input_tokens");
|
|
169
|
-
const cachedInputTokens = numericField(usage, "cached_input_tokens");
|
|
170
|
-
const outputTokens = numericField(usage, "output_tokens");
|
|
171
|
-
const reasoningTokens = numericField(usage, "reasoning_output_tokens");
|
|
172
|
-
const durationMs = turnStartedAt > 0 ? Date.now() - turnStartedAt : 0;
|
|
173
|
-
eventBus.emit("agent_turn_completed", {
|
|
174
|
-
turn: turnNumber,
|
|
175
|
-
duration_ms: durationMs,
|
|
176
|
-
reason: "continue",
|
|
177
|
-
role: "attack"
|
|
178
|
-
});
|
|
179
|
-
eventBus.emit("cost_update", {
|
|
180
|
-
turn: turnNumber,
|
|
181
|
-
cost_usd: 0,
|
|
182
|
-
input_tokens: inputTokens,
|
|
183
|
-
output_tokens: outputTokens,
|
|
184
|
-
token_input: inputTokens,
|
|
185
|
-
token_output: outputTokens,
|
|
186
|
-
cached_input_tokens: cachedInputTokens,
|
|
187
|
-
reasoning_output_tokens: reasoningTokens
|
|
188
|
-
});
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
case "item.started": {
|
|
192
|
-
const item = event.item ?? {};
|
|
193
|
-
const itemType = typeof item.type === "string" ? item.type : "";
|
|
194
|
-
if (itemType === "command_execution" && typeof item.command === "string") {
|
|
195
|
-
toolCallSeq += 1;
|
|
196
|
-
toolCallStartedAt.set(toolCallSeq, Date.now());
|
|
197
|
-
eventBus.emit("tool_call_started", {
|
|
198
|
-
tool: "shell",
|
|
199
|
-
turn: turnNumber,
|
|
200
|
-
args_preview: item.command.slice(0, 200),
|
|
201
|
-
ts: Date.now()
|
|
202
|
-
});
|
|
203
|
-
} else if (itemType === "mcp_tool_call") {
|
|
204
|
-
toolCallSeq += 1;
|
|
205
|
-
toolCallStartedAt.set(toolCallSeq, Date.now());
|
|
206
|
-
const server = typeof item.server === "string" ? item.server : "?";
|
|
207
|
-
const tool = typeof item.tool === "string" ? item.tool : "?";
|
|
208
|
-
const argsRaw = item.arguments ?? {};
|
|
209
|
-
const argsPreview = typeof argsRaw === "string" ? argsRaw : safeJsonStringify(argsRaw);
|
|
210
|
-
eventBus.emit("tool_call_started", {
|
|
211
|
-
tool: `${server}__${tool}`,
|
|
212
|
-
turn: turnNumber,
|
|
213
|
-
args_preview: argsPreview.slice(0, 200),
|
|
214
|
-
ts: Date.now()
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
return;
|
|
218
|
-
}
|
|
219
|
-
case "item.completed": {
|
|
220
|
-
const item = event.item ?? {};
|
|
221
|
-
const itemType = typeof item.type === "string" ? item.type : "";
|
|
222
|
-
if (itemType === "command_execution") {
|
|
223
|
-
const startedAt = toolCallStartedAt.get(toolCallSeq);
|
|
224
|
-
const durationMs = startedAt != null ? Date.now() - startedAt : 0;
|
|
225
|
-
toolCallStartedAt.delete(toolCallSeq);
|
|
226
|
-
eventBus.emit("tool_call_completed", {
|
|
227
|
-
tool: "shell",
|
|
228
|
-
turn: turnNumber,
|
|
229
|
-
duration_ms: durationMs,
|
|
230
|
-
status: "ok",
|
|
231
|
-
ts: Date.now()
|
|
232
|
-
});
|
|
233
|
-
} else if (itemType === "mcp_tool_call") {
|
|
234
|
-
const startedAt = toolCallStartedAt.get(toolCallSeq);
|
|
235
|
-
const durationMs = startedAt != null ? Date.now() - startedAt : 0;
|
|
236
|
-
toolCallStartedAt.delete(toolCallSeq);
|
|
237
|
-
const server = typeof item.server === "string" ? item.server : "?";
|
|
238
|
-
const tool = typeof item.tool === "string" ? item.tool : "?";
|
|
239
|
-
const status = item.status === "success" || item.status === "completed" ? "ok" : "error";
|
|
240
|
-
const errorMsg = status === "error" ? typeof item.error === "string" ? item.error : safeJsonStringify(item.error ?? null) : void 0;
|
|
241
|
-
eventBus.emit("tool_call_completed", {
|
|
242
|
-
tool: `${server}__${tool}`,
|
|
243
|
-
turn: turnNumber,
|
|
244
|
-
duration_ms: durationMs,
|
|
245
|
-
status,
|
|
246
|
-
...errorMsg ? { error: errorMsg.slice(0, 400) } : {},
|
|
247
|
-
ts: Date.now()
|
|
248
|
-
});
|
|
249
|
-
} else if (itemType === "function_call" || itemType === "tool_call") {
|
|
250
|
-
toolCallSeq += 1;
|
|
251
|
-
const toolName = typeof item.tool_name === "string" && item.tool_name || typeof item.name === "string" && item.name || "mcp_tool";
|
|
252
|
-
const argsField = item.arguments ?? item.input ?? "";
|
|
253
|
-
const detail = typeof argsField === "string" ? argsField : safeJsonStringify(argsField);
|
|
254
|
-
eventBus.emit("tool_call_started", {
|
|
255
|
-
tool: toolName,
|
|
256
|
-
turn: turnNumber,
|
|
257
|
-
args_preview: detail.slice(0, 200),
|
|
258
|
-
ts: Date.now()
|
|
259
|
-
});
|
|
260
|
-
eventBus.emit("tool_call_completed", {
|
|
261
|
-
tool: toolName,
|
|
262
|
-
turn: turnNumber,
|
|
263
|
-
duration_ms: 0,
|
|
264
|
-
status: "ok",
|
|
265
|
-
ts: Date.now()
|
|
266
|
-
});
|
|
267
|
-
} else if (itemType === "reasoning") {
|
|
268
|
-
const reasoningText = typeof item.text === "string" && item.text || typeof item.summary === "string" && item.summary || "";
|
|
269
|
-
if (reasoningText.length > 0) {
|
|
270
|
-
eventBus.emit("reasoning_summary", {
|
|
271
|
-
turn: turnNumber,
|
|
272
|
-
summary: reasoningText.slice(0, 2e3)
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
} else if (itemType === "agent_message") {
|
|
276
|
-
const messageText = typeof item.text === "string" ? item.text : "";
|
|
277
|
-
if (messageText.length > 0) {
|
|
278
|
-
deltaSeq += 1;
|
|
279
|
-
eventBus.emit("delta", {
|
|
280
|
-
turn: turnNumber,
|
|
281
|
-
scope: "assistant_response",
|
|
282
|
-
text: messageText.slice(0, 2e3),
|
|
283
|
-
seq: deltaSeq,
|
|
284
|
-
role: "attack"
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
return new Promise((resolve2) => {
|
|
293
|
-
let stdout = "";
|
|
294
|
-
let stderr = "";
|
|
295
|
-
let resultText = "";
|
|
296
|
-
let timedOut = false;
|
|
297
|
-
const isJsonStream = args.includes("stream-json") || args.includes("--json");
|
|
298
|
-
const proc = spawn(this.command, args, {
|
|
299
|
-
cwd: this.config.cwd ?? process.cwd(),
|
|
300
|
-
env: { ...process.env, ...env },
|
|
301
|
-
stdio: ["ignore", "pipe", "pipe"]
|
|
302
|
-
});
|
|
303
|
-
proc.stdout.on("data", (chunk) => {
|
|
304
|
-
const text = chunk.toString();
|
|
305
|
-
stdout += text;
|
|
306
|
-
if (isJsonStream) {
|
|
307
|
-
for (const line of text.split("\n")) {
|
|
308
|
-
if (!line.trim())
|
|
309
|
-
continue;
|
|
310
|
-
try {
|
|
311
|
-
const event = JSON.parse(line);
|
|
312
|
-
if (event.type === "assistant" && event.message?.content) {
|
|
313
|
-
for (const block of event.message.content) {
|
|
314
|
-
if (block.type === "text") {
|
|
315
|
-
resultText += block.text;
|
|
316
|
-
this.config.onThinking?.(block.text);
|
|
317
|
-
} else if (block.type === "tool_use") {
|
|
318
|
-
showToolCall(onToolCall, block.name, block.input);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
} else if (event.type === "result") {
|
|
322
|
-
resultText = event.result || resultText;
|
|
323
|
-
}
|
|
324
|
-
if (event.type === "item.started" && event.item?.type === "command_execution") {
|
|
325
|
-
showToolCall(onToolCall, "shell", { command: event.item.command });
|
|
326
|
-
}
|
|
327
|
-
if (event.type === "item.completed" && event.item) {
|
|
328
|
-
if (event.item.type === "agent_message" && event.item.text) {
|
|
329
|
-
resultText += event.item.text;
|
|
330
|
-
this.config.onThinking?.(event.item.text);
|
|
331
|
-
} else if (event.item.type === "command_execution" && event.item.command) {
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
if (emitScanEvents)
|
|
335
|
-
emitCodexCloudEvents(event);
|
|
336
|
-
} catch {
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
});
|
|
341
|
-
proc.stderr.on("data", (chunk) => {
|
|
342
|
-
const text = chunk.toString();
|
|
343
|
-
stderr += text;
|
|
344
|
-
if (/permission|approve|allow.*tool/i.test(stderr) && stderr.length > 500) {
|
|
345
|
-
proc.kill("SIGTERM");
|
|
346
|
-
stderr += "\n[0sec] Subprocess killed: MCP tools require interactive approval. Use --runtime api instead.";
|
|
347
|
-
}
|
|
348
|
-
});
|
|
349
|
-
const timer = setTimeout(() => {
|
|
350
|
-
timedOut = true;
|
|
351
|
-
proc.kill("SIGTERM");
|
|
352
|
-
setTimeout(() => proc.kill("SIGKILL"), 5e3);
|
|
353
|
-
}, this.config.timeout);
|
|
354
|
-
proc.on("close", (code) => {
|
|
355
|
-
clearTimeout(timer);
|
|
356
|
-
const output = isJsonStream ? (resultText || stdout).trim() : stdout.trim();
|
|
357
|
-
resolve2({
|
|
358
|
-
output,
|
|
359
|
-
exitCode: code,
|
|
360
|
-
timedOut,
|
|
361
|
-
durationMs: Date.now() - start,
|
|
362
|
-
error: code !== 0 ? stderr.trim() || void 0 : void 0
|
|
363
|
-
});
|
|
364
|
-
});
|
|
365
|
-
proc.on("error", (err) => {
|
|
366
|
-
clearTimeout(timer);
|
|
367
|
-
resolve2({
|
|
368
|
-
output: "",
|
|
369
|
-
exitCode: 1,
|
|
370
|
-
timedOut: false,
|
|
371
|
-
durationMs: Date.now() - start,
|
|
372
|
-
error: err.message
|
|
373
|
-
});
|
|
374
|
-
});
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
async isAvailable() {
|
|
378
|
-
const attempt = (timeoutMs) => new Promise((resolve2) => {
|
|
379
|
-
const proc = spawn(this.command, ["--version"], {
|
|
380
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
381
|
-
});
|
|
382
|
-
let settled = false;
|
|
383
|
-
const finish = (ok) => {
|
|
384
|
-
if (settled)
|
|
385
|
-
return;
|
|
386
|
-
settled = true;
|
|
387
|
-
resolve2(ok);
|
|
388
|
-
};
|
|
389
|
-
proc.on("close", (code) => finish(code === 0));
|
|
390
|
-
proc.on("error", () => finish(false));
|
|
391
|
-
setTimeout(() => {
|
|
392
|
-
proc.kill();
|
|
393
|
-
finish(false);
|
|
394
|
-
}, timeoutMs).unref?.();
|
|
395
|
-
});
|
|
396
|
-
if (await attempt(5e3))
|
|
397
|
-
return true;
|
|
398
|
-
return attempt(15e3);
|
|
399
|
-
}
|
|
400
|
-
buildArgs(prompt, context) {
|
|
401
|
-
switch (this.type) {
|
|
402
|
-
case "claude": {
|
|
403
|
-
const args = ["-p", prompt, "--verbose", "--output-format", "stream-json"];
|
|
404
|
-
if (context?.mcp?.enableTargetTools && context.target && context.scanId) {
|
|
405
|
-
args.push("--mcp-config", buildClaudeMcpConfig(context), "--dangerously-skip-permissions");
|
|
406
|
-
}
|
|
407
|
-
if (context?.systemPrompt) {
|
|
408
|
-
args.push("--system-prompt", context.systemPrompt);
|
|
409
|
-
}
|
|
410
|
-
if (this.config.outputSchema) {
|
|
411
|
-
args.push("--json-schema", JSON.stringify(this.config.outputSchema));
|
|
412
|
-
}
|
|
413
|
-
return args;
|
|
414
|
-
}
|
|
415
|
-
case "codex": {
|
|
416
|
-
const args = [
|
|
417
|
-
"exec",
|
|
418
|
-
"--skip-git-repo-check",
|
|
419
|
-
"--json"
|
|
420
|
-
];
|
|
421
|
-
if (this.config.model) {
|
|
422
|
-
args.push("--model", this.config.model);
|
|
423
|
-
}
|
|
424
|
-
if (context?.mcp?.enableTargetTools && context.target && context.scanId) {
|
|
425
|
-
throw new Error("Codex CLI MCP target tools are not supported. Use the direct ChatGPT Codex provider for live target scans.");
|
|
426
|
-
}
|
|
427
|
-
if (this.config.outputSchema) {
|
|
428
|
-
const schemaPath = join(tmpdir(), `0sec-schema-${Date.now()}.json`);
|
|
429
|
-
writeFileSync(schemaPath, JSON.stringify(this.config.outputSchema));
|
|
430
|
-
args.push("--output-schema", schemaPath);
|
|
431
|
-
}
|
|
432
|
-
args.push(prompt);
|
|
433
|
-
return args;
|
|
434
|
-
}
|
|
435
|
-
case "gemini": {
|
|
436
|
-
const args = ["-p", prompt, "--output-format", "stream-json"];
|
|
437
|
-
return args;
|
|
438
|
-
}
|
|
439
|
-
default:
|
|
440
|
-
return ["-p", prompt];
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
buildEnv(context) {
|
|
444
|
-
const env = {
|
|
445
|
-
...this.config.env
|
|
446
|
-
};
|
|
447
|
-
if (context?.target) {
|
|
448
|
-
env["0SEC_TARGET"] = context.target;
|
|
449
|
-
}
|
|
450
|
-
if (context?.findings) {
|
|
451
|
-
env["0SEC_FINDINGS"] = context.findings;
|
|
452
|
-
}
|
|
453
|
-
if (context?.templateId) {
|
|
454
|
-
env["0SEC_TEMPLATE_ID"] = context.templateId;
|
|
455
|
-
}
|
|
456
|
-
if (context?.mcp?.auth) {
|
|
457
|
-
env["0SEC_MCP_AUTH_JSON"] = JSON.stringify(context.mcp.auth);
|
|
458
|
-
}
|
|
459
|
-
if (context?.mcp?.attributionHeaders) {
|
|
460
|
-
env["0SEC_MCP_ATTRIBUTION_HEADERS_JSON"] = JSON.stringify(context.mcp.attributionHeaders);
|
|
461
|
-
}
|
|
462
|
-
if (context?.mcp?.attributionUaToken) {
|
|
463
|
-
env["0SEC_MCP_ATTRIBUTION_UA_TOKEN"] = context.mcp.attributionUaToken;
|
|
464
|
-
}
|
|
465
|
-
return env;
|
|
466
|
-
}
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
export {
|
|
470
|
-
ProcessRuntime
|
|
471
|
-
};
|