0sec-cli 0.18.0 → 0.21.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{0sec.js → 0.js} +84 -76
- package/LICENSE +1 -1
- package/README.md +74 -43
- package/chunks/adapt-loop-IGBRQAXO.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-LNQJUORS.js} +6 -6
- package/chunks/{assumption-mining-5SNIVVDN.js → assumption-mining-4MJTP6H5.js} +24 -26
- package/chunks/{chunk-P6WKNFWX.js → chunk-2OQOQ2FZ.js} +8 -8
- package/chunks/{chunk-5G3ZXFBW.js → chunk-2WNCI664.js} +3 -3
- package/chunks/{chunk-AHTBZC3E.js → chunk-2WSXFFJZ.js} +4 -4
- package/chunks/{chunk-DW5UWPFY.js → chunk-4VGLO2YS.js} +6 -5
- package/chunks/{chunk-3KPWWJCI.js → chunk-5T6D5BVY.js} +88 -88
- package/chunks/{chunk-OEFNRYI2.js → chunk-6GHSR47F.js} +3 -6
- package/chunks/chunk-6YNKRUMC.js +4474 -0
- package/chunks/{chunk-BZNEY2ZS.js → chunk-ANDKY54G.js} +22390 -19895
- package/chunks/{chunk-53G27VPS.js → chunk-AZ7L3HFD.js} +7 -2
- package/chunks/{chunk-UR4ELX2Y.js → chunk-BACXRTQ4.js} +633 -316
- package/chunks/{chunk-UCYRA73C.js → chunk-CAJJRUTV.js} +4 -4
- package/chunks/{chunk-57ZENEX2.js → chunk-CGHCEN7W.js} +3 -3
- package/chunks/{chunk-AD7WXDH6.js → chunk-CL5KAUM6.js} +16 -16
- package/chunks/{chunk-ADOLI6DT.js → chunk-CXKDWFNO.js} +6 -6
- package/chunks/{chunk-RWONANDA.js → chunk-DQTNI3KY.js} +5 -5
- package/chunks/{chunk-BFR2CDV5.js → chunk-E2UOY5PJ.js} +288 -100
- package/chunks/{chunk-ATATQACO.js → chunk-ER3SUMYJ.js} +40 -18
- package/chunks/{chunk-5JI7L7KV.js → chunk-FAH6V4QM.js} +30515 -32242
- package/chunks/{chunk-6LKRLK2R.js → chunk-FHC2B7LN.js} +3 -3
- package/chunks/{chunk-XM5NLHYU.js → chunk-FWAYJ2IV.js} +16 -16
- package/chunks/{chunk-WVTBZEQO.js → chunk-G34QP2XW.js} +8 -8
- package/chunks/{chunk-MYVT64FN.js → chunk-GHWODZMR.js} +2 -2
- package/chunks/{chunk-F3WBKITT.js → chunk-GIQKESMN.js} +10 -10
- package/chunks/{chunk-2RMLOJVB.js → chunk-GVD6SJGH.js} +2 -2
- package/chunks/{chunk-WXQ6BJ6A.js → chunk-HBKCGJAV.js} +7 -7
- package/chunks/{chunk-SF4KZ4O3.js → chunk-HLFS6WV2.js} +2 -2
- package/chunks/chunk-HPQZHOIU.js +67 -0
- package/chunks/{chunk-TSK2AG6J.js → chunk-IMGWPNQM.js} +231 -1308
- package/chunks/{chunk-3MOLBTLS.js → chunk-K2PWUPUI.js} +2 -2
- package/chunks/{chunk-N7BOUYEV.js → chunk-NDJU5ZZ7.js} +14 -14
- package/chunks/{chunk-BVAZO4WA.js → chunk-NOPBXZUV.js} +3 -3
- package/chunks/{chunk-2JCCA2JL.js → chunk-O6SD4A36.js} +3 -3
- package/chunks/{chunk-SAFFWQW4.js → chunk-P6YG6TEZ.js} +6 -6
- package/chunks/{chunk-6L26OBWI.js → chunk-PC6RCKQV.js} +198 -11
- package/chunks/{chunk-LP3HHYQU.js → chunk-PD2BBBKT.js} +2 -2
- package/chunks/{chunk-BKZFDZ23.js → chunk-QCUFBVIZ.js} +3 -3
- package/chunks/{chunk-KLTNTE2Z.js → chunk-QZVG3BG4.js} +14 -14
- package/chunks/{chunk-ASUR522M.js → chunk-RF5QGKLR.js} +9 -9
- package/chunks/{chunk-YYRBQVFE.js → chunk-SBMB4OL3.js} +9 -9
- package/chunks/{chunk-IOL7D5YV.js → chunk-SQCBHFWN.js} +3 -3
- package/chunks/{chunk-BFRB6HB2.js → chunk-TF46UWFU.js} +3 -3
- package/chunks/chunk-TH2LW437.js +7829 -0
- package/chunks/chunk-TRH2PJSN.js +547 -0
- package/chunks/{chunk-RJWOYEOG.js → chunk-UEX7PFSE.js} +5 -5
- package/chunks/{chunk-VQG4FT5D.js → chunk-UFHN6RIU.js} +2 -2
- 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-U5FLXGHT.js → chunk-VOAXLO4A.js} +10 -10
- package/chunks/{chunk-WEBMRWEG.js → chunk-W4JOXE4N.js} +83 -75
- package/chunks/{chunk-C2WXWFBB.js → chunk-WF5W75WY.js} +25 -25
- package/chunks/{chunk-SVJEDVYK.js → chunk-WPQLBN4S.js} +5 -5
- package/chunks/{chunk-72CISA2D.js → chunk-WZISK5VC.js} +37 -35
- package/chunks/{chunk-CMKXP5RR.js → chunk-Y5H6E24H.js} +3 -3
- package/chunks/{chunk-BATRQBOR.js → chunk-YA4PUM4H.js} +41 -41
- package/chunks/{chunk-JQHOLLTD.js → chunk-YHWWF4QY.js} +9 -9
- package/chunks/{chunk-GMT2AZKM.js → chunk-YPOA3W4O.js} +28 -28
- package/chunks/{chunk-7DQEV5QI.js → chunk-Z3IKZX3X.js} +4 -4
- package/chunks/codex-models-TYYV4JNN.js +15 -0
- package/chunks/{commands-TBC2F5CE.js → commands-WF5RG4I2.js} +3834 -931
- 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-U3WQZVAO.js +16 -0
- package/chunks/{disclose-EKTWSCGW.js → disclose-67GZCDBO.js} +5 -5
- package/chunks/{dist-FMGSR3DW.js → dist-ACC3DZUZ.js} +11 -5
- package/chunks/{dist-4MAW5X6L.js → dist-EVTN3UTT.js} +6 -6
- package/chunks/{dist-4YICS2J2.js → dist-F6X62TQK.js} +286 -327
- package/chunks/dist-KEULE5IQ.js +21914 -0
- package/chunks/dist-XZB53PS5.js +53 -0
- package/chunks/eval-runner-SA6OUGHZ.js +26 -0
- package/chunks/example-manifest.json +2 -2
- package/chunks/{exploit-agent-45YQOHPJ.js → exploit-agent-36Q7XQFP.js} +4 -4
- package/chunks/{exploit-autoclimb-UZGEMGYT.js → exploit-autoclimb-J4OTSTZ6.js} +6 -6
- package/chunks/{exploit-climb-SG23KB2G.js → exploit-climb-PYEJDIC4.js} +12 -12
- package/chunks/fix-J2KBRJDV.js +12 -0
- package/chunks/{github-issues-MJ6OYOOU.js → github-issues-IGTTWM7V.js} +7 -7
- package/chunks/harness-GDUMKGSE.js +22 -0
- package/chunks/http-conformance-U5F6GKYG.js +11 -0
- package/chunks/http-sender-I5XFFY35.js +10 -0
- package/chunks/hunt-scan-UDJSCISU.js +36 -0
- package/chunks/{identity-6ZAIIWOR.js → identity-JTIVJSV7.js} +5 -5
- package/chunks/{kernel-primitive-7U6CWHXD.js → kernel-primitive-F2IXUFAX.js} +6 -6
- package/chunks/{kernel-vm-runner-3JAU4O6J.js → kernel-vm-runner-276LHIOV.js} +6 -6
- package/chunks/memsafety-scan-NHUOGTEX.js +16 -0
- package/chunks/{native-loop-RJCJPOUS.js → native-loop-3BSYVDUI.js} +17 -18
- package/chunks/{npm-detectors-KB5Y5ZFX.js → npm-detectors-VIYJXKFQ.js} +6 -6
- package/chunks/npm-dynamic-discovery-5J7FT3XM.js +13 -0
- package/chunks/orchestrate-DHBFRTSI.js +59 -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-PNMC36JI.js +15 -0
- package/chunks/{replay-runner-45G3VU7X.js → replay-runner-LK2XFIVG.js} +7 -7
- package/chunks/{run-D56MPDKY.js → run-CBGE6DRQ.js} +2201 -1694
- package/chunks/{runtime-G7YWIO3B.js → runtime-PXO5G6UV.js} +11 -11
- package/chunks/runtime-XFWJTBUO.js +12 -0
- package/chunks/{scan-stream-FHI2FYZE.js → scan-stream-BMOCPKQX.js} +7 -7
- package/chunks/{scope-BI7BF4ZY.js → scope-NJHIDDTN.js} +4 -4
- package/chunks/{session-store-GZ4A4KYT.js → session-store-46WBZM22.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-UH2WC2HA.js +13 -0
- package/chunks/{web-recon-prepass-JJGPEOLE.js → web-recon-prepass-SFXU44SS.js} +9 -9
- package/dashboard/assets/desktop-BT7RkC4q.js +32 -0
- package/dashboard/assets/desktop-OaBI0E0e.css +1 -0
- package/dashboard/assets/{findings-page-CACW9nw2.js → findings-page-B4rwF6fZ.js} +2 -2
- package/dashboard/assets/{format-PoISqsES.js → format-LNQSSpn6.js} +1 -1
- package/dashboard/assets/live-page-DoNwpPAO.js +1 -0
- package/dashboard/assets/{meta-tile-CcskIV_o.js → meta-tile-BMtBC-Qq.js} +1 -1
- package/dashboard/assets/operations-CMFVrXEe.css +2 -0
- package/dashboard/assets/operations-app-ER0gg7GN.js +2 -0
- package/dashboard/assets/{operations-D8nUP5_m.js → operations-e2CGYKB1.js} +2 -2
- package/dashboard/assets/{overview-page-DTGS8dPo.js → overview-page-CmeWH17A.js} +1 -1
- package/dashboard/assets/{page-header-MFVvEtZW.js → page-header-CIJyycfz.js} +1 -1
- package/dashboard/assets/scans-page-CuhzWhHx.js +1 -0
- package/dashboard/assets/{table-BYS-nIVA.js → table-BgsSBdke.js} +1 -1
- package/dashboard/assets/{tabs-DivxbhQy.js → tabs-vn6v7Bk6.js} +1 -1
- package/dashboard/desktop.html +3 -3
- package/dashboard/index.html +3 -3
- package/package.json +11 -11
- 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-H2FFLZNK.js +0 -3
- 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/runtime-J7PLXZNM.js +0 -12
- 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/desktop-CXTQonNm.js +0 -32
- package/dashboard/assets/desktop-NOekk4QS.css +0 -1
- package/dashboard/assets/live-page-DrgQqQK5.js +0 -1
- package/dashboard/assets/operations-BKE8T-vY.css +0 -2
- package/dashboard/assets/operations-app-CQQhG54n.js +0 -2
- package/dashboard/assets/scans-page-ChVtq8Us.js +0 -1
package/chunks/chunk-RRMJC3ZE.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __0secCreateRequire } from "node:module";
|
|
3
|
-
const require = __0secCreateRequire(import.meta.url);
|
|
4
|
-
|
|
5
|
-
// packages/core/dist/agent/output-truncation.js
|
|
6
|
-
var BYTES_PER_TOKEN = 4;
|
|
7
|
-
var DEFAULT_TOOL_OUTPUT_TOKENS = 1e4;
|
|
8
|
-
function utf8Size(codePoint) {
|
|
9
|
-
if (codePoint < 128)
|
|
10
|
-
return 1;
|
|
11
|
-
if (codePoint < 2048)
|
|
12
|
-
return 2;
|
|
13
|
-
if (codePoint < 65536)
|
|
14
|
-
return 3;
|
|
15
|
-
return 4;
|
|
16
|
-
}
|
|
17
|
-
function headSlice(text, byteBudget) {
|
|
18
|
-
let bytes = 0;
|
|
19
|
-
let i = 0;
|
|
20
|
-
while (i < text.length) {
|
|
21
|
-
const cp = text.codePointAt(i);
|
|
22
|
-
const size = utf8Size(cp);
|
|
23
|
-
if (bytes + size > byteBudget)
|
|
24
|
-
break;
|
|
25
|
-
bytes += size;
|
|
26
|
-
i += cp > 65535 ? 2 : 1;
|
|
27
|
-
}
|
|
28
|
-
return text.slice(0, i);
|
|
29
|
-
}
|
|
30
|
-
function tailSlice(text, byteBudget) {
|
|
31
|
-
let bytes = 0;
|
|
32
|
-
let end = text.length;
|
|
33
|
-
while (end > 0) {
|
|
34
|
-
let start = end - 1;
|
|
35
|
-
const unit = text.charCodeAt(start);
|
|
36
|
-
if (unit >= 56320 && unit <= 57343 && start > 0) {
|
|
37
|
-
const prev = text.charCodeAt(start - 1);
|
|
38
|
-
if (prev >= 55296 && prev <= 56319)
|
|
39
|
-
start -= 1;
|
|
40
|
-
}
|
|
41
|
-
const size = utf8Size(text.codePointAt(start));
|
|
42
|
-
if (bytes + size > byteBudget)
|
|
43
|
-
break;
|
|
44
|
-
bytes += size;
|
|
45
|
-
end = start;
|
|
46
|
-
}
|
|
47
|
-
return text.slice(end);
|
|
48
|
-
}
|
|
49
|
-
function truncateMiddle(text, options = {}) {
|
|
50
|
-
const limit = options.limit ?? DEFAULT_TOOL_OUTPUT_TOKENS;
|
|
51
|
-
const mode = options.mode ?? "tokens";
|
|
52
|
-
const byteBudget = Math.max(0, mode === "tokens" ? limit * BYTES_PER_TOKEN : limit);
|
|
53
|
-
const totalBytes = Buffer.byteLength(text, "utf8");
|
|
54
|
-
const originalTokens = Math.ceil(totalBytes / BYTES_PER_TOKEN);
|
|
55
|
-
const originalLines = text.length === 0 ? 0 : text.split("\n").length;
|
|
56
|
-
if (totalBytes <= byteBudget) {
|
|
57
|
-
return { text, truncated: false, originalTokens, originalLines, truncatedTokens: 0 };
|
|
58
|
-
}
|
|
59
|
-
const headBudget = Math.floor(byteBudget / 2);
|
|
60
|
-
const head = headSlice(text, headBudget);
|
|
61
|
-
const tail = tailSlice(text, byteBudget - headBudget);
|
|
62
|
-
const keptBytes = Buffer.byteLength(head, "utf8") + Buffer.byteLength(tail, "utf8");
|
|
63
|
-
const truncatedTokens = Math.ceil((totalBytes - keptBytes) / BYTES_PER_TOKEN);
|
|
64
|
-
return {
|
|
65
|
-
text: `${head}
|
|
66
|
-
\u2026${truncatedTokens} tokens truncated\u2026
|
|
67
|
-
${tail}`,
|
|
68
|
-
truncated: true,
|
|
69
|
-
originalTokens,
|
|
70
|
-
originalLines,
|
|
71
|
-
truncatedTokens
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function formatTruncated(text, policy = {}) {
|
|
75
|
-
const initial = truncateMiddle(text, policy);
|
|
76
|
-
if (!initial.truncated)
|
|
77
|
-
return initial.text;
|
|
78
|
-
const limit = policy.limit ?? DEFAULT_TOOL_OUTPUT_TOKENS;
|
|
79
|
-
const mode = policy.mode ?? "tokens";
|
|
80
|
-
const byteBudget = Math.max(0, mode === "tokens" ? limit * BYTES_PER_TOKEN : limit);
|
|
81
|
-
const header = [
|
|
82
|
-
`Warning: truncated output (original token count: ${initial.originalTokens})`,
|
|
83
|
-
`Total output lines: ${initial.originalLines}`,
|
|
84
|
-
""
|
|
85
|
-
].join("\n");
|
|
86
|
-
const headerBytes = Buffer.byteLength(header, "utf8");
|
|
87
|
-
if (headerBytes >= byteBudget)
|
|
88
|
-
return headSlice(header, byteBudget);
|
|
89
|
-
let bodyBudget = byteBudget - headerBytes;
|
|
90
|
-
let body = truncateMiddle(text, { mode: "bytes", limit: bodyBudget });
|
|
91
|
-
let rendered = `${header}
|
|
92
|
-
${body.text}`;
|
|
93
|
-
while (Buffer.byteLength(rendered, "utf8") > byteBudget && bodyBudget > 0) {
|
|
94
|
-
bodyBudget = Math.max(0, bodyBudget - (Buffer.byteLength(rendered, "utf8") - byteBudget));
|
|
95
|
-
body = truncateMiddle(text, { mode: "bytes", limit: bodyBudget });
|
|
96
|
-
rendered = `${header}
|
|
97
|
-
${body.text}`;
|
|
98
|
-
}
|
|
99
|
-
return Buffer.byteLength(rendered, "utf8") <= byteBudget ? rendered : headSlice(rendered, byteBudget);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export {
|
|
103
|
-
truncateMiddle,
|
|
104
|
-
formatTruncated
|
|
105
|
-
};
|