0sec-cli 0.15.0 → 0.17.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 (209) hide show
  1. package/0sec.js +322 -0
  2. package/README.md +63 -52
  3. package/attacks/data-exfiltration/pii-leakage.yaml +27 -0
  4. package/attacks/encoding-bypass/base64-encoding.yaml +24 -0
  5. package/attacks/jailbreak/dan-roleplay.yaml +27 -0
  6. package/attacks/jailbreak/hypothetical-scenario.yaml +25 -0
  7. package/attacks/jailbreak/multilingual-bypass.yaml +22 -0
  8. package/attacks/output-manipulation/harmful-content.yaml +25 -0
  9. package/attacks/prompt-injection/context-manipulation.yaml +32 -0
  10. package/attacks/prompt-injection/direct-injection.yaml +28 -0
  11. package/attacks/prompt-injection/indirect-injection.yaml +33 -0
  12. package/attacks/system-prompt-extraction/direct-ask.yaml +30 -0
  13. package/attacks/system-prompt-extraction/markdown-exfil.yaml +26 -0
  14. package/attacks/tool-misuse/ssrf-via-tools.yaml +27 -0
  15. package/chunks/adapt-loop-ECQG7454.js +18 -0
  16. package/chunks/adgraph-JLGA6RYI.js +54 -0
  17. package/chunks/agent/skills/frameworks/entra-id.yaml +63 -0
  18. package/chunks/agent/skills/frameworks/graphql-introspection.yaml +116 -0
  19. package/chunks/agent/skills/frameworks/nextjs.yaml +82 -0
  20. package/chunks/agent/skills/frameworks/python-web.yaml +85 -0
  21. package/chunks/agent/skills/frameworks/supabase.yaml +83 -0
  22. package/chunks/agent/skills/frameworks/wordpress-deep.yaml +122 -0
  23. package/chunks/agent/skills/techniques/ad-attack-paths.yaml +57 -0
  24. package/chunks/agent/skills/techniques/advisory-disclosure.yaml +59 -0
  25. package/chunks/agent/skills/techniques/assumption-mining.yaml +53 -0
  26. package/chunks/agent/skills/techniques/blind-exploitation.yaml +143 -0
  27. package/chunks/agent/skills/techniques/crypto-misuse.yaml +88 -0
  28. package/chunks/agent/skills/techniques/cve-poc-adaptation.yaml +82 -0
  29. package/chunks/agent/skills/techniques/entra-attack-paths.yaml +55 -0
  30. package/chunks/agent/skills/techniques/http-conformance-diff.yaml +48 -0
  31. package/chunks/agent/skills/techniques/jwt-attacks.yaml +137 -0
  32. package/chunks/agent/skills/techniques/kernel-weaponization.yaml +53 -0
  33. package/chunks/agent/skills/techniques/llm-excessive-agency.yaml +55 -0
  34. package/chunks/agent/skills/techniques/llm-insecure-output-handling.yaml +56 -0
  35. package/chunks/agent/skills/techniques/llm-prompt-injection.yaml +54 -0
  36. package/chunks/agent/skills/techniques/llm-prompt-layer-write.yaml +68 -0
  37. package/chunks/agent/skills/techniques/llm-rag-poisoning.yaml +57 -0
  38. package/chunks/agent/skills/techniques/llm-safety-eval.yaml +51 -0
  39. package/chunks/agent/skills/techniques/npm-ecosystem.yaml +51 -0
  40. package/chunks/agent/skills/techniques/poc-verification.yaml +55 -0
  41. package/chunks/agent/skills/techniques/race-condition.yaml +122 -0
  42. package/chunks/agent/skills/techniques/scoped-fix.yaml +49 -0
  43. package/chunks/agent/skills/techniques/seedless-depth-review.yaml +59 -0
  44. package/chunks/agent/skills/techniques/spec-differential.yaml +48 -0
  45. package/chunks/agent/skills/techniques/variant-hunting.yaml +55 -0
  46. package/chunks/agent/skills/vulnerabilities/cardano-eutxo-validators.yaml +72 -0
  47. package/chunks/agent/skills/vulnerabilities/command-injection.yaml +99 -0
  48. package/chunks/agent/skills/vulnerabilities/deserialization-chains.yaml +106 -0
  49. package/chunks/agent/skills/vulnerabilities/native-memory-safety.yaml +93 -0
  50. package/chunks/agent/skills/vulnerabilities/path-traversal.yaml +78 -0
  51. package/chunks/agent/skills/vulnerabilities/prototype-pollution.yaml +132 -0
  52. package/chunks/agent/skills/vulnerabilities/request-smuggling.yaml +129 -0
  53. package/chunks/agent/skills/vulnerabilities/sqli-advanced.yaml +102 -0
  54. package/chunks/agent/skills/vulnerabilities/ssrf-bypass.yaml +84 -0
  55. package/chunks/agent/skills/vulnerabilities/ssti-exploitation.yaml +112 -0
  56. package/chunks/agent/skills/vulnerabilities/structural-sqli.yaml +91 -0
  57. package/chunks/appsec-catalog-CBWHGTEL.js +24 -0
  58. package/chunks/artifact-scraper-GJEZMOHF.js +34 -0
  59. package/chunks/assumption-mining-BVMMUZHB.js +79 -0
  60. package/chunks/chunk-2CJ776PV.js +2430 -0
  61. package/chunks/chunk-2RMLOJVB.js +47 -0
  62. package/chunks/chunk-2SANI5RH.js +4728 -0
  63. package/chunks/chunk-3MOLBTLS.js +953 -0
  64. package/chunks/chunk-3QFDYBZQ.js +5108 -0
  65. package/chunks/chunk-47TQJWDH.js +3729 -0
  66. package/chunks/chunk-4Y4KQJXE.js +600 -0
  67. package/chunks/chunk-53G27VPS.js +136 -0
  68. package/chunks/chunk-57ZENEX2.js +169 -0
  69. package/chunks/chunk-5G3ZXFBW.js +182 -0
  70. package/chunks/chunk-6LKRLK2R.js +542 -0
  71. package/chunks/chunk-7DQEV5QI.js +287 -0
  72. package/chunks/chunk-A6CLR72I.js +235 -0
  73. package/chunks/chunk-BKZFDZ23.js +361 -0
  74. package/chunks/chunk-CLHCDHP4.js +471 -0
  75. package/chunks/chunk-D6S3IIPG.js +518 -0
  76. package/chunks/chunk-DN25OQQA.js +1070 -0
  77. package/chunks/chunk-DW5UWPFY.js +275 -0
  78. package/chunks/chunk-F3WBKITT.js +687 -0
  79. package/chunks/chunk-H2FFLZNK.js +3 -0
  80. package/chunks/chunk-H44E2CRN.js +193 -0
  81. package/chunks/chunk-HDWV7PGI.js +596 -0
  82. package/chunks/chunk-HE7LCA7G.js +381 -0
  83. package/chunks/chunk-HT6P7RY3.js +2597 -0
  84. package/chunks/chunk-IOL7D5YV.js +515 -0
  85. package/chunks/chunk-IORC6MQX.js +72828 -0
  86. package/chunks/chunk-IR537GON.js +49 -0
  87. package/chunks/chunk-K26SZ37E.js +5735 -0
  88. package/chunks/chunk-KKGE5RQE.js +1094 -0
  89. package/chunks/chunk-KLTNTE2Z.js +121 -0
  90. package/chunks/chunk-KTQDLNSR.js +1732 -0
  91. package/chunks/chunk-LOHTE223.js +2572 -0
  92. package/chunks/chunk-LP3HHYQU.js +245 -0
  93. package/chunks/chunk-MMLDQR4H.js +852 -0
  94. package/chunks/chunk-MYVT64FN.js +16 -0
  95. package/chunks/chunk-O462Y7P2.js +33019 -0
  96. package/chunks/chunk-OEFNRYI2.js +150 -0
  97. package/chunks/chunk-P6WKNFWX.js +1968 -0
  98. package/chunks/chunk-QI233I24.js +333 -0
  99. package/chunks/chunk-QJQKHO7G.js +917 -0
  100. package/chunks/chunk-QKICO43A.js +808 -0
  101. package/chunks/chunk-QOKTUOU2.js +102 -0
  102. package/chunks/chunk-RDZYQQLW.js +596 -0
  103. package/chunks/chunk-RJWOYEOG.js +271 -0
  104. package/chunks/chunk-RRMJC3ZE.js +105 -0
  105. package/chunks/chunk-RWONANDA.js +973 -0
  106. package/chunks/chunk-SAFFWQW4.js +5921 -0
  107. package/chunks/chunk-SF4KZ4O3.js +502 -0
  108. package/chunks/chunk-SNKTC4BP.js +1422 -0
  109. package/chunks/chunk-SOG2U7B3.js +662 -0
  110. package/chunks/chunk-SZJCPG2I.js +110 -0
  111. package/chunks/chunk-UJ4IK5PO.js +2010 -0
  112. package/chunks/chunk-UM3ZNQIM.js +9329 -0
  113. package/chunks/chunk-VGRDNSHA.js +3249 -0
  114. package/chunks/chunk-VQG4FT5D.js +685 -0
  115. package/chunks/chunk-WKNNZVJS.js +2798 -0
  116. package/chunks/chunk-WU6AFRAZ.js +1167 -0
  117. package/chunks/chunk-WVTBZEQO.js +1531 -0
  118. package/chunks/chunk-YLMN3N25.js +4054 -0
  119. package/chunks/commands-U3AMV5ZU.js +16795 -0
  120. package/chunks/corpus-v1.json +403 -0
  121. package/chunks/cost-ledger-ZCKMBJEN.js +13 -0
  122. package/chunks/data/appsec-archetypes.json +102 -0
  123. package/chunks/data/chromium-archetypes.json +204 -0
  124. package/chunks/data/freebsd-archetypes.json +171 -0
  125. package/chunks/data/kernel-archetypes.json +611 -0
  126. package/chunks/db-26NGQFKO.js +16 -0
  127. package/chunks/disclose-A6AEIEDA.js +132 -0
  128. package/chunks/dist-FDKALV4R.js +2772 -0
  129. package/chunks/dist-GL66KMUX.js +74 -0
  130. package/chunks/dist-JR67XKYO.js +159 -0
  131. package/chunks/eval-runner-DDLE5RQ3.js +27 -0
  132. package/chunks/example-manifest.json +95 -0
  133. package/chunks/exploit-agent-XP23ISN7.js +98 -0
  134. package/chunks/exploit-autoclimb-E6T7RRSC.js +81 -0
  135. package/chunks/exploit-climb-2FAUP6XU.js +358 -0
  136. package/chunks/fix-IG7LYXH3.js +12 -0
  137. package/chunks/github-issues-MJ6OYOOU.js +157 -0
  138. package/chunks/harness-HWOYFKFY.js +22 -0
  139. package/chunks/http-conformance-DU66MZIU.js +11 -0
  140. package/chunks/http-sender-GWH2IYEA.js +10 -0
  141. package/chunks/hunt-scan-XPELSPQQ.js +38 -0
  142. package/chunks/identity-6ZAIIWOR.js +191 -0
  143. package/chunks/kernel-primitive-TENE3R7T.js +44 -0
  144. package/chunks/kernel-vm-runner-4F6QSNFY.js +62 -0
  145. package/chunks/memsafety-scan-J7SECV5W.js +16 -0
  146. package/chunks/native-loop-NTONUDP7.js +54 -0
  147. package/chunks/npm-detectors-KB5Y5ZFX.js +69 -0
  148. package/chunks/npm-dynamic-discovery-AHROOZDB.js +13 -0
  149. package/chunks/orchestrate-ZUWAUWBC.js +62 -0
  150. package/chunks/pipeline-FCARFZU3.js +14 -0
  151. package/chunks/pre-recon-cve-66EB6G4M.js +351 -0
  152. package/chunks/prepare-MYY743TK.js +13 -0
  153. package/chunks/process-3Q7QJIOZ.js +13 -0
  154. package/chunks/replay-runner-RRR4E2A7.js +39 -0
  155. package/chunks/run-ESNN4V5W.js +32632 -0
  156. package/chunks/runtime-62ZQAH7H.js +43 -0
  157. package/chunks/runtime-J7PLXZNM.js +12 -0
  158. package/chunks/scan-stream-FHI2FYZE.js +96 -0
  159. package/chunks/scope-BI7BF4ZY.js +18 -0
  160. package/chunks/session-store-BCFQYDCE.js +28 -0
  161. package/chunks/source-files-PWRQR6LY.js +12 -0
  162. package/chunks/specdrift-WCLH6TTQ.js +19 -0
  163. package/chunks/variant-candidates-6KM6F6MD.js +13 -0
  164. package/chunks/web-recon-prepass-DPVCBRZA.js +1148 -0
  165. package/dashboard/assets/0sec-icon-66SreztZ.gif +0 -0
  166. package/dashboard/assets/bot-yILPnRgD.js +1 -0
  167. package/dashboard/assets/chevron-down-BeDJ-Vka.js +1 -0
  168. package/dashboard/assets/circle-alert-BEnMBMT-.js +1 -0
  169. package/dashboard/assets/client-DRYsuOGl.js +9 -0
  170. package/dashboard/assets/copy-Bi5vzoF9.js +1 -0
  171. package/dashboard/assets/desktop-CXTQonNm.js +32 -0
  172. package/dashboard/assets/desktop-NOekk4QS.css +1 -0
  173. package/dashboard/assets/dist-CmX-h7a4.js +1 -0
  174. package/dashboard/assets/dist-DAwYQmf_.js +45 -0
  175. package/dashboard/assets/findings-page-CACW9nw2.js +5 -0
  176. package/dashboard/assets/format-PoISqsES.js +1 -0
  177. package/dashboard/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  178. package/dashboard/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  179. package/dashboard/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  180. package/dashboard/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  181. package/dashboard/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  182. package/dashboard/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
  183. package/dashboard/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
  184. package/dashboard/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
  185. package/dashboard/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
  186. package/dashboard/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  187. package/dashboard/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  188. package/dashboard/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
  189. package/dashboard/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
  190. package/dashboard/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
  191. package/dashboard/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
  192. package/dashboard/assets/jsx-runtime-C7oxC63R.js +1 -0
  193. package/dashboard/assets/live-page-DrgQqQK5.js +1 -0
  194. package/dashboard/assets/meta-tile-CcskIV_o.js +1 -0
  195. package/dashboard/assets/operations-BKE8T-vY.css +2 -0
  196. package/dashboard/assets/operations-D8nUP5_m.js +4 -0
  197. package/dashboard/assets/operations-app-CQQhG54n.js +2 -0
  198. package/dashboard/assets/overview-page-DTGS8dPo.js +1 -0
  199. package/dashboard/assets/page-header-MFVvEtZW.js +1 -0
  200. package/dashboard/assets/play-Dwo-9xt6.js +1 -0
  201. package/dashboard/assets/scans-page-ChVtq8Us.js +1 -0
  202. package/dashboard/assets/search-CiooTLck.js +1 -0
  203. package/dashboard/assets/siren-CCBwTSuk.js +1 -0
  204. package/dashboard/assets/table-BYS-nIVA.js +1 -0
  205. package/dashboard/assets/tabs-DivxbhQy.js +1 -0
  206. package/dashboard/desktop.html +21 -0
  207. package/dashboard/index.html +15 -0
  208. package/package.json +30 -18
  209. package/bin/0sec.cjs +0 -361
@@ -0,0 +1,502 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __0secCreateRequire } from "node:module";
3
+ const require = __0secCreateRequire(import.meta.url);
4
+
5
+ // node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js
6
+ var ANSI_BACKGROUND_OFFSET = 10;
7
+ var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
8
+ var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
9
+ var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
10
+ var styles = {
11
+ modifier: {
12
+ reset: [0, 0],
13
+ // 21 isn't widely supported and 22 does the same thing
14
+ bold: [1, 22],
15
+ dim: [2, 22],
16
+ italic: [3, 23],
17
+ underline: [4, 24],
18
+ overline: [53, 55],
19
+ inverse: [7, 27],
20
+ hidden: [8, 28],
21
+ strikethrough: [9, 29]
22
+ },
23
+ color: {
24
+ black: [30, 39],
25
+ red: [31, 39],
26
+ green: [32, 39],
27
+ yellow: [33, 39],
28
+ blue: [34, 39],
29
+ magenta: [35, 39],
30
+ cyan: [36, 39],
31
+ white: [37, 39],
32
+ // Bright color
33
+ blackBright: [90, 39],
34
+ gray: [90, 39],
35
+ // Alias of `blackBright`
36
+ grey: [90, 39],
37
+ // Alias of `blackBright`
38
+ redBright: [91, 39],
39
+ greenBright: [92, 39],
40
+ yellowBright: [93, 39],
41
+ blueBright: [94, 39],
42
+ magentaBright: [95, 39],
43
+ cyanBright: [96, 39],
44
+ whiteBright: [97, 39]
45
+ },
46
+ bgColor: {
47
+ bgBlack: [40, 49],
48
+ bgRed: [41, 49],
49
+ bgGreen: [42, 49],
50
+ bgYellow: [43, 49],
51
+ bgBlue: [44, 49],
52
+ bgMagenta: [45, 49],
53
+ bgCyan: [46, 49],
54
+ bgWhite: [47, 49],
55
+ // Bright color
56
+ bgBlackBright: [100, 49],
57
+ bgGray: [100, 49],
58
+ // Alias of `bgBlackBright`
59
+ bgGrey: [100, 49],
60
+ // Alias of `bgBlackBright`
61
+ bgRedBright: [101, 49],
62
+ bgGreenBright: [102, 49],
63
+ bgYellowBright: [103, 49],
64
+ bgBlueBright: [104, 49],
65
+ bgMagentaBright: [105, 49],
66
+ bgCyanBright: [106, 49],
67
+ bgWhiteBright: [107, 49]
68
+ }
69
+ };
70
+ var modifierNames = Object.keys(styles.modifier);
71
+ var foregroundColorNames = Object.keys(styles.color);
72
+ var backgroundColorNames = Object.keys(styles.bgColor);
73
+ var colorNames = [...foregroundColorNames, ...backgroundColorNames];
74
+ function assembleStyles() {
75
+ const codes = /* @__PURE__ */ new Map();
76
+ for (const [groupName, group] of Object.entries(styles)) {
77
+ for (const [styleName, style] of Object.entries(group)) {
78
+ styles[styleName] = {
79
+ open: `\x1B[${style[0]}m`,
80
+ close: `\x1B[${style[1]}m`
81
+ };
82
+ group[styleName] = styles[styleName];
83
+ codes.set(style[0], style[1]);
84
+ }
85
+ Object.defineProperty(styles, groupName, {
86
+ value: group,
87
+ enumerable: false
88
+ });
89
+ }
90
+ Object.defineProperty(styles, "codes", {
91
+ value: codes,
92
+ enumerable: false
93
+ });
94
+ styles.color.close = "\x1B[39m";
95
+ styles.bgColor.close = "\x1B[49m";
96
+ styles.color.ansi = wrapAnsi16();
97
+ styles.color.ansi256 = wrapAnsi256();
98
+ styles.color.ansi16m = wrapAnsi16m();
99
+ styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
100
+ styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
101
+ styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
102
+ Object.defineProperties(styles, {
103
+ rgbToAnsi256: {
104
+ value(red, green, blue) {
105
+ if (red === green && green === blue) {
106
+ if (red < 8) {
107
+ return 16;
108
+ }
109
+ if (red > 248) {
110
+ return 231;
111
+ }
112
+ return Math.round((red - 8) / 247 * 24) + 232;
113
+ }
114
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
115
+ },
116
+ enumerable: false
117
+ },
118
+ hexToRgb: {
119
+ value(hex) {
120
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
121
+ if (!matches) {
122
+ return [0, 0, 0];
123
+ }
124
+ let [colorString] = matches;
125
+ if (colorString.length === 3) {
126
+ colorString = [...colorString].map((character) => character + character).join("");
127
+ }
128
+ const integer = Number.parseInt(colorString, 16);
129
+ return [
130
+ /* eslint-disable no-bitwise */
131
+ integer >> 16 & 255,
132
+ integer >> 8 & 255,
133
+ integer & 255
134
+ /* eslint-enable no-bitwise */
135
+ ];
136
+ },
137
+ enumerable: false
138
+ },
139
+ hexToAnsi256: {
140
+ value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
141
+ enumerable: false
142
+ },
143
+ ansi256ToAnsi: {
144
+ value(code) {
145
+ if (code < 8) {
146
+ return 30 + code;
147
+ }
148
+ if (code < 16) {
149
+ return 90 + (code - 8);
150
+ }
151
+ let red;
152
+ let green;
153
+ let blue;
154
+ if (code >= 232) {
155
+ red = ((code - 232) * 10 + 8) / 255;
156
+ green = red;
157
+ blue = red;
158
+ } else {
159
+ code -= 16;
160
+ const remainder = code % 36;
161
+ red = Math.floor(code / 36) / 5;
162
+ green = Math.floor(remainder / 6) / 5;
163
+ blue = remainder % 6 / 5;
164
+ }
165
+ const value = Math.max(red, green, blue) * 2;
166
+ if (value === 0) {
167
+ return 30;
168
+ }
169
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
170
+ if (value === 2) {
171
+ result += 60;
172
+ }
173
+ return result;
174
+ },
175
+ enumerable: false
176
+ },
177
+ rgbToAnsi: {
178
+ value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
179
+ enumerable: false
180
+ },
181
+ hexToAnsi: {
182
+ value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
183
+ enumerable: false
184
+ }
185
+ });
186
+ return styles;
187
+ }
188
+ var ansiStyles = assembleStyles();
189
+ var ansi_styles_default = ansiStyles;
190
+
191
+ // node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/index.js
192
+ import process from "node:process";
193
+ import os from "node:os";
194
+ import tty from "node:tty";
195
+ function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {
196
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
197
+ const position = argv.indexOf(prefix + flag);
198
+ const terminatorPosition = argv.indexOf("--");
199
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
200
+ }
201
+ var { env } = process;
202
+ var flagForceColor;
203
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
204
+ flagForceColor = 0;
205
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
206
+ flagForceColor = 1;
207
+ }
208
+ function envForceColor() {
209
+ if ("FORCE_COLOR" in env) {
210
+ if (env.FORCE_COLOR === "true") {
211
+ return 1;
212
+ }
213
+ if (env.FORCE_COLOR === "false") {
214
+ return 0;
215
+ }
216
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
217
+ }
218
+ }
219
+ function translateLevel(level) {
220
+ if (level === 0) {
221
+ return false;
222
+ }
223
+ return {
224
+ level,
225
+ hasBasic: true,
226
+ has256: level >= 2,
227
+ has16m: level >= 3
228
+ };
229
+ }
230
+ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
231
+ const noFlagForceColor = envForceColor();
232
+ if (noFlagForceColor !== void 0) {
233
+ flagForceColor = noFlagForceColor;
234
+ }
235
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
236
+ if (forceColor === 0) {
237
+ return 0;
238
+ }
239
+ if (sniffFlags) {
240
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
241
+ return 3;
242
+ }
243
+ if (hasFlag("color=256")) {
244
+ return 2;
245
+ }
246
+ }
247
+ if ("TF_BUILD" in env && "AGENT_NAME" in env) {
248
+ return 1;
249
+ }
250
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
251
+ return 0;
252
+ }
253
+ const min = forceColor || 0;
254
+ if (env.TERM === "dumb") {
255
+ return min;
256
+ }
257
+ if (process.platform === "win32") {
258
+ const osRelease = os.release().split(".");
259
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
260
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
261
+ }
262
+ return 1;
263
+ }
264
+ if ("CI" in env) {
265
+ if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
266
+ return 3;
267
+ }
268
+ if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
269
+ return 1;
270
+ }
271
+ return min;
272
+ }
273
+ if ("TEAMCITY_VERSION" in env) {
274
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
275
+ }
276
+ if (env.COLORTERM === "truecolor") {
277
+ return 3;
278
+ }
279
+ if (env.TERM === "xterm-kitty") {
280
+ return 3;
281
+ }
282
+ if (env.TERM === "xterm-ghostty") {
283
+ return 3;
284
+ }
285
+ if (env.TERM === "wezterm") {
286
+ return 3;
287
+ }
288
+ if ("TERM_PROGRAM" in env) {
289
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
290
+ switch (env.TERM_PROGRAM) {
291
+ case "iTerm.app": {
292
+ return version >= 3 ? 3 : 2;
293
+ }
294
+ case "Apple_Terminal": {
295
+ return 2;
296
+ }
297
+ }
298
+ }
299
+ if (/-256(color)?$/i.test(env.TERM)) {
300
+ return 2;
301
+ }
302
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
303
+ return 1;
304
+ }
305
+ if ("COLORTERM" in env) {
306
+ return 1;
307
+ }
308
+ return min;
309
+ }
310
+ function createSupportsColor(stream, options = {}) {
311
+ const level = _supportsColor(stream, {
312
+ streamIsTTY: stream && stream.isTTY,
313
+ ...options
314
+ });
315
+ return translateLevel(level);
316
+ }
317
+ var supportsColor = {
318
+ stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
319
+ stderr: createSupportsColor({ isTTY: tty.isatty(2) })
320
+ };
321
+ var supports_color_default = supportsColor;
322
+
323
+ // node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js
324
+ function stringReplaceAll(string, substring, replacer) {
325
+ let index = string.indexOf(substring);
326
+ if (index === -1) {
327
+ return string;
328
+ }
329
+ const substringLength = substring.length;
330
+ let endIndex = 0;
331
+ let returnValue = "";
332
+ do {
333
+ returnValue += string.slice(endIndex, index) + substring + replacer;
334
+ endIndex = index + substringLength;
335
+ index = string.indexOf(substring, endIndex);
336
+ } while (index !== -1);
337
+ returnValue += string.slice(endIndex);
338
+ return returnValue;
339
+ }
340
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
341
+ let endIndex = 0;
342
+ let returnValue = "";
343
+ do {
344
+ const gotCR = string[index - 1] === "\r";
345
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
346
+ endIndex = index + 1;
347
+ index = string.indexOf("\n", endIndex);
348
+ } while (index !== -1);
349
+ returnValue += string.slice(endIndex);
350
+ return returnValue;
351
+ }
352
+
353
+ // node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js
354
+ var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
355
+ var GENERATOR = /* @__PURE__ */ Symbol("GENERATOR");
356
+ var STYLER = /* @__PURE__ */ Symbol("STYLER");
357
+ var IS_EMPTY = /* @__PURE__ */ Symbol("IS_EMPTY");
358
+ var levelMapping = [
359
+ "ansi",
360
+ "ansi",
361
+ "ansi256",
362
+ "ansi16m"
363
+ ];
364
+ var styles2 = /* @__PURE__ */ Object.create(null);
365
+ var applyOptions = (object, options = {}) => {
366
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
367
+ throw new Error("The `level` option should be an integer from 0 to 3");
368
+ }
369
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
370
+ object.level = options.level === void 0 ? colorLevel : options.level;
371
+ };
372
+ var chalkFactory = (options) => {
373
+ const chalk2 = (...strings) => strings.join(" ");
374
+ applyOptions(chalk2, options);
375
+ Object.setPrototypeOf(chalk2, createChalk.prototype);
376
+ return chalk2;
377
+ };
378
+ function createChalk(options) {
379
+ return chalkFactory(options);
380
+ }
381
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
382
+ for (const [styleName, style] of Object.entries(ansi_styles_default)) {
383
+ styles2[styleName] = {
384
+ get() {
385
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
386
+ Object.defineProperty(this, styleName, { value: builder });
387
+ return builder;
388
+ }
389
+ };
390
+ }
391
+ styles2.visible = {
392
+ get() {
393
+ const builder = createBuilder(this, this[STYLER], true);
394
+ Object.defineProperty(this, "visible", { value: builder });
395
+ return builder;
396
+ }
397
+ };
398
+ var getModelAnsi = (model, level, type, ...arguments_) => {
399
+ if (model === "rgb") {
400
+ if (level === "ansi16m") {
401
+ return ansi_styles_default[type].ansi16m(...arguments_);
402
+ }
403
+ if (level === "ansi256") {
404
+ return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
405
+ }
406
+ return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
407
+ }
408
+ if (model === "hex") {
409
+ return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
410
+ }
411
+ return ansi_styles_default[type][model](...arguments_);
412
+ };
413
+ var usedModels = ["rgb", "hex", "ansi256"];
414
+ for (const model of usedModels) {
415
+ styles2[model] = {
416
+ get() {
417
+ const { level } = this;
418
+ return function(...arguments_) {
419
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
420
+ return createBuilder(this, styler, this[IS_EMPTY]);
421
+ };
422
+ }
423
+ };
424
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
425
+ styles2[bgModel] = {
426
+ get() {
427
+ const { level } = this;
428
+ return function(...arguments_) {
429
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
430
+ return createBuilder(this, styler, this[IS_EMPTY]);
431
+ };
432
+ }
433
+ };
434
+ }
435
+ var proto = Object.defineProperties(() => {
436
+ }, {
437
+ ...styles2,
438
+ level: {
439
+ enumerable: true,
440
+ get() {
441
+ return this[GENERATOR].level;
442
+ },
443
+ set(level) {
444
+ this[GENERATOR].level = level;
445
+ }
446
+ }
447
+ });
448
+ var createStyler = (open, close, parent) => {
449
+ let openAll;
450
+ let closeAll;
451
+ if (parent === void 0) {
452
+ openAll = open;
453
+ closeAll = close;
454
+ } else {
455
+ openAll = parent.openAll + open;
456
+ closeAll = close + parent.closeAll;
457
+ }
458
+ return {
459
+ open,
460
+ close,
461
+ openAll,
462
+ closeAll,
463
+ parent
464
+ };
465
+ };
466
+ var createBuilder = (self, _styler, _isEmpty) => {
467
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
468
+ Object.setPrototypeOf(builder, proto);
469
+ builder[GENERATOR] = self;
470
+ builder[STYLER] = _styler;
471
+ builder[IS_EMPTY] = _isEmpty;
472
+ return builder;
473
+ };
474
+ var applyStyle = (self, string) => {
475
+ if (self.level <= 0 || !string) {
476
+ return self[IS_EMPTY] ? "" : string;
477
+ }
478
+ let styler = self[STYLER];
479
+ if (styler === void 0) {
480
+ return string;
481
+ }
482
+ const { openAll, closeAll } = styler;
483
+ if (string.includes("\x1B")) {
484
+ while (styler !== void 0) {
485
+ string = stringReplaceAll(string, styler.close, styler.open);
486
+ styler = styler.parent;
487
+ }
488
+ }
489
+ const lfIndex = string.indexOf("\n");
490
+ if (lfIndex !== -1) {
491
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
492
+ }
493
+ return openAll + string + closeAll;
494
+ };
495
+ Object.defineProperties(createChalk.prototype, styles2);
496
+ var chalk = createChalk();
497
+ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
498
+ var source_default = chalk;
499
+
500
+ export {
501
+ source_default
502
+ };