@pensar/apex 2.4.0 → 2.5.0-canary.2512a649

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 (70) hide show
  1. package/build/agent-1wk9ejrw.js +19 -0
  2. package/build/{agent-5ejt5vpz.js → agent-cqxw0kd9.js} +24 -23
  3. package/build/agent-nhfjk81t.js +22 -0
  4. package/build/{agent-nhs1w5w0.js → agent-za6meqyw.js} +11 -10
  5. package/build/{apps-17wvz1d7.js → apps-eqncpkp8.js} +72 -31
  6. package/build/{auth-z3h9859n.js → auth-jabyx925.js} +25 -20
  7. package/build/blackboxAgent-6yg06yq2.js +22 -0
  8. package/build/blackboxPentest-9ckcgmqc.js +70 -0
  9. package/build/{cli-tkc598ey.js → cli-0drqd790.js} +633 -344
  10. package/build/cli-0nrxvm0t.js +12 -0
  11. package/build/{cli-gq40s5b3.js → cli-13bx8fdg.js} +28 -41
  12. package/build/cli-53rm0rrz.js +15 -0
  13. package/build/{cli-b1adytsy.js → cli-5s6jqck2.js} +28 -7
  14. package/build/{cli-2cbwdk78.js → cli-5xh2zw52.js} +1 -1
  15. package/build/cli-68260ckj.js +12136 -0
  16. package/build/cli-7q3ae3ft.js +6 -0
  17. package/build/{cli-72cvcqhg.js → cli-8k8wam9m.js} +1 -1
  18. package/build/{cli-mavved45.js → cli-8r0ekwvh.js} +54 -65
  19. package/build/{cli-swpbx60z.js → cli-avmhkjtv.js} +1 -1481
  20. package/build/{cli-9rhzhgx2.js → cli-dkxwnmrz.js} +1 -1
  21. package/build/{cli-0n4r54hq.js → cli-ewxfjn4c.js} +1 -1
  22. package/build/{cli-k8kc47pq.js → cli-fa5wxr8x.js} +32 -60
  23. package/build/{cli-xshasbwe.js → cli-g9xm89jx.js} +24 -45
  24. package/build/{cli-vnynf0js.js → cli-h1xcrswb.js} +10 -4
  25. package/build/cli-knd276ed.js +1485 -0
  26. package/build/{cli-repbyhkk.js → cli-nt8jrt7c.js} +2131 -1371
  27. package/build/{cli-tznv8pf1.js → cli-q8zkbvsn.js} +1 -1
  28. package/build/{cli-vq52kp7j.js → cli-qqzsm7gd.js} +23 -5
  29. package/build/{cli-32z0017y.js → cli-vazvj17j.js} +32 -56
  30. package/build/cli-w329bvm0.js +32 -0
  31. package/build/{cli-5k33webc.js → cli-ypavpbzs.js} +77 -51
  32. package/build/cli.js +661 -99
  33. package/build/{config-f1mj4nhd.js → config-bmz74x9e.js} +18 -15
  34. package/build/{doctor-ekneewa3.js → doctor-qw9mawme.js} +8 -7
  35. package/build/{fastStrike-8zka43xs.js → fastStrike-jpwx6dtk.js} +13 -11
  36. package/build/{fixes-b89s5haw.js → fixes-53r1jxkp.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-hqjdg6fg.js → index-4cknw5gy.js} +17 -11
  43. package/build/index-4fbqdgby.js +109 -0
  44. package/build/{index-mtq7kmxz.js → index-5wh7gq37.js} +4 -2
  45. package/build/{index-rbzhk712.js → index-dshvnys5.js} +10 -10
  46. package/build/{index-6d22pyxt.js → index-k8ybkkp1.js} +1785 -1228
  47. package/build/{index-4ad3sdwk.js → index-kcqbaf72.js} +4 -4
  48. package/build/{index-sf16jm0m.js → index-mxqe1y58.js} +11 -8
  49. package/build/{index-ghwf5z3v.js → index-p01t9n89.js} +3 -3
  50. package/build/{index-y5w6n3tb.js → index-xcpavpbs.js} +2 -2
  51. package/build/{issues-xx5bs4md.js → issues-xesdtrg9.js} +82 -26
  52. package/build/{logs-qtxe51w2.js → logs-83wtsyha.js} +25 -20
  53. package/build/{offesecAgent-b9e2xm6v.js → offesecAgent-efzhx1gf.js} +9 -9
  54. package/build/pentest-g1ma266m.js +30 -0
  55. package/build/{pentests-6ks3szc4.js → pentests-fcs7v2e9.js} +26 -21
  56. package/build/{targetedPentest-s1ptvq8e.js → targetedPentest-6hq0hmys.js} +17 -12
  57. package/build/{targets-sxygyj87.js → targets-qh73k68m.js} +27 -22
  58. package/build/threatModel-nqx5mr0y.js +29 -0
  59. package/build/{uninstall-tvsh81v8.js → uninstall-rab8zrm4.js} +6 -3
  60. package/build/{upload-7wdyyqmr.js → upload-kser9ga1.js} +8 -7
  61. package/build/{utils-7fwdkqk6.js → utils-7ngtwza4.js} +7 -6
  62. package/package.json +8 -2
  63. package/build/agent-mvpgvgks.js +0 -19
  64. package/build/authentication-3s97cpk4.js +0 -19
  65. package/build/blackboxAgent-gw0a1ca4.js +0 -19
  66. package/build/blackboxPentest-44333zss.js +0 -37
  67. package/build/cli-qqt4gj1w.js +0 -53
  68. package/build/main-mmjp338j.js +0 -324
  69. package/build/pentest-xtc1sjdw.js +0 -29
  70. package/build/threatModel-xsm6fwk5.js +0 -27
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getCurrentVersion,
3
3
  init_installation
4
- } from "./cli-vnynf0js.js";
4
+ } from "./cli-h1xcrswb.js";
5
5
  import {
6
6
  __esm
7
7
  } from "./cli-bc05qbss.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  config,
3
3
  init_config
4
- } from "./cli-72cvcqhg.js";
4
+ } from "./cli-8k8wam9m.js";
5
5
  import {
6
6
  __esm
7
7
  } from "./cli-bc05qbss.js";
@@ -2,16 +2,16 @@ import {
2
2
  EndpointTransportEnum,
3
3
  GrpcEndpointMetadataSchema,
4
4
  OffensiveSecurityAgent
5
- } from "./cli-repbyhkk.js";
5
+ } from "./cli-nt8jrt7c.js";
6
6
  import {
7
7
  hasToolCall,
8
8
  init_dist
9
- } from "./cli-tkc598ey.js";
9
+ } from "./cli-0drqd790.js";
10
10
  import {
11
11
  exports_external,
12
12
  init_zod,
13
13
  tool
14
- } from "./cli-swpbx60z.js";
14
+ } from "./cli-avmhkjtv.js";
15
15
 
16
16
  // src/core/agents/specialized/whiteboxAttackSurface/agent.ts
17
17
  init_dist();
@@ -392,50 +392,25 @@ var WhiteboxAttackSurfaceResultSchema = exports_external.object({
392
392
  });
393
393
 
394
394
  // src/core/agents/specialized/whiteboxAttackSurface/agent.ts
395
+ var WHITEBOX_FALLBACK_RESULT = {
396
+ repoType: "unknown",
397
+ packageManager: "unknown",
398
+ apps: [],
399
+ summary: {
400
+ totalApps: 0,
401
+ totalPages: 0,
402
+ totalApiEndpoints: 0,
403
+ totalPentestObjectives: 0
404
+ }
405
+ };
406
+
395
407
  class WhiteboxAttackSurfaceAgent extends OffensiveSecurityAgent {
396
408
  constructor(opts) {
397
- const {
398
- model,
399
- codebasePath,
400
- session,
401
- authConfig,
402
- onStepFinish,
403
- abortSignal,
404
- eventBus,
405
- subagentId,
406
- attackSurfaceRegistry,
407
- domains,
408
- enableThinking,
409
- thinkingEffort,
410
- openAIReasoningEffort
411
- } = opts;
409
+ const { codebasePath, domains, ...base } = opts;
412
410
  let capturedResult = null;
413
- const submitResultsTool = tool({
414
- description: `Submit the final whitebox attack surface analysis results.
415
-
416
- Call this ONCE at the end with your complete structured findings.
417
- This ends the agent run — make sure all data is included.`,
418
- inputSchema: WhiteboxAttackSurfaceResultSchema,
419
- execute: async (results) => {
420
- capturedResult = results;
421
- return { success: true, message: "Results submitted." };
422
- }
423
- });
424
411
  super({
412
+ ...base,
425
413
  system: WHITEBOX_ATTACK_SURFACE_SYSTEM_PROMPT,
426
- prompt: buildPrompt(codebasePath, domains, session.config?.prompt),
427
- model,
428
- session,
429
- authConfig,
430
- onStepFinish,
431
- abortSignal,
432
- eventBus,
433
- subagentId,
434
- subagentName: opts.subagentName,
435
- attackSurfaceRegistry,
436
- enableThinking,
437
- thinkingEffort,
438
- openAIReasoningEffort,
439
414
  activeTools: [
440
415
  "read_file",
441
416
  "list_files",
@@ -445,26 +420,23 @@ This ends the agent run — make sure all data is included.`,
445
420
  "spawn_coding_agent",
446
421
  "submit_results"
447
422
  ],
448
- extraTools: {
449
- submit_results: submitResultsTool
450
- },
451
423
  stopWhen: hasToolCall("submit_results"),
452
- resolveResult: () => {
453
- if (capturedResult) {
454
- return capturedResult;
455
- }
456
- return {
457
- repoType: "unknown",
458
- packageManager: "unknown",
459
- apps: [],
460
- summary: {
461
- totalApps: 0,
462
- totalPages: 0,
463
- totalApiEndpoints: 0,
464
- totalPentestObjectives: 0
424
+ extraTools: {
425
+ ...base.extraTools,
426
+ submit_results: tool({
427
+ description: `Submit the final whitebox attack surface analysis results.
428
+
429
+ Call this ONCE at the end with your complete structured findings.
430
+ This ends the agent run — make sure all data is included.`,
431
+ inputSchema: WhiteboxAttackSurfaceResultSchema,
432
+ execute: async (results) => {
433
+ capturedResult = results;
434
+ return { success: true, message: "Results submitted." };
465
435
  }
466
- };
467
- }
436
+ })
437
+ },
438
+ resolveResult: () => capturedResult ?? WHITEBOX_FALLBACK_RESULT,
439
+ prompt: buildPrompt(codebasePath, domains, base.session.config?.prompt)
468
440
  });
469
441
  }
470
442
  }
@@ -1,9 +1,12 @@
1
+ import {
2
+ MOBILE_OTP_PROMPT_GUIDANCE
3
+ } from "./cli-0nrxvm0t.js";
1
4
  import {
2
5
  OffensiveSecurityAgent
3
- } from "./cli-repbyhkk.js";
6
+ } from "./cli-nt8jrt7c.js";
4
7
  import {
5
8
  detectOSAndEnhancePrompt
6
- } from "./cli-tznv8pf1.js";
9
+ } from "./cli-q8zkbvsn.js";
7
10
  import {
8
11
  createLogger,
9
12
  hasToolCall,
@@ -11,7 +14,7 @@ import {
11
14
  init_lazyLogger,
12
15
  init_structured,
13
16
  scopedLogger
14
- } from "./cli-tkc598ey.js";
17
+ } from "./cli-0drqd790.js";
15
18
 
16
19
  // src/core/agents/specialized/authenticationAgent/agent.ts
17
20
  init_dist();
@@ -141,6 +144,11 @@ every 30 seconds, so run this immediately before filling the field. If the code
141
144
  retry once (you may have crossed a period boundary). Only report an MFA barrier if no seed is available
142
145
  or two fresh codes are both rejected.
143
146
 
147
+ ${MOBILE_OTP_PROMPT_GUIDANCE}
148
+
149
+ TOTP-via-environment-variable above is unchanged and still applies when the login asks for an authenticator
150
+ app code.
151
+
144
152
  # Error Recovery
145
153
 
146
154
  If authentication fails, try these mechanical fixes (they are login mechanics, not credential changes):
@@ -191,42 +199,12 @@ var log = scopedLogger(() => createLogger("authentication-agent"));
191
199
 
192
200
  class AuthenticationAgent extends OffensiveSecurityAgent {
193
201
  constructor(opts) {
194
- const {
195
- model,
196
- target,
197
- session,
198
- authHints,
199
- authConfig,
200
- onStepFinish,
201
- abortSignal,
202
- eventBus,
203
- subagentId,
204
- context,
205
- environmentVariables,
206
- secretValues,
207
- enableThinking,
208
- thinkingEffort,
209
- openAIReasoningEffort
210
- } = opts;
202
+ const { target, authHints, context, ...base } = opts;
203
+ const { session } = base;
211
204
  const cm = session.credentialManager;
212
205
  super({
206
+ ...base,
213
207
  system: detectOSAndEnhancePrompt(AUTH_SUBAGENT_SYSTEM_PROMPT),
214
- prompt: buildAuthPrompt(target, authHints, cm, context, environmentVariables ? Object.keys(environmentVariables) : undefined),
215
- model,
216
- session,
217
- target,
218
- authConfig,
219
- onStepFinish,
220
- abortSignal,
221
- eventBus,
222
- subagentId,
223
- subagentName: opts.subagentName,
224
- environmentVariables,
225
- secretValues,
226
- enableThinking,
227
- thinkingEffort,
228
- openAIReasoningEffort,
229
- toolChoice: "auto",
230
208
  activeTools: [
231
209
  "execute_command",
232
210
  "complete_authentication",
@@ -243,14 +221,14 @@ class AuthenticationAgent extends OffensiveSecurityAgent {
243
221
  "email_search_messages",
244
222
  "email_get_message",
245
223
  "send_email",
224
+ "sms_list_messages",
246
225
  "web_search",
247
226
  "get_page"
248
227
  ],
249
228
  stopWhen: hasToolCall("complete_authentication"),
250
- resolveResult: () => {
251
- const authDataPath = join(session.rootPath, "auth", "auth-data.json");
252
- return loadAuthResult(authDataPath);
253
- }
229
+ resolveResult: () => loadAuthResult(join(session.rootPath, "auth", "auth-data.json")),
230
+ target,
231
+ prompt: buildAuthPrompt(target, authHints, cm, context, base.environmentVariables ? Object.keys(base.environmentVariables) : undefined)
254
232
  });
255
233
  }
256
234
  }
@@ -328,6 +306,10 @@ function buildAuthPrompt(target, authHints, credentialManager, context, envVarNa
328
306
  parts.push("");
329
307
  }
330
308
  if (credBlock) {
309
+ const hasMobileOtp = credentialManager?.listReferences().some((ref) => ref.additionalFieldKeys?.includes("phoneNumber"));
310
+ const smsInstructions = hasMobileOtp ? `
311
+ ${MOBILE_OTP_PROMPT_GUIDANCE}
312
+ ` : "";
331
313
  parts.push(`INSTRUCTIONS:
332
314
  You have credentials available via credential IDs — authenticate immediately.
333
315
  1. For API/form logins, use execute_command (curl) to submit credentials and capture the Set-Cookie / token response
@@ -335,7 +317,7 @@ You have credentials available via credential IDs — authenticate immediately.
335
317
  pass credentialId + credentialField (e.g. credentialField="password") instead of the raw value —
336
318
  the secret is resolved securely at execution time. NEVER type a password directly.
337
319
  3. Call complete_authentication with exported cookies/headers to persist credentials and end the run
338
-
320
+ ${smsInstructions}
339
321
  The credentials above were provided to you and have already been verified — they are SHARED across runs, so
340
322
  do not modify them or their account settings. NEVER change the password, complete a password reset /
341
323
  forced-password-change / account-recovery flow, or modify MFA/2FA settings (enrolling, disabling, or
@@ -361,7 +343,4 @@ async function runAuthenticationAgent(input) {
361
343
  return result;
362
344
  }
363
345
 
364
- // src/core/api/authentication.ts
365
- var runAuthenticationAgent2 = runAuthenticationAgent;
366
-
367
- export { runAuthenticationAgent2 as runAuthenticationAgent };
346
+ export { AuthenticationAgent, runAuthenticationAgent };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./cli-bc05qbss.js";
4
4
 
5
5
  // package.json
6
- var package_default;
6
+ var version = "2.5.0-canary.2512a649", package_default;
7
7
  var init_package = __esm(() => {
8
8
  package_default = {
9
9
  author: "Pensar",
@@ -23,6 +23,10 @@ var init_package = __esm(() => {
23
23
  "@modelcontextprotocol/sdk": "^1.29.0",
24
24
  "@openrouter/ai-sdk-provider": "^2.9.1",
25
25
  "@opentelemetry/api": "^1.9.1",
26
+ "@opentelemetry/exporter-trace-otlp-http": "^0.221.0",
27
+ "@opentelemetry/otlp-exporter-base": "^0.221.0",
28
+ "@opentelemetry/otlp-transformer": "^0.221.0",
29
+ "@opentelemetry/resources": "^2.10.0",
26
30
  "@opentui/core": "^0.1.107",
27
31
  "@opentui/react": "^0.1.107",
28
32
  "@pensar/surface": "0.3.0",
@@ -46,6 +50,8 @@ var init_package = __esm(() => {
46
50
  description: "AI-powered penetration testing CLI tool with terminal UI",
47
51
  devDependencies: {
48
52
  "@biomejs/biome": "2.4.14",
53
+ "@opentelemetry/context-async-hooks": "^2.10.0",
54
+ "@opentelemetry/sdk-trace-base": "^2.10.0",
49
55
  "@types/bun": "^1.3.14",
50
56
  "@types/mailparser": "^3.4.6",
51
57
  "@types/mime-types": "^3.0.1",
@@ -92,7 +98,7 @@ var init_package = __esm(() => {
92
98
  url: "https://github.com/pensarai/apex.git"
93
99
  },
94
100
  scripts: {
95
- build: "bun build src/cli.ts --outdir build --target node --format esm --splitting --external @opentui/core --external @opentui/react --external @opentui/react/* --external react --external react/jsx-runtime --external react/jsx-dev-runtime --external react-reconciler --external weave --external electron --external chromium-bidi --external camoufox-js",
101
+ build: "rm -rf build && bun build src/cli.ts --outdir build --target node --format esm --splitting --external @opentui/core --external @opentui/react --external @opentui/react/* --external react --external react/jsx-runtime --external react/jsx-dev-runtime --external react-reconciler --external weave --external electron --external chromium-bidi --external camoufox-js",
96
102
  "build:binaries": "bun run generate:ascii && mkdir -p dist && bun run build:binary:macos-arm64 && bun run build:binary:macos-x64 && bun run build:binary:linux-x64 && bun run build:binary:linux-arm64",
97
103
  "build:binary": "bun run generate:ascii && bun build src/cli.ts --compile --external electron --external chromium-bidi --external camoufox-js --outfile pensar",
98
104
  "build:binary:linux-arm64": "bun build src/cli.ts --compile --external electron --external chromium-bidi --external camoufox-js --target=bun-linux-arm64 --outfile dist/pensar-linux-arm64",
@@ -120,7 +126,7 @@ var init_package = __esm(() => {
120
126
  tsc: "tsc --noEmit"
121
127
  },
122
128
  type: "module",
123
- version: "2.4.0"
129
+ version
124
130
  };
125
131
  });
126
132
 
@@ -195,4 +201,4 @@ var init_installation = __esm(() => {
195
201
  init_package();
196
202
  });
197
203
 
198
- export { init_package, package_default, getCurrentVersion, detectInstallMethod, checkForUpdate, init_installation };
204
+ export { init_package, version, package_default, getCurrentVersion, detectInstallMethod, checkForUpdate, init_installation };