@pensar/apex 2.1.2 → 2.1.3-canary.0e6728fd
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/build/agent-8xtrxjyz.js +27 -0
- package/build/agent-c9x70atb.js +19 -0
- package/build/{agent-737mxp3v.js → agent-jysnj2vg.js} +8 -8
- package/build/{apps-j0bwey0w.js → apps-bak1k8v0.js} +16 -16
- package/build/{auth-5stxpmga.js → auth-y8k6bahv.js} +16 -16
- package/build/authentication-yvcjxxer.js +19 -0
- package/build/blackboxAgent-fggn000t.js +19 -0
- package/build/{blackboxPentest-2edr9rj3.js → blackboxPentest-xkt0tw6t.js} +14 -14
- package/build/{cli-ks60cc3h.js → cli-08gv62zx.js} +30 -30
- package/build/{cli-f7d23ded.js → cli-29yqhrjq.js} +936 -1775
- package/build/{cli-whtdyc0e.js → cli-2r1wgr70.js} +4 -4
- package/build/{cli-gbkj2has.js → cli-4kk337yc.js} +3 -3
- package/build/{cli-tw3fe8bj.js → cli-7r4v9hdr.js} +2 -2
- package/build/{cli-hj3t87r2.js → cli-c25w7dwp.js} +1 -1
- package/build/{cli-35czfv00.js → cli-dqvnva4d.js} +70847 -79417
- package/build/{cli-yjbkaqvy.js → cli-gpbm6crd.js} +68 -22
- package/build/{cli-0gk2x2sc.js → cli-j89sg0bf.js} +16 -18
- package/build/{cli-6wwpk9d9.js → cli-j8gbfzaw.js} +1 -1
- package/build/{cli-dqkdnd3c.js → cli-s31p2dd0.js} +88 -49
- package/build/{cli-6vs0mtsb.js → cli-s5d8z6v2.js} +2 -2
- package/build/{cli-jd0c0b91.js → cli-tasyg3ks.js} +1 -1
- package/build/{cli-9vzc18m5.js → cli-tbtta1qx.js} +30 -17
- package/build/{cli-v1aqbv58.js → cli-twfafzdw.js} +23372 -25281
- package/build/{cli-9z6vwf30.js → cli-xbn0wpey.js} +1 -1
- package/build/{cli-xnnkeg5p.js → cli-zf4s30wk.js} +1 -1
- package/build/cli.js +110 -88
- package/build/{config-s5ryv5ez.js → config-11y9yj23.js} +3 -3
- package/build/{doctor-f08gegwc.js → doctor-fj9ekd87.js} +7 -7
- package/build/{fixes-qf4s92z2.js → fixes-1gaxek7g.js} +16 -16
- package/build/{index-x4xefngs.js → index-64xtwggx.js} +3 -3
- package/build/{index-sqjve2bm.js → index-aexn8f1n.js} +2 -2
- package/build/{index-c6qz0gve.js → index-bkvtrkvs.js} +7 -7
- package/build/{index-gakk2t5q.js → index-jv8bb79d.js} +20 -18
- package/build/{index-exvkbve0.js → index-mx23ftn2.js} +4 -4
- package/build/{index-mgng15va.js → index-n1yh9e86.js} +909 -456
- package/build/{index-5h1hjhzw.js → index-sdn8h33y.js} +10 -10
- package/build/{index-s8gw83d6.js → index-v14w25cq.js} +17 -11
- package/build/{issues-5anqrh2j.js → issues-4d6mh489.js} +16 -16
- package/build/{logs-q6ankt6m.js → logs-x5wm4a2n.js} +16 -16
- package/build/{main-3zneyg7p.js → main-3d7dfdvs.js} +17 -93
- package/build/{offesecAgent-hsej0pfc.js → offesecAgent-jv32qfp0.js} +9 -9
- package/build/pentest-9z7v3w8w.js +28 -0
- package/build/{pentests-hyx3c3qa.js → pentests-reen609m.js} +16 -16
- package/build/targetedPentest-2e9mdv9z.js +44 -0
- package/build/{targets-9cqrshet.js → targets-7y3e540x.js} +16 -16
- package/build/threatModel-6tvhhzz7.js +26 -0
- package/build/{uninstall-1j469qj7.js → uninstall-npc3w8z7.js} +1 -1
- package/build/{upload-ymvhkyq5.js → upload-yp2jqr7h.js} +7 -7
- package/build/{utils-d1ed6jzf.js → utils-pecyn9h9.js} +6 -6
- package/package.json +30 -30
- package/build/agent-8w9h3tnw.js +0 -19
- package/build/agent-vdrtakz4.js +0 -25
- package/build/authentication-qswvctj4.js +0 -19
- package/build/blackboxAgent-vwm9t3h4.js +0 -19
- package/build/pentest-1e30q7rs.js +0 -28
- package/build/targetedPentest-ws0a7frk.js +0 -36
- package/build/threatModel-z9b213x8.js +0 -26
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BlackboxAttackSurfaceAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-2r1wgr70.js";
|
|
4
4
|
import {
|
|
5
5
|
TargetedPentestAgent,
|
|
6
6
|
buildPentestSystemPrompt
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-gpbm6crd.js";
|
|
8
8
|
import {
|
|
9
9
|
CodeAgent
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-s5d8z6v2.js";
|
|
11
11
|
import {
|
|
12
12
|
AppsDiscoveryResultSchema,
|
|
13
13
|
DiscoverySummarySchema,
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
WHITEBOX_APPS_DISCOVERY_SYSTEM_PROMPT,
|
|
16
16
|
WHITEBOX_DISCOVERY_SYSTEM_PROMPT,
|
|
17
17
|
WHITEBOX_ENDPOINT_DOCUMENTATION_SYSTEM_PROMPT
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-4kk337yc.js";
|
|
19
19
|
import {
|
|
20
20
|
EvidenceFileEntrySchema
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-7r4v9hdr.js";
|
|
22
22
|
import {
|
|
23
23
|
CweEntrySchema,
|
|
24
24
|
FindingsRegistry,
|
|
@@ -26,8 +26,9 @@ import {
|
|
|
26
26
|
PLAN_MODE_TOOL_NAMES,
|
|
27
27
|
ValidatedCweEntrySchema,
|
|
28
28
|
hasCanonicalName,
|
|
29
|
+
pLimit,
|
|
29
30
|
runWithBoundedConcurrency
|
|
30
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-dqvnva4d.js";
|
|
31
32
|
import {
|
|
32
33
|
createThreatModelPrompt
|
|
33
34
|
} from "./cli-fw5r7pfj.js";
|
|
@@ -36,13 +37,14 @@ import {
|
|
|
36
37
|
hasToolCall,
|
|
37
38
|
init_dist,
|
|
38
39
|
init_lazyLogger,
|
|
40
|
+
init_session,
|
|
39
41
|
init_structured,
|
|
40
42
|
scopedLogger
|
|
41
|
-
} from "./cli-
|
|
43
|
+
} from "./cli-twfafzdw.js";
|
|
42
44
|
import {
|
|
43
45
|
exports_external,
|
|
44
46
|
init_zod
|
|
45
|
-
} from "./cli-
|
|
47
|
+
} from "./cli-29yqhrjq.js";
|
|
46
48
|
|
|
47
49
|
// src/core/workflows/pentest.ts
|
|
48
50
|
init_dist();
|
|
@@ -360,11 +362,13 @@ init_lazyLogger();
|
|
|
360
362
|
// src/core/session/persistence.ts
|
|
361
363
|
init_structured();
|
|
362
364
|
init_lazyLogger();
|
|
365
|
+
init_session();
|
|
363
366
|
import {
|
|
364
367
|
existsSync as existsSync2,
|
|
365
368
|
mkdirSync,
|
|
366
369
|
readdirSync,
|
|
367
370
|
readFileSync as readFileSync2,
|
|
371
|
+
renameSync,
|
|
368
372
|
statSync,
|
|
369
373
|
writeFileSync as writeFileSync2
|
|
370
374
|
} from "node:fs";
|
|
@@ -372,14 +376,14 @@ import { join as join2 } from "node:path";
|
|
|
372
376
|
var log = scopedLogger(() => createLogger("session:persistence"));
|
|
373
377
|
var SUBAGENTS_DIR = "subagents";
|
|
374
378
|
var MANIFEST_FILE = "agent-manifest.json";
|
|
375
|
-
function loadSubagentMessages(session,
|
|
376
|
-
const stepPath = join2(session.rootPath, SUBAGENTS_DIR,
|
|
379
|
+
function loadSubagentMessages(session, key) {
|
|
380
|
+
const stepPath = join2(session.rootPath, SUBAGENTS_DIR, key, "messages.json");
|
|
377
381
|
if (existsSync2(stepPath)) {
|
|
378
382
|
try {
|
|
379
383
|
return JSON.parse(readFileSync2(stepPath, "utf-8"));
|
|
380
384
|
} catch {}
|
|
381
385
|
}
|
|
382
|
-
const snapshotPath = join2(session.rootPath, SUBAGENTS_DIR, `${
|
|
386
|
+
const snapshotPath = join2(session.rootPath, SUBAGENTS_DIR, `${key}.json`);
|
|
383
387
|
if (!existsSync2(snapshotPath))
|
|
384
388
|
return [];
|
|
385
389
|
try {
|
|
@@ -523,6 +527,9 @@ function parseSubagentFilename(filename) {
|
|
|
523
527
|
if (filename.startsWith("orchestrator-")) {
|
|
524
528
|
return { agentType: "pentest", name: "Orchestrator Summary" };
|
|
525
529
|
}
|
|
530
|
+
if (filename.startsWith("ses_")) {
|
|
531
|
+
return { agentType: "pentest", name: "Pentest Worker" };
|
|
532
|
+
}
|
|
526
533
|
return { agentType: "pentest", name: filename.split("-")[0] || "Unknown" };
|
|
527
534
|
}
|
|
528
535
|
function unwrapAiSdkToolOutput(output) {
|
|
@@ -834,7 +841,8 @@ async function runEndpointDocumentationAgent(opts) {
|
|
|
834
841
|
openAIReasoningEffort,
|
|
835
842
|
enableThinking,
|
|
836
843
|
projectThreatModel,
|
|
837
|
-
parentSubagentId
|
|
844
|
+
parentSubagentId,
|
|
845
|
+
agentLimiter
|
|
838
846
|
} = opts;
|
|
839
847
|
const subagentId = `endpoint-doc-${slug(app.name)}-${slug(endpoint.path)}`;
|
|
840
848
|
const displayMethod = getDocumentMethod(endpoint);
|
|
@@ -876,7 +884,7 @@ async function runEndpointDocumentationAgent(opts) {
|
|
|
876
884
|
projectThreatModel
|
|
877
885
|
});
|
|
878
886
|
try {
|
|
879
|
-
await agent.consume();
|
|
887
|
+
await (agentLimiter ? agentLimiter(() => agent.consume()) : agent.consume());
|
|
880
888
|
eventBus?.emit("subagent-complete", {
|
|
881
889
|
subagentId,
|
|
882
890
|
status: "completed",
|
|
@@ -6195,6 +6203,7 @@ init_structured();
|
|
|
6195
6203
|
init_lazyLogger();
|
|
6196
6204
|
var log4 = scopedLogger(() => createLogger("whitebox-workflow"));
|
|
6197
6205
|
var DEFAULT_CONCURRENCY = 5;
|
|
6206
|
+
var MAX_CONCURRENT_AGENTS = 12;
|
|
6198
6207
|
var TASK_TYPE_LABELS = {
|
|
6199
6208
|
pages: "Pages",
|
|
6200
6209
|
apiEndpoints: "API Endpoints",
|
|
@@ -6228,8 +6237,11 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6228
6237
|
domains,
|
|
6229
6238
|
projectThreatModel,
|
|
6230
6239
|
environments,
|
|
6231
|
-
surfaceIntegrationEnabled = true
|
|
6240
|
+
surfaceIntegrationEnabled = true,
|
|
6241
|
+
maxConcurrentAgents = MAX_CONCURRENT_AGENTS
|
|
6232
6242
|
} = input;
|
|
6243
|
+
const agentSlots = pLimit(Math.max(1, maxConcurrentAgents));
|
|
6244
|
+
const agentLimiter = (fn) => agentSlots(fn);
|
|
6233
6245
|
const appsAgent = new CodeAgent({
|
|
6234
6246
|
codebasePath,
|
|
6235
6247
|
objective: buildAppsDiscoveryObjective(codebasePath, domains, environments),
|
|
@@ -6256,7 +6268,7 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6256
6268
|
name: "Whitebox Apps Discovery",
|
|
6257
6269
|
input: { codebasePath }
|
|
6258
6270
|
});
|
|
6259
|
-
const appsResult = await appsAgent.consume();
|
|
6271
|
+
const appsResult = await agentLimiter(() => appsAgent.consume());
|
|
6260
6272
|
log4.info(`Phase 1 complete: ${appsResult?.apps.length ?? 0} apps discovered` + (appsResult ? ` (repoType=${appsResult.repoType}, packageManager=${appsResult.packageManager})` : " (no result returned)"));
|
|
6261
6273
|
if (appsResult?.apps.length) {
|
|
6262
6274
|
for (const app of appsResult.apps) {
|
|
@@ -6340,7 +6352,7 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6340
6352
|
projectThreatModel
|
|
6341
6353
|
});
|
|
6342
6354
|
try {
|
|
6343
|
-
await agent.consume();
|
|
6355
|
+
await agentLimiter(() => agent.consume());
|
|
6344
6356
|
log4.debug(`Phase 2: agent "${subagentId}" completed`);
|
|
6345
6357
|
eventBus?.emit("subagent-complete", {
|
|
6346
6358
|
subagentId,
|
|
@@ -6391,7 +6403,8 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6391
6403
|
openAIReasoningEffort,
|
|
6392
6404
|
enableThinking,
|
|
6393
6405
|
projectThreatModel,
|
|
6394
|
-
parentSubagentId: appNodeId
|
|
6406
|
+
parentSubagentId: appNodeId,
|
|
6407
|
+
agentLimiter
|
|
6395
6408
|
});
|
|
6396
6409
|
} else {
|
|
6397
6410
|
log4.debug(`${app.name}: fallback (${surfaceResult.reason})`);
|