@pensar/apex 2.3.0 → 2.4.0-canary.0d951436

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-35y2d05y.js +19 -0
  2. package/build/agent-cd1z4tst.js +29 -0
  3. package/build/{agent-9xna7jhw.js → agent-x3czh43n.js} +11 -11
  4. package/build/{apps-43pqbz7r.js → apps-bsgpnjp9.js} +57 -21
  5. package/build/{auth-c1z670rx.js → auth-6dx8c1kx.js} +38 -20
  6. package/build/authentication-nx61v9a4.js +19 -0
  7. package/build/blackboxAgent-1bzm1tmt.js +19 -0
  8. package/build/{blackboxPentest-tgc2t3y6.js → blackboxPentest-r9kch0a4.js} +17 -17
  9. package/build/{cli-vckbhnyk.js → cli-36hqpmfk.js} +2 -2
  10. package/build/{cli-50906d27.js → cli-4zwpvajr.js} +91 -29
  11. package/build/{cli-n2m2yy5b.js → cli-77fm0t26.js} +1348 -657
  12. package/build/{cli-eveg9djy.js → cli-8qcrjget.js} +3 -2
  13. package/build/{cli-bnkgdywr.js → cli-91s2kda0.js} +1 -1
  14. package/build/{cli-zm8tfpv7.js → cli-aqknajfz.js} +25 -9
  15. package/build/{cli-8rxa073f.js → cli-bc05qbss.js} +8 -6
  16. package/build/{cli-f7hanqbw.js → cli-czj2n2c0.js} +2 -2
  17. package/build/{cli-q24twygk.js → cli-dm0fc0bm.js} +1 -1
  18. package/build/{cli-zk1ch6qf.js → cli-dy295be8.js} +34 -9
  19. package/build/{cli-yz80qkzn.js → cli-ee3axgts.js} +7 -1
  20. package/build/{cli-f71s6kcw.js → cli-eza3mmy4.js} +81 -215
  21. package/build/{cli-j0n189ee.js → cli-gj651k8k.js} +2 -2
  22. package/build/{cli-gpnb45ck.js → cli-j54qa6tm.js} +7 -7
  23. package/build/{cli-wszshs5e.js → cli-k71t434r.js} +4 -4
  24. package/build/{cli-jyp2c6th.js → cli-m70zer7y.js} +2 -2
  25. package/build/{cli-bv2807tj.js → cli-nanb1srp.js} +3 -3
  26. package/build/{cli-72b18z0n.js → cli-qa226xfj.js} +3 -3
  27. package/build/{cli-3k1x5rn3.js → cli-swpbx60z.js} +1045 -1045
  28. package/build/{cli-7tw4xfnw.js → cli-tx0y7xq7.js} +1 -1
  29. package/build/{cli-zx8gk8xv.js → cli-wy0avc95.js} +296 -54
  30. package/build/{cli-baqhqbe5.js → cli-x0981jez.js} +3 -3
  31. package/build/{cli-barsn8br.js → cli-x2ss1hx3.js} +2 -2
  32. package/build/cli.js +52 -46
  33. package/build/{config-jzqjz606.js → config-c5mkb3ap.js} +5 -5
  34. package/build/{doctor-q3qws68e.js → doctor-4ndz0hmv.js} +10 -9
  35. package/build/{fastStrike-ebz1ph9a.js → fastStrike-hremncmc.js} +36 -16
  36. package/build/{fixes-86yebsj0.js → fixes-wve8wxjf.js} +19 -19
  37. package/build/index-1fvahjj1.js +12 -0
  38. package/build/{index-97vx1a24.js → index-6z3zyd07.js} +1517 -1444
  39. package/build/{index-8db1d2q3.js → index-8dt4w97g.js} +18 -18
  40. package/build/{index-h2hj2hj9.js → index-cbwn03kz.js} +16 -16
  41. package/build/{index-32hn8rrw.js → index-e8kpagx3.js} +3 -3
  42. package/build/{index-mr2cseg4.js → index-g3335zmk.js} +19 -19
  43. package/build/{index-gq9h8j5j.js → index-mtq7kmxz.js} +132 -132
  44. package/build/{index-tke6896d.js → index-psqjpw5m.js} +10 -10
  45. package/build/{index-e8c8zcrf.js → index-q9j0rw0v.js} +31 -26
  46. package/build/{index-468j74f3.js → index-x4acbkj9.js} +113 -97
  47. package/build/{issues-kh4wg8c5.js → issues-3ncz73eg.js} +19 -19
  48. package/build/{logs-bj28xmbf.js → logs-rv6x7g2m.js} +19 -19
  49. package/build/{main-3d7dfdvs.js → main-mmjp338j.js} +9 -9
  50. package/build/{multipart-parser-6zd16497.js → multipart-parser-g2xxkezz.js} +2 -2
  51. package/build/{offesecAgent-8ky7gccp.js → offesecAgent-p11pnbfm.js} +11 -11
  52. package/build/{parse-7djk9jyf.js → parse-rtccymzn.js} +3 -3
  53. package/build/pentest-9bvp6hdm.js +29 -0
  54. package/build/{pentests-62d6zw6p.js → pentests-8ttfwswe.js} +19 -19
  55. package/build/{targetedPentest-me4jnr3z.js → targetedPentest-n0reytxj.js} +14 -14
  56. package/build/{targets-e5k1mrky.js → targets-0waj2qfv.js} +19 -19
  57. package/build/threatModel-rg7p1ay0.js +27 -0
  58. package/build/{token-rdcbn380.js → token-3bbp59y6.js} +3 -3
  59. package/build/{token-util-sxb85ahn.js → token-util-6xjme11b.js} +2 -2
  60. package/build/{uninstall-jt1bca2p.js → uninstall-r22z1tmb.js} +2 -2
  61. package/build/{upload-krd8bnex.js → upload-42e1pt7w.js} +11 -11
  62. package/build/{utils-skmqhyfg.js → utils-k3vt2fmr.js} +17 -13
  63. package/package.json +1 -1
  64. package/build/agent-71z4e7jg.js +0 -19
  65. package/build/agent-ga5fecfs.js +0 -27
  66. package/build/authentication-hgs7ym0m.js +0 -19
  67. package/build/blackboxAgent-gem3mxa9.js +0 -19
  68. package/build/index-ag14v3sg.js +0 -12
  69. package/build/pentest-rs0181nf.js +0 -29
  70. package/build/threatModel-k4f3zgqd.js +0 -27
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getCurrentVersion,
3
3
  init_installation
4
- } from "./cli-barsn8br.js";
4
+ } from "./cli-x2ss1hx3.js";
5
5
  import {
6
6
  __esm
7
- } from "./cli-8rxa073f.js";
7
+ } from "./cli-bc05qbss.js";
8
8
 
9
9
  // src/core/config/config.ts
10
10
  import fs from "node:fs/promises";
@@ -45,6 +45,7 @@ function applyEnvFallbacks(parsedConfig) {
45
45
  anthropicAPIKey: parsedConfig.anthropicAPIKey ?? process.env.ANTHROPIC_API_KEY,
46
46
  googleAPIKey: parsedConfig.googleAPIKey ?? process.env.GOOGLE_GENERATIVE_AI_API_KEY,
47
47
  openRouterAPIKey: parsedConfig.openRouterAPIKey ?? process.env.OPENROUTER_API_KEY,
48
+ concentrateAPIKey: parsedConfig.concentrateAPIKey ?? process.env.CONCENTRATE_API_KEY,
48
49
  inceptionAPIKey: parsedConfig.inceptionAPIKey ?? process.env.INCEPTION_API_KEY,
49
50
  bedrockAPIKey: parsedConfig.bedrockAPIKey ?? process.env.BEDROCK_API_KEY,
50
51
  pensarAPIKey: parsedConfig.pensarAPIKey ?? process.env.PENSAR_API_KEY,
@@ -3,7 +3,7 @@ import {
3
3
  init_lazyLogger,
4
4
  init_structured,
5
5
  scopedLogger
6
- } from "./cli-zx8gk8xv.js";
6
+ } from "./cli-wy0avc95.js";
7
7
 
8
8
  // src/core/integrations/wandb/client.ts
9
9
  init_structured();
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  BlackboxAttackSurfaceAgent
3
- } from "./cli-bv2807tj.js";
3
+ } from "./cli-nanb1srp.js";
4
4
  import {
5
5
  REPORT_FILENAME_JSON,
6
6
  REPORT_FILENAME_MD,
7
7
  buildPentestReport,
8
8
  renderJson,
9
9
  renderMarkdown
10
- } from "./cli-72b18z0n.js";
10
+ } from "./cli-qa226xfj.js";
11
11
  import {
12
12
  TargetedPentestAgent,
13
13
  buildPentestSystemPrompt
14
- } from "./cli-50906d27.js";
14
+ } from "./cli-4zwpvajr.js";
15
15
  import {
16
16
  CodeAgent
17
- } from "./cli-j0n189ee.js";
17
+ } from "./cli-gj651k8k.js";
18
18
  import {
19
19
  AppsDiscoveryResultSchema,
20
20
  DiscoverySummarySchema,
@@ -22,7 +22,7 @@ import {
22
22
  WHITEBOX_APPS_DISCOVERY_SYSTEM_PROMPT,
23
23
  WHITEBOX_DISCOVERY_SYSTEM_PROMPT,
24
24
  WHITEBOX_ENDPOINT_DOCUMENTATION_SYSTEM_PROMPT
25
- } from "./cli-baqhqbe5.js";
25
+ } from "./cli-x0981jez.js";
26
26
  import {
27
27
  FindingsRegistry,
28
28
  OffensiveSecurityAgent,
@@ -31,7 +31,7 @@ import {
31
31
  pLimit,
32
32
  runWithBoundedConcurrency,
33
33
  toGrpcPentestContext
34
- } from "./cli-n2m2yy5b.js";
34
+ } from "./cli-77fm0t26.js";
35
35
  import {
36
36
  createThreatModelPrompt
37
37
  } from "./cli-fw5r7pfj.js";
@@ -45,10 +45,10 @@ import {
45
45
  init_structured,
46
46
  newSessionId,
47
47
  scopedLogger
48
- } from "./cli-zx8gk8xv.js";
48
+ } from "./cli-wy0avc95.js";
49
49
  import {
50
50
  __require
51
- } from "./cli-8rxa073f.js";
51
+ } from "./cli-bc05qbss.js";
52
52
 
53
53
  // src/core/workflows/pentest.ts
54
54
  init_dist();
@@ -7692,6 +7692,12 @@ async function runPentestSwarm(input) {
7692
7692
  });
7693
7693
  if (session.config?.requirePlan && session.config?.taskDriven && previousMessages.length === 0) {
7694
7694
  try {
7695
+ eventBus?.emit("subagent-spawn", {
7696
+ subagentId: `${subagentId}-plan`,
7697
+ name: `${subagentName} (plan)`,
7698
+ input: { target: target.target, objectives: target.objectives },
7699
+ parentSubagentId: subagentId
7700
+ });
7695
7701
  const executionTasksDir = join18(session.rootPath, "subagents", `${subagentId}-tasks`);
7696
7702
  const planAgent = new OffensiveSecurityAgent({
7697
7703
  system: PLAN_PHASE_SYSTEM_PROMPT,
@@ -7717,7 +7723,17 @@ async function runPentestSwarm(input) {
7717
7723
  display
7718
7724
  });
7719
7725
  await planAgent.consume();
7726
+ eventBus?.emit("subagent-complete", {
7727
+ subagentId: `${subagentId}-plan`,
7728
+ status: "completed",
7729
+ parentSubagentId: subagentId
7730
+ });
7720
7731
  } catch (planErr) {
7732
+ eventBus?.emit("subagent-complete", {
7733
+ subagentId: `${subagentId}-plan`,
7734
+ status: "failed",
7735
+ parentSubagentId: subagentId
7736
+ });
7721
7737
  log5.warn(`Plan phase failed for ${subagentId}: ${planErr}`);
7722
7738
  }
7723
7739
  }
@@ -7786,7 +7802,7 @@ async function runPentestSwarm(input) {
7786
7802
  }
7787
7803
  async function runPentestWorkflow(input) {
7788
7804
  if (input.fastStrike) {
7789
- const { runFastStrike } = await import("./fastStrike-ebz1ph9a.js");
7805
+ const { runFastStrike } = await import("./fastStrike-hremncmc.js");
7790
7806
  return runFastStrike(input);
7791
7807
  }
7792
7808
  const {
@@ -20,12 +20,14 @@ var __toESM = (mod, isNodeMode, target) => {
20
20
  }
21
21
  target = mod != null ? __create(__getProtoOf(mod)) : {};
22
22
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
23
- for (let key of __getOwnPropNames(mod))
24
- if (!__hasOwnProp.call(to, key))
25
- __defProp(to, key, {
26
- get: __accessProp.bind(mod, key),
27
- enumerable: true
28
- });
23
+ if (mod && typeof mod === "object" || typeof mod === "function") {
24
+ for (let key of __getOwnPropNames(mod))
25
+ if (!__hasOwnProp.call(to, key))
26
+ __defProp(to, key, {
27
+ get: __accessProp.bind(mod, key),
28
+ enumerable: true
29
+ });
30
+ }
29
31
  if (canCache)
30
32
  cache.set(mod, to);
31
33
  return to;
@@ -3,10 +3,10 @@ import {
3
3
  init,
4
4
  init_config,
5
5
  update
6
- } from "./cli-eveg9djy.js";
6
+ } from "./cli-8qcrjget.js";
7
7
  import {
8
8
  __esm
9
- } from "./cli-8rxa073f.js";
9
+ } from "./cli-bc05qbss.js";
10
10
 
11
11
  // src/core/config/index.ts
12
12
  var config;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __require
3
- } from "./cli-8rxa073f.js";
3
+ } from "./cli-bc05qbss.js";
4
4
 
5
5
  // src/core/http/parse.ts
6
6
  var NAME_TOKEN = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  OffensiveSecurityAgent
3
- } from "./cli-n2m2yy5b.js";
3
+ } from "./cli-77fm0t26.js";
4
4
  import {
5
5
  detectOSAndEnhancePrompt
6
- } from "./cli-7tw4xfnw.js";
6
+ } from "./cli-tx0y7xq7.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-zx8gk8xv.js";
14
+ } from "./cli-wy0avc95.js";
15
15
 
16
16
  // src/core/agents/specialized/authenticationAgent/agent.ts
17
17
  init_dist();
@@ -31,7 +31,7 @@ Obtain valid credentials/sessions that other agents can use for authenticated te
31
31
  # Operating Mode
32
32
 
33
33
  - Fully autonomous — no human intervention
34
- - If you encounter barriers (CAPTCHA, MFA), report failure with details
34
+ - If you encounter barriers (CAPTCHA, or MFA with no TOTP seed available), report failure with details
35
35
  - Call \`complete_authentication\` when done (success or failure)
36
36
 
37
37
  # Available Tools
@@ -125,6 +125,22 @@ These are the ONLY way downstream agents receive the session credentials.
125
125
 
126
126
  **Then**, call the \`response\` tool with your final summary to end the run. This is required — complete_authentication persists the data, response terminates the agent.
127
127
 
128
+ # MFA / TOTP Codes
129
+
130
+ If the login asks for a 6-digit authenticator code, check whether a TOTP seed was provided for this
131
+ account — it appears as an extra secret field on the credential and as a matching environment variable
132
+ (look for a name containing TOTP, MFA, OTP, or 2FA). If one exists, do NOT report an MFA barrier —
133
+ compute the code yourself:
134
+
135
+ \`\`\`
136
+ python3 -c "import base64,hmac,hashlib,struct,time,os;s=os.environ['<ENV_VAR>'].replace(' ','').upper();k=base64.b32decode(s+'='*(-len(s)%8));d=hmac.new(k,struct.pack('>Q',int(time.time())//30),hashlib.sha1).digest();o=d[-1]&15;print('%06d'%((struct.unpack('>I',d[o:o+4])[0]&0x7fffffff)%1000000))"
137
+ \`\`\`
138
+
139
+ Read the seed from the environment variable — never paste a seed literal into a command. Codes rotate
140
+ every 30 seconds, so run this immediately before filling the field. If the code is rejected, re-run and
141
+ retry once (you may have crossed a period boundary). Only report an MFA barrier if no seed is available
142
+ or two fresh codes are both rejected.
143
+
128
144
  # Error Recovery
129
145
 
130
146
  If authentication fails, try these mechanical fixes (they are login mechanics, not credential changes):
@@ -136,7 +152,8 @@ If authentication fails, try these mechanical fixes (they are login mechanics, n
136
152
 
137
153
  If credentials were provided to you, they are already verified and SHARED — do not modify them or their
138
154
  account settings. When such provided credentials are genuinely rejected — wrong password, account locked, a
139
- forced password change is required, MFA is required, or the email is not confirmed — do NOT try to recover by resetting or changing
155
+ forced password change is required, MFA is required and no TOTP seed was provided, or the email is not
156
+ confirmed — do NOT try to recover by resetting or changing
140
157
  the password, modifying MFA/2FA settings, or running any account-recovery flow. Fail fast: call
141
158
  \`complete_authentication\` with success=false and a summary naming the reason. Do NOT register a new account
142
159
  or self-sign-up to get around a rejected provided credential — that is a different account than the one
@@ -194,7 +211,7 @@ class AuthenticationAgent extends OffensiveSecurityAgent {
194
211
  const cm = session.credentialManager;
195
212
  super({
196
213
  system: detectOSAndEnhancePrompt(AUTH_SUBAGENT_SYSTEM_PROMPT),
197
- prompt: buildAuthPrompt(target, authHints, cm, context),
214
+ prompt: buildAuthPrompt(target, authHints, cm, context, environmentVariables ? Object.keys(environmentVariables) : undefined),
198
215
  model,
199
216
  session,
200
217
  target,
@@ -272,7 +289,7 @@ function loadAuthResult(authDataPath) {
272
289
  };
273
290
  }
274
291
  }
275
- function buildAuthPrompt(target, authHints, credentialManager, context) {
292
+ function buildAuthPrompt(target, authHints, credentialManager, context, envVarNames) {
276
293
  const parts = [`TARGET: ${target}
277
294
  `];
278
295
  if (context) {
@@ -290,6 +307,13 @@ function buildAuthPrompt(target, authHints, credentialManager, context) {
290
307
  parts.push(`No credentials provided. Probe the target to discover auth requirements.
291
308
  `);
292
309
  }
310
+ if (envVarNames?.length) {
311
+ parts.push("ENVIRONMENT VARIABLES:");
312
+ parts.push(`These are pre-loaded in your shell and available in every execute_command call. Reference them (e.g. $${envVarNames[0]}) — their values are hidden from you and redacted from command output, so never try to print one.`);
313
+ parts.push(envVarNames.map((n) => `- ${n}`).join(`
314
+ `));
315
+ parts.push("");
316
+ }
293
317
  if (authHints) {
294
318
  parts.push("AUTH HINTS:");
295
319
  if (authHints.authScheme)
@@ -316,8 +340,9 @@ The credentials above were provided to you and have already been verified — th
316
340
  do not modify them or their account settings. NEVER change the password, complete a password reset /
317
341
  forced-password-change / account-recovery flow, or modify MFA/2FA settings (enrolling, disabling, or
318
342
  resetting a second factor) for this account. If they do not authenticate (rejected, locked out, forced
319
- password change required, MFA required, email not confirmed), call complete_authentication with
320
- success=false and a clear summary of why — do not attempt to recover, reset, or rotate them. Do NOT
343
+ password change required, email not confirmed, or an MFA prompt with no TOTP seed available), call
344
+ complete_authentication with success=false and a clear summary of why — do not attempt to recover, reset,
345
+ or rotate them. When a TOTP seed IS available, generate the code and continue; that is not a barrier. Do NOT
321
346
  register a new account or self-sign-up to work around a failed login: that is not the credential under test
322
347
  and only pollutes results — fail fast with success=false instead.`);
323
348
  } else {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __esm
3
- } from "./cli-8rxa073f.js";
3
+ } from "./cli-bc05qbss.js";
4
4
 
5
5
  // src/core/providers/types.ts
6
6
  var AVAILABLE_PROVIDERS;
@@ -30,6 +30,12 @@ var init_types = __esm(() => {
30
30
  description: "Access multiple AI models through one API",
31
31
  requiresAPIKey: true
32
32
  },
33
+ {
34
+ id: "concentrate",
35
+ name: "Concentrate",
36
+ description: "Access multiple AI models through one API",
37
+ requiresAPIKey: true
38
+ },
33
39
  {
34
40
  id: "inception",
35
41
  name: "Inception",