0sec-cli 0.21.4 → 0.22.1
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/0.js +56 -56
- package/README.md +48 -63
- package/chunks/{adapt-loop-IGBRQAXO.js → adapt-loop-J6QCZZTB.js} +4 -4
- package/chunks/{artifact-scraper-LNQJUORS.js → artifact-scraper-MFKT6OI4.js} +2 -2
- package/chunks/{assumption-mining-4MJTP6H5.js → assumption-mining-646LYSJY.js} +16 -16
- package/chunks/{chunk-Z3IKZX3X.js → chunk-23DG5YKS.js} +1 -1
- package/chunks/{chunk-2WSXFFJZ.js → chunk-3E2KALZ5.js} +2 -2
- package/chunks/{chunk-TF46UWFU.js → chunk-4G7OVYJX.js} +1 -1
- package/chunks/{chunk-E2UOY5PJ.js → chunk-5BTJMINS.js} +12 -70
- package/chunks/{chunk-QZVG3BG4.js → chunk-5IBCBQEH.js} +1 -2
- package/chunks/{chunk-YA4PUM4H.js → chunk-7XCKYNLO.js} +1 -1
- package/chunks/{chunk-BACXRTQ4.js → chunk-AV2LG2L7.js} +87 -767
- package/chunks/{chunk-IMGWPNQM.js → chunk-BCSRRQG5.js} +76 -593
- package/chunks/{chunk-NOPBXZUV.js → chunk-BOUGKEKA.js} +1 -1
- package/chunks/{chunk-RF5QGKLR.js → chunk-CPWA6RWE.js} +3 -3
- package/chunks/{chunk-P6YG6TEZ.js → chunk-DKSCN2AB.js} +1 -1
- package/chunks/{chunk-YPOA3W4O.js → chunk-GOEA3NW6.js} +877 -110
- package/chunks/{chunk-ANDKY54G.js → chunk-HHPWRY2M.js} +4019 -7299
- package/chunks/{chunk-NDJU5ZZ7.js → chunk-IFME676H.js} +3 -3
- package/chunks/{chunk-HBKCGJAV.js → chunk-IVQV574Y.js} +1 -1
- package/chunks/{chunk-W4JOXE4N.js → chunk-IXT64DV5.js} +709 -1929
- package/chunks/{chunk-PC6RCKQV.js → chunk-KAU6NLGP.js} +59 -26
- package/chunks/{chunk-FAH6V4QM.js → chunk-LGCASF2C.js} +1117 -2291
- package/chunks/{chunk-CAJJRUTV.js → chunk-NLH4LMWH.js} +1 -1
- package/chunks/chunk-OHHCGDJ2.js +5523 -0
- package/chunks/{chunk-YHWWF4QY.js → chunk-OSBPGWTE.js} +3 -3
- package/chunks/{chunk-G34QP2XW.js → chunk-TM74SSHC.js} +1 -1
- package/chunks/{chunk-VOAXLO4A.js → chunk-TO35Y326.js} +5 -721
- package/chunks/{chunk-FWAYJ2IV.js → chunk-TV27OWIW.js} +8 -8
- package/chunks/chunk-UELXHK2Y.js +1950 -0
- package/chunks/{chunk-CL5KAUM6.js → chunk-V6GHX34G.js} +274 -8
- package/chunks/{chunk-WZISK5VC.js → chunk-VWITLWXB.js} +53 -7
- package/chunks/{chunk-ER3SUMYJ.js → chunk-W6UWZFKL.js} +0 -195
- package/chunks/chunk-WSDDGFA6.js +114 -0
- package/chunks/{chunk-5T6D5BVY.js → chunk-WZRVS7SB.js} +1 -1
- package/chunks/chunk-X7LAEEUW.js +2143 -0
- package/chunks/chunk-XA2O4WXA.js +1228 -0
- package/chunks/{chunk-Y5H6E24H.js → chunk-XCISCI4T.js} +1 -1
- package/chunks/{chunk-WPQLBN4S.js → chunk-XDKB2P5X.js} +1 -1
- package/chunks/{chunk-SBMB4OL3.js → chunk-YL6YAGLL.js} +62 -8
- package/chunks/{chunk-O6SD4A36.js → chunk-ZKQ2I3S2.js} +1 -1
- package/chunks/{codex-models-TYYV4JNN.js → codex-models-NHQW45SO.js} +5 -3
- package/chunks/{commands-WF5RG4I2.js → commands-N6GN5SBF.js} +2152 -3643
- package/chunks/{db-U3WQZVAO.js → db-5IWEJUYV.js} +3 -3
- package/chunks/{disclose-67GZCDBO.js → disclose-LDNKAVRH.js} +10 -8
- package/chunks/{dist-ACC3DZUZ.js → dist-BS4CY4RG.js} +3 -1
- package/chunks/{dist-EVTN3UTT.js → dist-FSS7MBDF.js} +2 -2
- package/chunks/{dist-F6X62TQK.js → dist-L3XJWWZ6.js} +225 -192
- package/chunks/{eval-runner-SA6OUGHZ.js → eval-runner-EMEGF24P.js} +11 -11
- package/chunks/{exploit-agent-36Q7XQFP.js → exploit-agent-KW4EB7BE.js} +1 -1
- package/chunks/{exploit-autoclimb-J4OTSTZ6.js → exploit-autoclimb-CXJ2ERRO.js} +1 -1
- package/chunks/{exploit-climb-PYEJDIC4.js → exploit-climb-TJWLY4XC.js} +2 -2
- package/chunks/fix-UUKPXCFB.js +26 -0
- package/chunks/{harness-GDUMKGSE.js → harness-C5HOKIEV.js} +3 -3
- package/chunks/{hunt-scan-UDJSCISU.js → hunt-scan-KZZ444V2.js} +14 -14
- package/chunks/{identity-JTIVJSV7.js → identity-62SVRW4H.js} +1 -1
- package/chunks/{kernel-primitive-F2IXUFAX.js → kernel-primitive-Z77IR7YS.js} +2 -2
- package/chunks/{kernel-vm-runner-276LHIOV.js → kernel-vm-runner-JW77P276.js} +2 -2
- package/chunks/{memsafety-scan-NHUOGTEX.js → memsafety-scan-FCPAXIZE.js} +2 -2
- package/chunks/{native-loop-3BSYVDUI.js → native-loop-P6P5GYVJ.js} +10 -10
- package/chunks/{npm-detectors-VIYJXKFQ.js → npm-detectors-Z2ZIQCN4.js} +2 -2
- package/chunks/orchestrate-DWWUT5RC.js +58 -0
- package/chunks/{process-PNMC36JI.js → process-N245QIQG.js} +1 -4
- package/chunks/{run-CBGE6DRQ.js → run-GAFKBCTN.js} +14935 -17598
- package/chunks/{runtime-PXO5G6UV.js → runtime-H7YBR5IZ.js} +4 -5
- package/chunks/{scope-NJHIDDTN.js → scope-QWY4VQZ7.js} +4 -1
- package/chunks/{session-store-46WBZM22.js → session-store-XIDFGG7K.js} +2 -2
- package/chunks/{variant-candidates-UH2WC2HA.js → variant-candidates-7D4F5E4H.js} +3 -3
- package/chunks/{web-recon-prepass-SFXU44SS.js → web-recon-prepass-VXXBPDAV.js} +3 -3
- 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-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 +2 -3
- 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 +10 -3
- package/vendor/tree-sitter-0.21.1-node24.json +16 -0
- package/vendor/tree-sitter-0.21.1-node24.tgz +0 -0
- package/chunks/chunk-CGHCEN7W.js +0 -169
- package/chunks/chunk-CXKDWFNO.js +0 -102
- package/chunks/chunk-GIQKESMN.js +0 -687
- package/chunks/chunk-HPQZHOIU.js +0 -67
- package/chunks/chunk-PD2BBBKT.js +0 -245
- package/chunks/chunk-WF5W75WY.js +0 -1070
- package/chunks/fix-J2KBRJDV.js +0 -12
- package/chunks/orchestrate-DHBFRTSI.js +0 -59
- package/chunks/replay-runner-LK2XFIVG.js +0 -39
- 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-BT7RkC4q.js +0 -32
- package/dashboard/assets/desktop-OaBI0E0e.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-B4rwF6fZ.js +0 -5
- package/dashboard/assets/format-LNQSSpn6.js +0 -1
- package/dashboard/assets/jsx-runtime-C7oxC63R.js +0 -1
- package/dashboard/assets/live-page-DoNwpPAO.js +0 -1
- package/dashboard/assets/meta-tile-BMtBC-Qq.js +0 -1
- package/dashboard/assets/operations-app-ER0gg7GN.js +0 -2
- package/dashboard/assets/operations-e2CGYKB1.js +0 -4
- package/dashboard/assets/overview-page-CmeWH17A.js +0 -1
- package/dashboard/assets/page-header-CIJyycfz.js +0 -1
- package/dashboard/assets/play-Dwo-9xt6.js +0 -1
- package/dashboard/assets/scans-page-CuhzWhHx.js +0 -1
- package/dashboard/assets/search-CiooTLck.js +0 -1
- package/dashboard/assets/siren-CCBwTSuk.js +0 -1
- package/dashboard/assets/table-BgsSBdke.js +0 -1
- package/dashboard/assets/tabs-vn6v7Bk6.js +0 -1
- package/dashboard/desktop.html +0 -21
|
@@ -11,18 +11,17 @@ import {
|
|
|
11
11
|
detectAvailableRuntimes,
|
|
12
12
|
getRuntimeInfo,
|
|
13
13
|
pickRuntimeForStage
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IFME676H.js";
|
|
15
15
|
import {
|
|
16
16
|
ProcessRuntime
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-CXKDWFNO.js";
|
|
17
|
+
} from "./chunk-W6UWZFKL.js";
|
|
19
18
|
import {
|
|
20
19
|
LlmApiRuntime,
|
|
21
20
|
OperatorAbortError,
|
|
22
21
|
QuotaExhaustedError,
|
|
23
22
|
parseUsageLimitReached
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-
|
|
23
|
+
} from "./chunk-AV2LG2L7.js";
|
|
24
|
+
import "./chunk-KAU6NLGP.js";
|
|
26
25
|
import "./chunk-VIT5ALXF.js";
|
|
27
26
|
import "./chunk-VCSFCHAJ.js";
|
|
28
27
|
export {
|
|
@@ -7,7 +7,10 @@ import {
|
|
|
7
7
|
loadScope,
|
|
8
8
|
matchUrl,
|
|
9
9
|
normalizeScopeHostname
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-X7LAEEUW.js";
|
|
11
|
+
import "./chunk-5IBCBQEH.js";
|
|
12
|
+
import "./chunk-KAU6NLGP.js";
|
|
13
|
+
import "./chunk-VIT5ALXF.js";
|
|
11
14
|
import "./chunk-VCSFCHAJ.js";
|
|
12
15
|
export {
|
|
13
16
|
ScopePolicy,
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
relativeAge,
|
|
12
12
|
saveSession,
|
|
13
13
|
sessionsDir
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-BOUGKEKA.js";
|
|
15
|
+
import "./chunk-KAU6NLGP.js";
|
|
16
16
|
import "./chunk-VIT5ALXF.js";
|
|
17
17
|
import "./chunk-VCSFCHAJ.js";
|
|
18
18
|
export {
|
|
@@ -3,9 +3,9 @@ import { createRequire as __0CreateRequire } from "node:module";
|
|
|
3
3
|
const require = __0CreateRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
generateVariantCandidates
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-4G7OVYJX.js";
|
|
7
|
+
import "./chunk-AV2LG2L7.js";
|
|
8
|
+
import "./chunk-KAU6NLGP.js";
|
|
9
9
|
import "./chunk-VIT5ALXF.js";
|
|
10
10
|
import "./chunk-VCSFCHAJ.js";
|
|
11
11
|
export {
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
fingerprintWebStack,
|
|
7
7
|
runBaselineWebChecks,
|
|
8
8
|
summarizeWebStackFingerprint
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XCISCI4T.js";
|
|
10
10
|
import {
|
|
11
11
|
enumerateSubdomains,
|
|
12
12
|
scanJsArtifacts,
|
|
13
13
|
searchAdvisories
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-YL6YAGLL.js";
|
|
15
|
+
import "./chunk-KAU6NLGP.js";
|
|
16
16
|
import "./chunk-VIT5ALXF.js";
|
|
17
17
|
import "./chunk-VCSFCHAJ.js";
|
|
18
18
|
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { createServer } from "node:http";
|
|
3
|
+
import { access, mkdir, mkdtemp, realpath, rm, writeFile } from "node:fs/promises";
|
|
4
|
+
import { constants } from "node:fs";
|
|
5
|
+
import { homedir, tmpdir } from "node:os";
|
|
6
|
+
import { join, resolve, sep } from "node:path";
|
|
7
|
+
const FIXTURE_ID = "fixture:cli-path-traversal";
|
|
8
|
+
const DEFAULT_TIMEOUT_MS = 10_000;
|
|
9
|
+
const SIGKILL_GRACE_MS = 1_000;
|
|
10
|
+
const CAPTURE_BYTES = 1024 * 1024;
|
|
11
|
+
const EXCERPT_BYTES = 4 * 1024;
|
|
12
|
+
function excerpt(text, max = EXCERPT_BYTES) {
|
|
13
|
+
if (text.length <= max)
|
|
14
|
+
return text;
|
|
15
|
+
return text.slice(0, max) + "...[truncated]";
|
|
16
|
+
}
|
|
17
|
+
function isInside(root, candidate) {
|
|
18
|
+
return candidate === root || candidate.startsWith(root + sep);
|
|
19
|
+
}
|
|
20
|
+
async function exists(path) {
|
|
21
|
+
try {
|
|
22
|
+
await access(path, constants.F_OK);
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function appendCapped(current, chunk) {
|
|
30
|
+
if (current.length >= CAPTURE_BYTES)
|
|
31
|
+
return current;
|
|
32
|
+
const next = current + chunk.toString("utf8");
|
|
33
|
+
if (next.length <= CAPTURE_BYTES)
|
|
34
|
+
return next;
|
|
35
|
+
return next.slice(0, CAPTURE_BYTES) + "\n...[truncated at 1MiB]";
|
|
36
|
+
}
|
|
37
|
+
async function runCommand(argv, options) {
|
|
38
|
+
return await new Promise((resolveCommand) => {
|
|
39
|
+
let stdout = "";
|
|
40
|
+
let stderr = "";
|
|
41
|
+
let settled = false;
|
|
42
|
+
let timedOut = false;
|
|
43
|
+
let timer;
|
|
44
|
+
let killTimer;
|
|
45
|
+
const child = spawn(argv[0], argv.slice(1), {
|
|
46
|
+
cwd: options.cwd,
|
|
47
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
48
|
+
});
|
|
49
|
+
const finish = (result) => {
|
|
50
|
+
if (settled)
|
|
51
|
+
return;
|
|
52
|
+
settled = true;
|
|
53
|
+
if (timer)
|
|
54
|
+
clearTimeout(timer);
|
|
55
|
+
if (killTimer)
|
|
56
|
+
clearTimeout(killTimer);
|
|
57
|
+
resolveCommand(result);
|
|
58
|
+
};
|
|
59
|
+
timer = setTimeout(() => {
|
|
60
|
+
timedOut = true;
|
|
61
|
+
child.kill("SIGTERM");
|
|
62
|
+
killTimer = setTimeout(() => {
|
|
63
|
+
if (settled)
|
|
64
|
+
return;
|
|
65
|
+
child.kill("SIGKILL");
|
|
66
|
+
finish({
|
|
67
|
+
exitCode: null,
|
|
68
|
+
stdout,
|
|
69
|
+
stderr,
|
|
70
|
+
timedOut,
|
|
71
|
+
error: `command timed out after ${options.timeoutMs}ms and did not exit after SIGTERM`,
|
|
72
|
+
});
|
|
73
|
+
}, SIGKILL_GRACE_MS);
|
|
74
|
+
}, options.timeoutMs);
|
|
75
|
+
child.stdout?.on("data", (chunk) => {
|
|
76
|
+
stdout = appendCapped(stdout, chunk);
|
|
77
|
+
});
|
|
78
|
+
child.stderr?.on("data", (chunk) => {
|
|
79
|
+
stderr = appendCapped(stderr, chunk);
|
|
80
|
+
});
|
|
81
|
+
child.on("error", (err) => {
|
|
82
|
+
finish({
|
|
83
|
+
exitCode: null,
|
|
84
|
+
stdout,
|
|
85
|
+
stderr,
|
|
86
|
+
timedOut,
|
|
87
|
+
error: err instanceof Error ? err.message : String(err),
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
child.on("close", (code) => {
|
|
91
|
+
finish({
|
|
92
|
+
exitCode: code,
|
|
93
|
+
stdout,
|
|
94
|
+
stderr,
|
|
95
|
+
timedOut,
|
|
96
|
+
error: timedOut ? `command timed out after ${options.timeoutMs}ms` : undefined,
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
async function startMaliciousExportServer() {
|
|
102
|
+
const payload = {
|
|
103
|
+
rootPath: "demo",
|
|
104
|
+
paperclipExtensionPath: null,
|
|
105
|
+
warnings: [],
|
|
106
|
+
files: {
|
|
107
|
+
"../escaped-marker": "0 deterministic verification\n",
|
|
108
|
+
"README.md": "normal export content\n",
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
const server = createServer((req, res) => {
|
|
112
|
+
if (req.method === "GET" && req.url === "/company/export") {
|
|
113
|
+
res.statusCode = 200;
|
|
114
|
+
res.setHeader("content-type", "application/json");
|
|
115
|
+
res.end(JSON.stringify(payload));
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
res.statusCode = 404;
|
|
119
|
+
res.end("not found");
|
|
120
|
+
});
|
|
121
|
+
await new Promise((resolveListen, rejectListen) => {
|
|
122
|
+
server.once("error", rejectListen);
|
|
123
|
+
server.listen(0, "127.0.0.1", () => resolveListen());
|
|
124
|
+
});
|
|
125
|
+
const address = server.address();
|
|
126
|
+
if (!address || typeof address === "string") {
|
|
127
|
+
await closeServer(server);
|
|
128
|
+
throw new Error("failed to allocate fixture server port");
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
server,
|
|
132
|
+
baseUrl: `http://127.0.0.1:${address.port}`,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
async function closeServer(server) {
|
|
136
|
+
await new Promise((resolveClose) => {
|
|
137
|
+
server.close(() => resolveClose());
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function expandCommandArgv(argv, replacements) {
|
|
141
|
+
return argv.map((arg) => arg
|
|
142
|
+
.replaceAll("{{apiUrl}}", replacements.apiUrl)
|
|
143
|
+
.replaceAll("{{exportDir}}", replacements.exportDir)
|
|
144
|
+
.replaceAll("{{fixtureMode}}", replacements.fixtureMode));
|
|
145
|
+
}
|
|
146
|
+
function assertion(kind, passed, detail) {
|
|
147
|
+
return { kind, passed, detail };
|
|
148
|
+
}
|
|
149
|
+
async function buildAssertions(paths) {
|
|
150
|
+
const [sandboxReal, exportReal] = await Promise.all([
|
|
151
|
+
realpath(paths.sandboxRoot),
|
|
152
|
+
realpath(paths.exportDir),
|
|
153
|
+
]);
|
|
154
|
+
const escapedExists = await exists(paths.escapedPath);
|
|
155
|
+
const insideExportExists = await exists(paths.insideExportPath);
|
|
156
|
+
let escapedReal = resolve(paths.escapedPath);
|
|
157
|
+
if (escapedExists) {
|
|
158
|
+
escapedReal = await realpath(paths.escapedPath);
|
|
159
|
+
}
|
|
160
|
+
const homeReal = await realpath(homedir()).catch(() => homedir());
|
|
161
|
+
const profileNames = new Set([".bashrc", ".zshrc", ".profile", ".bash_profile"]);
|
|
162
|
+
const escapedBase = escapedReal.split(sep).at(-1) ?? "";
|
|
163
|
+
const escapedInsideHome = isInside(homeReal, escapedReal);
|
|
164
|
+
const escapedMatchesProfile = profileNames.has(escapedBase);
|
|
165
|
+
const noHomeProfileTouch = !escapedInsideHome && !escapedMatchesProfile;
|
|
166
|
+
const noHomeProfileTouchDetail = escapedInsideHome
|
|
167
|
+
? `touched path ${escapedReal} is inside home directory ${homeReal}`
|
|
168
|
+
: escapedMatchesProfile
|
|
169
|
+
? `touched path ${escapedReal} matches profile basename ${escapedBase}`
|
|
170
|
+
: `touched path ${escapedReal} is not a home directory or shell profile target`;
|
|
171
|
+
return [
|
|
172
|
+
assertion("filesystem_exists", escapedExists, escapedExists
|
|
173
|
+
? `escaped marker exists at ${escapedReal}`
|
|
174
|
+
: `escaped marker not found at ${paths.escapedPath}`),
|
|
175
|
+
assertion("filesystem_not_exists", !insideExportExists, insideExportExists
|
|
176
|
+
? `unexpected marker found inside export root at ${paths.insideExportPath}`
|
|
177
|
+
: `no escaped marker exists inside export root at ${paths.insideExportPath}`),
|
|
178
|
+
assertion("path_outside_export_root", escapedExists && !isInside(exportReal, escapedReal), escapedExists
|
|
179
|
+
? `escaped marker realpath ${escapedReal} is outside export root ${exportReal}`
|
|
180
|
+
: "escaped marker missing, so export-root escape was not reproduced"),
|
|
181
|
+
assertion("path_inside_sandbox", escapedExists && isInside(sandboxReal, escapedReal), escapedExists
|
|
182
|
+
? `escaped marker stayed inside sandbox ${sandboxReal}`
|
|
183
|
+
: "escaped marker missing, so sandbox containment could not be proven"),
|
|
184
|
+
assertion("no_home_profile_touch", noHomeProfileTouch, noHomeProfileTouchDetail),
|
|
185
|
+
];
|
|
186
|
+
}
|
|
187
|
+
function resultStatus(args) {
|
|
188
|
+
const required = new Set([
|
|
189
|
+
"filesystem_exists",
|
|
190
|
+
"filesystem_not_exists",
|
|
191
|
+
"path_outside_export_root",
|
|
192
|
+
"path_inside_sandbox",
|
|
193
|
+
"no_home_profile_touch",
|
|
194
|
+
]);
|
|
195
|
+
const filesystemAssertions = args.assertions.filter((a) => required.has(a.kind));
|
|
196
|
+
if (filesystemAssertions.length > 0) {
|
|
197
|
+
if (filesystemAssertions.some((a) => a.kind === "filesystem_exists" && a.passed)) {
|
|
198
|
+
return "reproduced";
|
|
199
|
+
}
|
|
200
|
+
if (args.command.timedOut)
|
|
201
|
+
return "error";
|
|
202
|
+
if (args.command.error && args.command.exitCode === null)
|
|
203
|
+
return "error";
|
|
204
|
+
return "not_reproduced";
|
|
205
|
+
}
|
|
206
|
+
if (args.command.error && args.command.exitCode === null)
|
|
207
|
+
return "error";
|
|
208
|
+
if (args.command.timedOut)
|
|
209
|
+
return "error";
|
|
210
|
+
if (args.command.exitCode !== 0)
|
|
211
|
+
return "error";
|
|
212
|
+
return "inconclusive";
|
|
213
|
+
}
|
|
214
|
+
function summaryFor(status) {
|
|
215
|
+
switch (status) {
|
|
216
|
+
case "reproduced":
|
|
217
|
+
return "CLI path traversal replay wrote a marker outside the selected export directory inside the sandbox.";
|
|
218
|
+
case "not_reproduced":
|
|
219
|
+
return "CLI path traversal replay completed but did not write outside the selected export directory.";
|
|
220
|
+
case "inconclusive":
|
|
221
|
+
return "CLI path traversal replay was inconclusive.";
|
|
222
|
+
case "error":
|
|
223
|
+
return "CLI path traversal replay failed before reaching a reliable verdict.";
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Run the deterministic CLI path traversal replay from 0#195.
|
|
228
|
+
*
|
|
229
|
+
* The fixture starts a malicious local API server and runs the caller-supplied
|
|
230
|
+
* CLI command against a sandboxed export directory. The harness itself never
|
|
231
|
+
* implements export behavior; the verdict comes from the CLI under test plus
|
|
232
|
+
* filesystem assertions over the sandbox.
|
|
233
|
+
*/
|
|
234
|
+
export async function runCliPathTraversalReplayFixture(options = {}) {
|
|
235
|
+
const startedAt = new Date().toISOString();
|
|
236
|
+
const fixtureMode = options.fixtureMode ?? "vulnerable";
|
|
237
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
238
|
+
const retainArtifacts = options.retainArtifacts || Boolean(options.artifactDir);
|
|
239
|
+
const sandboxRoot = options.artifactDir
|
|
240
|
+
? resolve(options.artifactDir)
|
|
241
|
+
: await mkdtemp(join(tmpdir(), "0-verify-"));
|
|
242
|
+
const exportDir = join(sandboxRoot, "export");
|
|
243
|
+
const harnessDir = join(sandboxRoot, "harness");
|
|
244
|
+
const harnessRef = join(harnessDir, "harness.json");
|
|
245
|
+
const stdoutRef = join(sandboxRoot, "stdout.log");
|
|
246
|
+
const stderrRef = join(sandboxRoot, "stderr.log");
|
|
247
|
+
const artifacts = {};
|
|
248
|
+
if (retainArtifacts) {
|
|
249
|
+
artifacts.sandbox_ref = sandboxRoot;
|
|
250
|
+
artifacts.harness_ref = harnessRef;
|
|
251
|
+
artifacts.stdout_ref = stdoutRef;
|
|
252
|
+
artifacts.stderr_ref = stderrRef;
|
|
253
|
+
artifacts.export_ref = exportDir;
|
|
254
|
+
}
|
|
255
|
+
let server;
|
|
256
|
+
let argv = [];
|
|
257
|
+
let command;
|
|
258
|
+
try {
|
|
259
|
+
await mkdir(exportDir, { recursive: true });
|
|
260
|
+
const fixture = await startMaliciousExportServer();
|
|
261
|
+
server = fixture.server;
|
|
262
|
+
if (!options.commandArgv || options.commandArgv.length === 0) {
|
|
263
|
+
throw new Error("cli-path-traversal fixture requires commandArgv for the real CLI under test");
|
|
264
|
+
}
|
|
265
|
+
argv = expandCommandArgv(options.commandArgv, {
|
|
266
|
+
apiUrl: fixture.baseUrl,
|
|
267
|
+
exportDir,
|
|
268
|
+
fixtureMode,
|
|
269
|
+
});
|
|
270
|
+
await mkdir(harnessDir, { recursive: true });
|
|
271
|
+
await writeFile(harnessRef, JSON.stringify({
|
|
272
|
+
fixture: "cli-path-traversal",
|
|
273
|
+
fixtureMode,
|
|
274
|
+
commandArgv: options.commandArgv,
|
|
275
|
+
expandedArgv: argv,
|
|
276
|
+
apiUrl: fixture.baseUrl,
|
|
277
|
+
exportDir,
|
|
278
|
+
}, null, 2) + "\n", "utf8");
|
|
279
|
+
command = await runCommand(argv, {
|
|
280
|
+
cwd: sandboxRoot,
|
|
281
|
+
timeoutMs,
|
|
282
|
+
});
|
|
283
|
+
await writeFile(stdoutRef, command.stdout, "utf8");
|
|
284
|
+
await writeFile(stderrRef, command.stderr, "utf8");
|
|
285
|
+
const assertions = await buildAssertions({
|
|
286
|
+
sandboxRoot,
|
|
287
|
+
exportDir,
|
|
288
|
+
escapedPath: join(sandboxRoot, "escaped-marker"),
|
|
289
|
+
insideExportPath: join(exportDir, "escaped-marker"),
|
|
290
|
+
});
|
|
291
|
+
if (command.exitCode !== 0 || command.error) {
|
|
292
|
+
assertions.unshift(assertion("command_exit_zero", false, command.error ?? `fixture command exited ${String(command.exitCode)}`));
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
assertions.unshift(assertion("command_exit_zero", true, "fixture command exited 0"));
|
|
296
|
+
}
|
|
297
|
+
const status = resultStatus({ command, assertions });
|
|
298
|
+
return {
|
|
299
|
+
status,
|
|
300
|
+
mode: "deterministic_replay",
|
|
301
|
+
finding_id: FIXTURE_ID,
|
|
302
|
+
engine_version: options.engineVersion ?? "unknown",
|
|
303
|
+
started_at: startedAt,
|
|
304
|
+
completed_at: new Date().toISOString(),
|
|
305
|
+
commands: [
|
|
306
|
+
{
|
|
307
|
+
argv,
|
|
308
|
+
exit_code: command.exitCode,
|
|
309
|
+
stdout_excerpt: excerpt(command.stdout),
|
|
310
|
+
stderr_excerpt: excerpt(command.stderr),
|
|
311
|
+
},
|
|
312
|
+
],
|
|
313
|
+
assertions,
|
|
314
|
+
artifacts,
|
|
315
|
+
summary: summaryFor(status),
|
|
316
|
+
error_reason: status === "error" ? command.error ?? "fixture command failed" : null,
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
catch (err) {
|
|
320
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
321
|
+
return {
|
|
322
|
+
status: "error",
|
|
323
|
+
mode: "deterministic_replay",
|
|
324
|
+
finding_id: FIXTURE_ID,
|
|
325
|
+
engine_version: options.engineVersion ?? "unknown",
|
|
326
|
+
started_at: startedAt,
|
|
327
|
+
completed_at: new Date().toISOString(),
|
|
328
|
+
commands: command
|
|
329
|
+
? [
|
|
330
|
+
{
|
|
331
|
+
argv,
|
|
332
|
+
exit_code: command.exitCode,
|
|
333
|
+
stdout_excerpt: excerpt(command.stdout),
|
|
334
|
+
stderr_excerpt: excerpt(command.stderr),
|
|
335
|
+
},
|
|
336
|
+
]
|
|
337
|
+
: [],
|
|
338
|
+
assertions: [],
|
|
339
|
+
artifacts,
|
|
340
|
+
summary: summaryFor("error"),
|
|
341
|
+
error_reason: reason,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
finally {
|
|
345
|
+
if (server)
|
|
346
|
+
await closeServer(server);
|
|
347
|
+
if (!retainArtifacts) {
|
|
348
|
+
await rm(sandboxRoot, { recursive: true, force: true });
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
//# sourceMappingURL=cli-path-traversal-fixture.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e}from"./input-TuVPR3Zl.js";var t=e(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e,m as t}from"./jsx-runtime-MGseXjj5.js";import{l as n}from"./format--susmHX7.js";import{i as r,l as i,m as a,n as o,p as s,s as c,t as l,v as u}from"./operations-BxZ0OoXO.js";var d=class extends u{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),s(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&c(t.mutationKey)!==c(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??o();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){r.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},f=t(e(),1);function p(e,t){let n=l(t),[o]=f.useState(()=>new d(n,e));f.useEffect(()=>{o.setOptions(e)},[o,e]);let s=f.useSyncExternalStore(f.useCallback(e=>o.subscribe(r.batchCalls(e)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),c=f.useCallback((e,t)=>{o.mutate(e,t).catch(i)},[o]);if(s.error&&a(o.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:c,mutateAsync:s.mutate}}var m=f.useId||(()=>void 0),h=0;function g(e){let[t,r]=f.useState(m());return n(()=>{e||r(e=>e??String(h++))},[e]),e||(t?`radix-${t}`:``)}var _=f.useInsertionEffect||n;function v({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=y({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=f.useRef(e!==void 0);f.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,f.useCallback(t=>{if(s){let n=b(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function y({defaultProp:e,onChange:t}){let[n,r]=f.useState(e),i=f.useRef(n),a=f.useRef(t);return _(()=>{a.current=t},[t]),f.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function b(e){return typeof e==`function`}export{g as n,p as r,v as t};
|