@pensar/apex 2.0.0 → 2.0.1
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/README.md +20 -0
- package/build/agent-4g69jwmq.js +19 -0
- package/build/{agent-x1tnsg7n.js → agent-6nhperp2.js} +7 -10
- package/build/{agent-z8043nrm.js → agent-x7n47c84.js} +9 -12
- package/build/{apps-gdze0s68.js → apps-2ac4vt09.js} +15 -18
- package/build/{auth-24ca1qwx.js → auth-bmt98hz0.js} +16 -19
- package/build/authentication-c0aj9zaz.js +19 -0
- package/build/blackboxAgent-sgph70e4.js +19 -0
- package/build/{blackboxPentest-xwc031xm.js → blackboxPentest-xngbtdxb.js} +13 -16
- package/build/{cli-a20jcpmp.js → cli-0yptvbbm.js} +1 -1
- package/build/{cli-pkdjamer.js → cli-1f5zzrxj.js} +15 -5
- package/build/{cli-0v9x0eby.js → cli-88bhxzr1.js} +1 -1
- package/build/{cli-948dk60p.js → cli-8g5cwvbm.js} +1 -1
- package/build/{cli-mswm4k81.js → cli-cc13ydyx.js} +11 -1
- package/build/{cli-wdmqkshz.js → cli-ddtmgbqv.js} +2 -2
- package/build/{cli-h6nw89zf.js → cli-eptabm2j.js} +1 -1
- package/build/{cli-zpvmaxem.js → cli-f93g10xk.js} +2 -2
- package/build/{cli-zvq4gy61.js → cli-fa7nrded.js} +13 -6
- package/build/{cli-sw5swz40.js → cli-fxtbkw2f.js} +3 -3
- package/build/{cli-ntd42071.js → cli-hk03x6fq.js} +1 -1
- package/build/{cli-5fr9k6m4.js → cli-mfzkhttr.js} +58 -35
- package/build/{cli-31cara07.js → cli-pyzw545d.js} +8 -6
- package/build/{cli-cb5va0cs.js → cli-w2st266h.js} +10 -1
- package/build/{cli-h825qzmd.js → cli-z1dapp7v.js} +1492 -53
- package/build/{cli-k8mvghe1.js → cli-zpdmnz8c.js} +455 -921
- package/build/cli.js +105 -45
- package/build/{config-cmq1cxz3.js → config-j0gfjhrm.js} +3 -3
- package/build/{doctor-2bkpddws.js → doctor-zn8ms7gs.js} +8 -1
- package/build/{fixes-a4qscvkx.js → fixes-d8ytvyzn.js} +15 -18
- package/build/{index-hfhkjj2g.js → index-2t2cg8x0.js} +8 -11
- package/build/{index-54ep0ery.js → index-3cbcjqw1.js} +9 -12
- package/build/{index-48pjf9d2.js → index-528cyewc.js} +94 -126
- package/build/{index-2a1x5nnv.js → index-9d2es97h.js} +3 -3
- package/build/{index-aymt8k9w.js → index-a1sy2zak.js} +2 -2
- package/build/{index-s17r2akv.js → index-hjvqqkem.js} +4 -4
- package/build/{index-0fnbx38r.js → index-k6ttkac6.js} +20 -14
- package/build/{issues-5pnrspt7.js → issues-17kdjtdg.js} +15 -18
- package/build/{logs-1mfm901x.js → logs-r4rjar4m.js} +15 -18
- package/build/{offesecAgent-mrbyc93d.js → offesecAgent-azd8ahkm.js} +8 -11
- package/build/pentest-2vsjf0j8.js +28 -0
- package/build/{pentests-htmtq66d.js → pentests-npjb5q1h.js} +15 -18
- package/build/{targetedPentest-cpbd87rc.js → targetedPentest-m24wvscc.js} +9 -12
- package/build/threatModel-7akmfzzm.js +26 -0
- package/build/{uninstall-6y9dkgyt.js → uninstall-7pm6zcah.js} +1 -1
- package/build/{upload-7wtbr768.js → upload-wg0vxmk0.js} +8 -1
- package/build/{utils-trqnyj77.js → utils-gd1y4t26.js} +6 -8
- package/package.json +1 -1
- package/build/agent-84enr6xn.js +0 -22
- package/build/authentication-0k43jay4.js +0 -22
- package/build/blackboxAgent-76tnwwg7.js +0 -22
- package/build/cli-1yavz2pb.js +0 -17
- package/build/cli-3knnkdps.js +0 -666
- package/build/cli-s1nckt4k.js +0 -20
- package/build/pentest-wy4eeagc.js +0 -31
- package/build/threatModel-9n56z6a6.js +0 -29
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BlackboxAttackSurfaceAgent
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-fxtbkw2f.js";
|
|
4
4
|
import {
|
|
5
5
|
TargetedPentestAgent,
|
|
6
6
|
buildPentestSystemPrompt
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-w2st266h.js";
|
|
8
8
|
import {
|
|
9
9
|
CodeAgent
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-f93g10xk.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-ddtmgbqv.js";
|
|
19
19
|
import {
|
|
20
20
|
EvidenceFileEntrySchema
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-hk03x6fq.js";
|
|
22
22
|
import {
|
|
23
23
|
CweEntrySchema,
|
|
24
24
|
FindingsRegistry,
|
|
@@ -27,14 +27,18 @@ import {
|
|
|
27
27
|
ValidatedCweEntrySchema,
|
|
28
28
|
hasCanonicalName,
|
|
29
29
|
runWithBoundedConcurrency
|
|
30
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-zpdmnz8c.js";
|
|
31
31
|
import {
|
|
32
32
|
createThreatModelPrompt
|
|
33
33
|
} from "./cli-fw5r7pfj.js";
|
|
34
34
|
import {
|
|
35
|
+
createLogger,
|
|
35
36
|
hasToolCall,
|
|
36
|
-
init_dist
|
|
37
|
-
|
|
37
|
+
init_dist,
|
|
38
|
+
init_lazyLogger,
|
|
39
|
+
init_structured,
|
|
40
|
+
scopedLogger
|
|
41
|
+
} from "./cli-z1dapp7v.js";
|
|
38
42
|
import {
|
|
39
43
|
exports_external1 as exports_external,
|
|
40
44
|
init_zod
|
|
@@ -88,6 +92,9 @@ ${objectiveList}
|
|
|
88
92
|
4. Submit the plan via submit_plan when complete`;
|
|
89
93
|
}
|
|
90
94
|
|
|
95
|
+
// src/core/workflows/pentest.ts
|
|
96
|
+
init_structured();
|
|
97
|
+
|
|
91
98
|
// src/core/report/schemas.ts
|
|
92
99
|
init_zod();
|
|
93
100
|
var PentestReportFindingSchema = exports_external.object({
|
|
@@ -343,10 +350,14 @@ function formatDurationHmsFromMs(durationMs) {
|
|
|
343
350
|
}
|
|
344
351
|
|
|
345
352
|
// src/core/session/loader.ts
|
|
353
|
+
init_structured();
|
|
346
354
|
import { existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
|
|
347
355
|
import { join as join3 } from "path";
|
|
356
|
+
init_lazyLogger();
|
|
348
357
|
|
|
349
358
|
// src/core/session/persistence.ts
|
|
359
|
+
init_structured();
|
|
360
|
+
init_lazyLogger();
|
|
350
361
|
import {
|
|
351
362
|
existsSync as existsSync2,
|
|
352
363
|
mkdirSync,
|
|
@@ -356,6 +367,7 @@ import {
|
|
|
356
367
|
writeFileSync as writeFileSync2
|
|
357
368
|
} from "fs";
|
|
358
369
|
import { join as join2 } from "path";
|
|
370
|
+
var log = scopedLogger(() => createLogger("session:persistence"));
|
|
359
371
|
var SUBAGENTS_DIR = "subagents";
|
|
360
372
|
var MANIFEST_FILE = "agent-manifest.json";
|
|
361
373
|
function loadSubagentMessages(session, agentName) {
|
|
@@ -641,7 +653,7 @@ function loadSubagents(rootPath) {
|
|
|
641
653
|
status
|
|
642
654
|
});
|
|
643
655
|
} catch (e) {
|
|
644
|
-
|
|
656
|
+
log.error(`Failed to load subagent file ${file}`, e instanceof Error ? e : undefined, { error: String(e) });
|
|
645
657
|
}
|
|
646
658
|
}
|
|
647
659
|
const entries = readdirSync(subagentsPath, { withFileTypes: true });
|
|
@@ -708,13 +720,14 @@ function loadSubagents(rootPath) {
|
|
|
708
720
|
}
|
|
709
721
|
}
|
|
710
722
|
} catch (e) {
|
|
711
|
-
|
|
723
|
+
log.error("Failed to load agent manifest", e instanceof Error ? e : undefined, { error: String(e) });
|
|
712
724
|
}
|
|
713
725
|
}
|
|
714
726
|
return subagents;
|
|
715
727
|
}
|
|
716
728
|
|
|
717
729
|
// src/core/session/loader.ts
|
|
730
|
+
var log2 = scopedLogger(() => createLogger("session:loader"));
|
|
718
731
|
function loadAttackSurfaceResults(rootPath) {
|
|
719
732
|
const resultsPath = join3(rootPath, "attack-surface-results.json");
|
|
720
733
|
if (!existsSync3(resultsPath)) {
|
|
@@ -723,11 +736,14 @@ function loadAttackSurfaceResults(rootPath) {
|
|
|
723
736
|
try {
|
|
724
737
|
return JSON.parse(readFileSync3(resultsPath, "utf-8"));
|
|
725
738
|
} catch (e) {
|
|
726
|
-
|
|
739
|
+
log2.error("Failed to load attack surface results", e instanceof Error ? e : undefined, { error: String(e) });
|
|
727
740
|
return null;
|
|
728
741
|
}
|
|
729
742
|
}
|
|
730
743
|
|
|
744
|
+
// src/core/workflows/pentest.ts
|
|
745
|
+
init_lazyLogger();
|
|
746
|
+
|
|
731
747
|
// src/core/workflows/whiteboxAttackSurface.ts
|
|
732
748
|
import {
|
|
733
749
|
existsSync as existsSync12,
|
|
@@ -740,6 +756,9 @@ import {
|
|
|
740
756
|
import { join as join15 } from "path";
|
|
741
757
|
|
|
742
758
|
// src/core/agents/specialized/whiteboxAttackSurface/endpointDocumentationAgent.ts
|
|
759
|
+
init_structured();
|
|
760
|
+
init_lazyLogger();
|
|
761
|
+
var log3 = scopedLogger(() => createLogger("endpoint-documentation-agent"));
|
|
743
762
|
var ENDPOINT_DOCUMENTATION_CONCURRENCY = 10;
|
|
744
763
|
function slug(name) {
|
|
745
764
|
return name.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_|_$/g, "");
|
|
@@ -861,7 +880,7 @@ async function runEndpointDocumentationAgent(opts) {
|
|
|
861
880
|
});
|
|
862
881
|
return true;
|
|
863
882
|
} catch (error) {
|
|
864
|
-
|
|
883
|
+
log3.error(`"${subagentId}" FAILED`, error instanceof Error ? error : undefined, { error: String(error) });
|
|
865
884
|
eventBus?.emit("subagent-complete", {
|
|
866
885
|
subagentId,
|
|
867
886
|
status: "failed",
|
|
@@ -6168,6 +6187,9 @@ function mapAppWithSurface(appPath, repoRoot, options) {
|
|
|
6168
6187
|
}
|
|
6169
6188
|
|
|
6170
6189
|
// src/core/workflows/whiteboxAttackSurface.ts
|
|
6190
|
+
init_structured();
|
|
6191
|
+
init_lazyLogger();
|
|
6192
|
+
var log4 = scopedLogger(() => createLogger("whitebox-workflow"));
|
|
6171
6193
|
var DEFAULT_CONCURRENCY = 5;
|
|
6172
6194
|
var TASK_TYPE_LABELS = {
|
|
6173
6195
|
pages: "Pages",
|
|
@@ -6221,7 +6243,7 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6221
6243
|
projectThreatModel,
|
|
6222
6244
|
excludeTools: ["document_endpoint"]
|
|
6223
6245
|
});
|
|
6224
|
-
|
|
6246
|
+
log4.info(`Phase 1: discovering apps in ${codebasePath}${domains?.length ? ` (${domains.length} known domains)` : ""}`);
|
|
6225
6247
|
const WORKFLOW_UMBRELLA_ID = "whitebox-apps-discovery";
|
|
6226
6248
|
eventBus?.emit("subagent-spawn", {
|
|
6227
6249
|
subagentId: WORKFLOW_UMBRELLA_ID,
|
|
@@ -6229,10 +6251,10 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6229
6251
|
input: { codebasePath }
|
|
6230
6252
|
});
|
|
6231
6253
|
const appsResult = await appsAgent.consume();
|
|
6232
|
-
|
|
6254
|
+
log4.info(`Phase 1 complete: ${appsResult?.apps.length ?? 0} apps discovered` + (appsResult ? ` (repoType=${appsResult.repoType}, packageManager=${appsResult.packageManager})` : " (no result returned)"));
|
|
6233
6255
|
if (appsResult?.apps.length) {
|
|
6234
6256
|
for (const app of appsResult.apps) {
|
|
6235
|
-
|
|
6257
|
+
log4.debug(`app: "${app.name}" type=${app.type} framework="${app.framework}" location="${app.location}"`);
|
|
6236
6258
|
}
|
|
6237
6259
|
}
|
|
6238
6260
|
if (!appsResult || appsResult.apps.length === 0) {
|
|
@@ -6259,11 +6281,11 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6259
6281
|
mkdirSync2(appDir, { recursive: true });
|
|
6260
6282
|
writeFileSync3(join15(appDir, "app.json"), JSON.stringify(toAppMetadata(app), null, 2), "utf-8");
|
|
6261
6283
|
}
|
|
6262
|
-
|
|
6284
|
+
log4.info(`Phase 2: surfaceIntegrationEnabled=${surfaceIntegrationEnabled}`);
|
|
6263
6285
|
const NON_SERVICE_TYPES = ["cloud_resource", "storage", "database"];
|
|
6264
6286
|
const serviceApps = appsResult.apps.filter((app) => !NON_SERVICE_TYPES.includes(app.type));
|
|
6265
6287
|
const cloudApps = appsResult.apps.filter((app) => NON_SERVICE_TYPES.includes(app.type));
|
|
6266
|
-
|
|
6288
|
+
log4.info(`Phase 2: ${serviceApps.length} service apps (surface or fallback per app), ${cloudApps.length} cloud resources → ${appsResult.apps.length} total apps`);
|
|
6267
6289
|
const totalApps = appsResult.apps.length;
|
|
6268
6290
|
let completedAppCount = 0;
|
|
6269
6291
|
eventBus?.emit("app-analysis-progress", {
|
|
@@ -6285,7 +6307,7 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6285
6307
|
const spawnDiscoveryAgent = async (app, type2, objective) => {
|
|
6286
6308
|
const subagentId = `${type2}-${app.name}`;
|
|
6287
6309
|
const appNodeId = appNodeIdFor(app.name);
|
|
6288
|
-
|
|
6310
|
+
log4.debug(`Phase 2: spawning agent id="${subagentId}" parent="${appNodeId}" (app="${app.name}", type=${type2}, appType=${app.type})`);
|
|
6289
6311
|
eventBus?.emit("subagent-spawn", {
|
|
6290
6312
|
subagentId,
|
|
6291
6313
|
name: TASK_TYPE_LABELS[type2],
|
|
@@ -6312,14 +6334,14 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6312
6334
|
});
|
|
6313
6335
|
try {
|
|
6314
6336
|
await agent.consume();
|
|
6315
|
-
|
|
6337
|
+
log4.debug(`Phase 2: agent "${subagentId}" completed`);
|
|
6316
6338
|
eventBus?.emit("subagent-complete", {
|
|
6317
6339
|
subagentId,
|
|
6318
6340
|
status: "completed",
|
|
6319
6341
|
parentSubagentId: appNodeId
|
|
6320
6342
|
});
|
|
6321
6343
|
} catch (error) {
|
|
6322
|
-
|
|
6344
|
+
log4.error(`Phase 2: agent "${subagentId}" FAILED`, error instanceof Error ? error : undefined, { error: String(error) });
|
|
6323
6345
|
appAnyTaskFailed.set(app.name, true);
|
|
6324
6346
|
eventBus?.emit("subagent-complete", {
|
|
6325
6347
|
subagentId,
|
|
@@ -6337,7 +6359,7 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6337
6359
|
if (NON_SERVICE_TYPES.includes(app.type)) {
|
|
6338
6360
|
await spawnCloudResourceAgent(app);
|
|
6339
6361
|
} else if (!surfaceIntegrationEnabled) {
|
|
6340
|
-
|
|
6362
|
+
log4.debug(`${app.name}: legacy (surfaceIntegrationEnabled=false)`);
|
|
6341
6363
|
await Promise.all([
|
|
6342
6364
|
spawnPagesAgent(app),
|
|
6343
6365
|
spawnApiEndpointsAgent(app)
|
|
@@ -6345,7 +6367,7 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6345
6367
|
} else {
|
|
6346
6368
|
const surfaceResult = mapAppWithSurface(join15(codebasePath, app.location), codebasePath, { isSingleAppRepo: serviceApps.length === 1 });
|
|
6347
6369
|
if (surfaceResult.mode === "surface") {
|
|
6348
|
-
|
|
6370
|
+
log4.debug(`${app.name}: surface-driven (${surfaceResult.endpoints.length} endpoints, frameworks=${surfaceResult.frameworks.join(",")})`);
|
|
6349
6371
|
await runAppEndpointDocumentation({
|
|
6350
6372
|
codebasePath,
|
|
6351
6373
|
app,
|
|
@@ -6364,7 +6386,7 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6364
6386
|
parentSubagentId: appNodeId
|
|
6365
6387
|
});
|
|
6366
6388
|
} else {
|
|
6367
|
-
|
|
6389
|
+
log4.debug(`${app.name}: fallback (${surfaceResult.reason})`);
|
|
6368
6390
|
await Promise.all([
|
|
6369
6391
|
spawnPagesAgent(app),
|
|
6370
6392
|
spawnApiEndpointsAgent(app)
|
|
@@ -6392,14 +6414,14 @@ async function runWhiteboxAttackSurfaceWorkflow(input) {
|
|
|
6392
6414
|
subagentId: WORKFLOW_UMBRELLA_ID,
|
|
6393
6415
|
status: "completed"
|
|
6394
6416
|
});
|
|
6395
|
-
|
|
6417
|
+
log4.info(`Phase 3: reading assets from ${assetsPath}`);
|
|
6396
6418
|
const {
|
|
6397
6419
|
apps: parsedApps,
|
|
6398
6420
|
repoType,
|
|
6399
6421
|
packageManager
|
|
6400
6422
|
} = readAppsFromAssetsDirectory(assetsPath, appsResult);
|
|
6401
6423
|
for (const app of parsedApps) {
|
|
6402
|
-
|
|
6424
|
+
log4.debug(`Phase 3: "${app.name}" → ${app.pages.length} pages, ${app.apiEndpoints.length} API endpoints`);
|
|
6403
6425
|
}
|
|
6404
6426
|
const apps = parsedApps;
|
|
6405
6427
|
const totalPages = apps.reduce((sum, a) => sum + a.pages.length, 0);
|
|
@@ -6421,16 +6443,16 @@ function readAppsFromAssetsDirectory(assetsPath, appsDiscovery) {
|
|
|
6421
6443
|
const repoType = appsDiscovery?.repoType ?? "unknown";
|
|
6422
6444
|
const packageManager = appsDiscovery?.packageManager ?? "unknown";
|
|
6423
6445
|
if (!existsSync12(assetsPath)) {
|
|
6424
|
-
|
|
6446
|
+
log4.debug(`readAssets: assets directory does not exist: ${assetsPath}`);
|
|
6425
6447
|
return { apps: [], repoType, packageManager };
|
|
6426
6448
|
}
|
|
6427
6449
|
const entries = readdirSync10(assetsPath);
|
|
6428
|
-
|
|
6450
|
+
log4.debug(`readAssets: found ${entries.length} entries in ${assetsPath}: [${entries.join(", ")}]`);
|
|
6429
6451
|
const apps = [];
|
|
6430
6452
|
for (const entry of entries) {
|
|
6431
6453
|
const entryPath = join15(assetsPath, entry);
|
|
6432
6454
|
if (!statSync2(entryPath).isDirectory()) {
|
|
6433
|
-
|
|
6455
|
+
log4.debug(`readAssets: skipping non-directory: ${entry}`);
|
|
6434
6456
|
continue;
|
|
6435
6457
|
}
|
|
6436
6458
|
const appJsonPath = join15(entryPath, "app.json");
|
|
@@ -6439,17 +6461,17 @@ function readAppsFromAssetsDirectory(assetsPath, appsDiscovery) {
|
|
|
6439
6461
|
try {
|
|
6440
6462
|
metadata = JSON.parse(readFileSync9(appJsonPath, "utf-8"));
|
|
6441
6463
|
} catch {
|
|
6442
|
-
|
|
6464
|
+
log4.warn(`readAssets: skipping app folder with unreadable app.json: ${entry}`);
|
|
6443
6465
|
continue;
|
|
6444
6466
|
}
|
|
6445
6467
|
} else {
|
|
6446
|
-
|
|
6468
|
+
log4.debug(`readAssets: skipping folder without app.json: ${entry}`);
|
|
6447
6469
|
continue;
|
|
6448
6470
|
}
|
|
6449
6471
|
const pages = [];
|
|
6450
6472
|
const apiEndpoints = [];
|
|
6451
6473
|
const assetFiles = readdirSync10(entryPath).filter((f) => f.endsWith(".json") && f !== "app.json");
|
|
6452
|
-
|
|
6474
|
+
log4.debug(`readAssets: app "${metadata.name}" (${entry}): ${assetFiles.length} asset files`);
|
|
6453
6475
|
let parseFailed = 0;
|
|
6454
6476
|
for (const file of assetFiles) {
|
|
6455
6477
|
try {
|
|
@@ -6457,7 +6479,7 @@ function readAppsFromAssetsDirectory(assetsPath, appsDiscovery) {
|
|
|
6457
6479
|
const data = JSON.parse(raw);
|
|
6458
6480
|
const endpoint2 = assetRecordToEndpoint(data);
|
|
6459
6481
|
if (!endpoint2) {
|
|
6460
|
-
|
|
6482
|
+
log4.debug(`readAssets: ${file}: failed schema validation (assetRecordToEndpoint returned null)`);
|
|
6461
6483
|
parseFailed++;
|
|
6462
6484
|
continue;
|
|
6463
6485
|
}
|
|
@@ -6467,11 +6489,11 @@ function readAppsFromAssetsDirectory(assetsPath, appsDiscovery) {
|
|
|
6467
6489
|
apiEndpoints.push(endpoint2);
|
|
6468
6490
|
}
|
|
6469
6491
|
} catch {
|
|
6470
|
-
|
|
6492
|
+
log4.warn(`readAssets: skipping unreadable asset file: ${entry}/${file}`);
|
|
6471
6493
|
parseFailed++;
|
|
6472
6494
|
}
|
|
6473
6495
|
}
|
|
6474
|
-
|
|
6496
|
+
log4.debug(`readAssets: app "${metadata.name}": ${pages.length} pages, ${apiEndpoints.length} API endpoints, ${parseFailed} failed`);
|
|
6475
6497
|
apps.push({
|
|
6476
6498
|
name: metadata.name,
|
|
6477
6499
|
type: metadata.type ?? "web_application",
|
|
@@ -6797,6 +6819,7 @@ When finished, call \`response\` with a summary of how many entry points you doc
|
|
|
6797
6819
|
}
|
|
6798
6820
|
|
|
6799
6821
|
// src/core/workflows/pentest.ts
|
|
6822
|
+
var log5 = scopedLogger(() => createLogger("pentest-swarm"));
|
|
6800
6823
|
var DEFAULT_CONCURRENCY2 = 10;
|
|
6801
6824
|
function addUsageTotals(totals, usage) {
|
|
6802
6825
|
if (!usage)
|
|
@@ -6874,7 +6897,7 @@ async function runPentestSwarm(input) {
|
|
|
6874
6897
|
});
|
|
6875
6898
|
await planAgent.consume();
|
|
6876
6899
|
} catch (planErr) {
|
|
6877
|
-
|
|
6900
|
+
log5.warn(`Plan phase failed for ${subagentId}: ${planErr}`);
|
|
6878
6901
|
}
|
|
6879
6902
|
}
|
|
6880
6903
|
const objectiveStr = target.objectives.join("; ");
|
|
@@ -3,19 +3,20 @@ import {
|
|
|
3
3
|
ASK_USER_QUESTIONS_TOOL_NAME,
|
|
4
4
|
OffensiveSecurityAgent,
|
|
5
5
|
SKILL_TOOL_NAMES,
|
|
6
|
-
buildBaseSystemPrompt
|
|
7
|
-
|
|
8
|
-
} from "./cli-k8mvghe1.js";
|
|
6
|
+
buildBaseSystemPrompt
|
|
7
|
+
} from "./cli-zpdmnz8c.js";
|
|
9
8
|
import {
|
|
10
9
|
init_dist,
|
|
10
|
+
init_session,
|
|
11
|
+
sessions,
|
|
11
12
|
stepCountIs
|
|
12
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-z1dapp7v.js";
|
|
13
14
|
import {
|
|
14
15
|
ensureValidToken,
|
|
15
16
|
getPensarApiUrl,
|
|
16
17
|
init_auth,
|
|
17
18
|
init_constants
|
|
18
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-8g5cwvbm.js";
|
|
19
20
|
import {
|
|
20
21
|
exports_external1 as exports_external,
|
|
21
22
|
init_zod
|
|
@@ -23,7 +24,7 @@ import {
|
|
|
23
24
|
import {
|
|
24
25
|
config,
|
|
25
26
|
init_config
|
|
26
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-eptabm2j.js";
|
|
27
28
|
import {
|
|
28
29
|
__commonJS,
|
|
29
30
|
__require
|
|
@@ -7441,6 +7442,7 @@ var PatchResultSchema = exports_external.object({
|
|
|
7441
7442
|
});
|
|
7442
7443
|
// src/core/workflows/threatModel.ts
|
|
7443
7444
|
init_dist();
|
|
7445
|
+
init_session();
|
|
7444
7446
|
|
|
7445
7447
|
// src/core/skills/registry.ts
|
|
7446
7448
|
import fs2 from "fs/promises";
|
|
@@ -2,7 +2,13 @@ import {
|
|
|
2
2
|
OffensiveSecurityAgent,
|
|
3
3
|
isMemoryEnabled,
|
|
4
4
|
readPlan
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-zpdmnz8c.js";
|
|
6
|
+
import {
|
|
7
|
+
createLogger,
|
|
8
|
+
init_lazyLogger,
|
|
9
|
+
init_structured,
|
|
10
|
+
scopedLogger
|
|
11
|
+
} from "./cli-z1dapp7v.js";
|
|
6
12
|
import {
|
|
7
13
|
exports_external1 as exports_external,
|
|
8
14
|
init_zod
|
|
@@ -10,8 +16,11 @@ import {
|
|
|
10
16
|
|
|
11
17
|
// src/core/agents/specialized/pentest/agent.ts
|
|
12
18
|
init_zod();
|
|
19
|
+
init_structured();
|
|
13
20
|
import { existsSync, readdirSync, readFileSync } from "fs";
|
|
14
21
|
import { join } from "path";
|
|
22
|
+
init_lazyLogger();
|
|
23
|
+
var log = scopedLogger(() => createLogger("pentest-agent"));
|
|
15
24
|
var ObjectiveResultSchema = exports_external.object({
|
|
16
25
|
objective: exports_external.string().describe("The objective text, exactly as it was provided or a refined version"),
|
|
17
26
|
completed: exports_external.boolean().describe("true if this objective was thoroughly tested and can be considered done for this endpoint; false if it still needs further testing in future runs"),
|