@pensar/apex 2.4.0 → 2.5.0-canary.41357c27

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 (68) hide show
  1. package/build/{agent-nhs1w5w0.js → agent-092hrrbn.js} +11 -10
  2. package/build/{agent-5ejt5vpz.js → agent-jgdfbwse.js} +9 -8
  3. package/build/agent-z3ydv420.js +20 -0
  4. package/build/{apps-17wvz1d7.js → apps-pxwa5s9f.js} +72 -31
  5. package/build/{auth-z3h9859n.js → auth-j34f09ke.js} +25 -20
  6. package/build/authentication-jt9fq8y9.js +20 -0
  7. package/build/blackboxAgent-vwtk3hv1.js +20 -0
  8. package/build/blackboxPentest-nzn4xjd4.js +70 -0
  9. package/build/{cli-vnynf0js.js → cli-13vsx08y.js} +10 -4
  10. package/build/{cli-mavved45.js → cli-1e69fd35.js} +46 -25
  11. package/build/cli-53rm0rrz.js +15 -0
  12. package/build/cli-68260ckj.js +12136 -0
  13. package/build/{cli-tkc598ey.js → cli-70banr6y.js} +411 -280
  14. package/build/{cli-xshasbwe.js → cli-7hqdp86d.js} +34 -4
  15. package/build/cli-7q3ae3ft.js +6 -0
  16. package/build/cli-9pbk8m32.js +32 -0
  17. package/build/{cli-tznv8pf1.js → cli-9y49bzhd.js} +1 -1
  18. package/build/{cli-swpbx60z.js → cli-avmhkjtv.js} +1 -1481
  19. package/build/{cli-9rhzhgx2.js → cli-epqtwyeb.js} +1 -1
  20. package/build/cli-knd276ed.js +1485 -0
  21. package/build/{cli-repbyhkk.js → cli-mjd75xw4.js} +1129 -525
  22. package/build/{cli-5k33webc.js → cli-mtavwpav.js} +45 -43
  23. package/build/{cli-0n4r54hq.js → cli-naapss75.js} +1 -1
  24. package/build/{cli-gq40s5b3.js → cli-pd9j03q2.js} +5 -3
  25. package/build/{cli-qqt4gj1w.js → cli-pepts4ha.js} +5 -3
  26. package/build/{cli-32z0017y.js → cli-q2sq1qkn.js} +2 -2
  27. package/build/{cli-72cvcqhg.js → cli-x4e10v99.js} +1 -1
  28. package/build/{cli-2cbwdk78.js → cli-xan180ab.js} +1 -1
  29. package/build/{cli-vq52kp7j.js → cli-xp52xsqm.js} +23 -5
  30. package/build/{cli-k8kc47pq.js → cli-ygesx0vf.js} +3 -3
  31. package/build/{cli-b1adytsy.js → cli-yzhjh7x1.js} +28 -5
  32. package/build/cli.js +641 -95
  33. package/build/{config-f1mj4nhd.js → config-v87zm6cx.js} +18 -15
  34. package/build/{doctor-ekneewa3.js → doctor-705xb28k.js} +8 -7
  35. package/build/{fastStrike-8zka43xs.js → fastStrike-wp2tvcnq.js} +13 -10
  36. package/build/{fixes-b89s5haw.js → fixes-x8y42dh5.js} +25 -20
  37. package/build/getMachineId-bsd-xj3bn2fv.js +36 -0
  38. package/build/getMachineId-darwin-07jzjcx6.js +36 -0
  39. package/build/getMachineId-linux-ahngynxd.js +29 -0
  40. package/build/getMachineId-unsupported-vy43b44z.js +19 -0
  41. package/build/getMachineId-win-8x66cynz.js +38 -0
  42. package/build/{index-mtq7kmxz.js → index-5wh7gq37.js} +4 -2
  43. package/build/{index-sf16jm0m.js → index-6f06c8v0.js} +9 -7
  44. package/build/{index-hqjdg6fg.js → index-g0fvrp9n.js} +17 -9
  45. package/build/{index-y5w6n3tb.js → index-hdzja756.js} +2 -2
  46. package/build/{index-4ad3sdwk.js → index-q1hh6p80.js} +4 -4
  47. package/build/{index-ghwf5z3v.js → index-qpmdq6vj.js} +3 -3
  48. package/build/{index-6d22pyxt.js → index-sfwny7gx.js} +1756 -1213
  49. package/build/{index-rbzhk712.js → index-sx52n7s9.js} +11 -10
  50. package/build/{issues-xx5bs4md.js → issues-1g7j8ktr.js} +82 -26
  51. package/build/{logs-qtxe51w2.js → logs-6rjwnwz7.js} +25 -20
  52. package/build/{offesecAgent-b9e2xm6v.js → offesecAgent-frnz6ngh.js} +10 -9
  53. package/build/pentest-3w1jgsg7.js +30 -0
  54. package/build/{pentests-6ks3szc4.js → pentests-wxacefk4.js} +26 -21
  55. package/build/{targetedPentest-s1ptvq8e.js → targetedPentest-w1dze9hg.js} +11 -10
  56. package/build/{targets-sxygyj87.js → targets-vhxkvbmg.js} +27 -22
  57. package/build/threatModel-2k259rx1.js +29 -0
  58. package/build/{uninstall-tvsh81v8.js → uninstall-j8dmsaz5.js} +6 -3
  59. package/build/{upload-7wdyyqmr.js → upload-7pz6yt0n.js} +8 -7
  60. package/build/{utils-7fwdkqk6.js → utils-2gvfe1dz.js} +7 -6
  61. package/package.json +8 -2
  62. package/build/agent-mvpgvgks.js +0 -19
  63. package/build/authentication-3s97cpk4.js +0 -19
  64. package/build/blackboxAgent-gw0a1ca4.js +0 -19
  65. package/build/blackboxPentest-44333zss.js +0 -37
  66. package/build/main-mmjp338j.js +0 -324
  67. package/build/pentest-xtc1sjdw.js +0 -29
  68. package/build/threatModel-xsm6fwk5.js +0 -27
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  OffensiveSecurityAgent
3
- } from "./cli-repbyhkk.js";
3
+ } from "./cli-mjd75xw4.js";
4
4
  import {
5
5
  detectOSAndEnhancePrompt
6
- } from "./cli-tznv8pf1.js";
6
+ } from "./cli-9y49bzhd.js";
7
7
  import {
8
8
  createLogger,
9
9
  hasToolCall,
@@ -11,7 +11,7 @@ import {
11
11
  init_lazyLogger,
12
12
  init_structured,
13
13
  scopedLogger
14
- } from "./cli-tkc598ey.js";
14
+ } from "./cli-70banr6y.js";
15
15
 
16
16
  // src/core/agents/specialized/authenticationAgent/agent.ts
17
17
  init_dist();
@@ -141,6 +141,25 @@ every 30 seconds, so run this immediately before filling the field. If the code
141
141
  retry once (you may have crossed a period boundary). Only report an MFA barrier if no seed is available
142
142
  or two fresh codes are both rejected.
143
143
 
144
+ # SMS passwordless (phone as login)
145
+
146
+ If a credential has a \`phoneNumber\` additional field, the phone number IS the login identifier — not MFA
147
+ after a password. Do **not** report \`phone_verification\` as a barrier for this flow.
148
+
149
+ 1. Call \`sms_list_messages\` with \`reserve=true\` immediately before filling the phone field. Never pass
150
+ a phone number to this tool. If it returns 429, retry this reservation later as a separate attempt; do
151
+ not wait or poll inside the tool.
152
+ 2. \`browser_fill\` with \`credentialId\` and \`credentialField="phoneNumber"\` (never type the number).
153
+ 3. Click the target's send-code / text-me control. Note \`Date.now()\` at that click as \`sinceMs\`.
154
+ 4. \`execute_command\` \`sleep 5\`, then call \`sms_list_messages\` with \`sinceMs\` and \`claim=true\`.
155
+ If the list is empty, make one delayed list retry; if it stays empty or returns an error, stop and report
156
+ what you observed — do not hang in a wait loop.
157
+ 5. \`browser_fill\` the OTP from the claimed/listed result (\`code\`, or parse \`body\` if \`code\` is null).
158
+ 6. Continue the login and call \`complete_authentication\`.
159
+
160
+ TOTP-via-environment-variable above is unchanged and still applies when the login asks for an authenticator
161
+ app code.
162
+
144
163
  # Error Recovery
145
164
 
146
165
  If authentication fails, try these mechanical fixes (they are login mechanics, not credential changes):
@@ -243,6 +262,7 @@ class AuthenticationAgent extends OffensiveSecurityAgent {
243
262
  "email_search_messages",
244
263
  "email_get_message",
245
264
  "send_email",
265
+ "sms_list_messages",
246
266
  "web_search",
247
267
  "get_page"
248
268
  ],
@@ -328,6 +348,16 @@ function buildAuthPrompt(target, authHints, credentialManager, context, envVarNa
328
348
  parts.push("");
329
349
  }
330
350
  if (credBlock) {
351
+ const hasSmsPasswordless = credentialManager?.listReferences().some((ref) => ref.additionalFieldKeys?.includes("phoneNumber"));
352
+ const smsInstructions = hasSmsPasswordless ? `
353
+ If a credential has a phoneNumber additional field (Mobile OTP / sms-passwordless), phone is the login
354
+ identifier — not MFA-after-password. Immediately before filling the phone field, call sms_list_messages
355
+ with reserve=true; never pass that tool a phone number. If it returns 429, retry the reservation later as
356
+ a separate attempt without waiting in the tool. Then browser_fill credentialField="phoneNumber", click
357
+ send-code, and call sms_list_messages with sinceMs = Date.now() at that click and claim=true after a brief
358
+ execute_command sleep. If the list is empty, make one delayed list retry; if it stays empty, fail with what
359
+ you observed. Then browser_fill the OTP. Do NOT report phone_verification as a barrier for this flow.
360
+ TOTP-via-env for authenticator MFA is unchanged.` : "";
331
361
  parts.push(`INSTRUCTIONS:
332
362
  You have credentials available via credential IDs — authenticate immediately.
333
363
  1. For API/form logins, use execute_command (curl) to submit credentials and capture the Set-Cookie / token response
@@ -335,7 +365,7 @@ You have credentials available via credential IDs — authenticate immediately.
335
365
  pass credentialId + credentialField (e.g. credentialField="password") instead of the raw value —
336
366
  the secret is resolved securely at execution time. NEVER type a password directly.
337
367
  3. Call complete_authentication with exported cookies/headers to persist credentials and end the run
338
-
368
+ ${smsInstructions}
339
369
  The credentials above were provided to you and have already been verified — they are SHARED across runs, so
340
370
  do not modify them or their account settings. NEVER change the password, complete a password reset /
341
371
  forced-password-change / account-recovery flow, or modify MFA/2FA settings (enrolling, disabling, or
@@ -0,0 +1,6 @@
1
+ // src/cli/command-exit.ts
2
+ function markCommandFailed() {
3
+ process.exitCode = 1;
4
+ }
5
+
6
+ export { markCommandFailed };
@@ -0,0 +1,32 @@
1
+ // src/core/session/usage.ts
2
+ var EMPTY_SESSION_TOKEN_USAGE = {
3
+ inputTokens: 0,
4
+ outputTokens: 0,
5
+ cacheReadTokens: 0,
6
+ cacheWriteTokens: 0
7
+ };
8
+ function accumulateSessionTokens(current, step) {
9
+ const inputTokens = step.inputTokens ?? 0;
10
+ const outputTokens = step.outputTokens ?? 0;
11
+ const cacheReadTokens = step.cacheReadTokens ?? 0;
12
+ const cacheWriteTokens = step.cacheWriteTokens ?? 0;
13
+ if (inputTokens === 0 && outputTokens === 0 && cacheReadTokens === 0 && cacheWriteTokens === 0) {
14
+ return current;
15
+ }
16
+ return {
17
+ inputTokens: current.inputTokens + inputTokens,
18
+ outputTokens: current.outputTokens + outputTokens,
19
+ cacheReadTokens: current.cacheReadTokens + cacheReadTokens,
20
+ cacheWriteTokens: current.cacheWriteTokens + cacheWriteTokens
21
+ };
22
+ }
23
+ function contextPercentage(context) {
24
+ if (!context)
25
+ return null;
26
+ if (context.contextLimit <= 0)
27
+ return null;
28
+ const raw = context.usedTokens / context.contextLimit * 100;
29
+ return Math.min(100, Math.max(0, raw));
30
+ }
31
+
32
+ export { EMPTY_SESSION_TOKEN_USAGE, accumulateSessionTokens, contextPercentage };
@@ -3,7 +3,7 @@ import {
3
3
  init_lazyLogger,
4
4
  init_structured,
5
5
  scopedLogger
6
- } from "./cli-tkc598ey.js";
6
+ } from "./cli-70banr6y.js";
7
7
 
8
8
  // src/core/agents/specialized/utils.ts
9
9
  import { execSync } from "node:child_process";